@adyen/bento-vue2 1.52.0 → 1.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/components.d.ts +2 -0
- package/dist/@types/index.d.ts +474 -75
- 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/card.css +1 -1
- package/dist/assets/checkbox.css +1 -1
- package/dist/assets/dashed-underline.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/header-with-views.css +1 -0
- package/dist/assets/input-field-password.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/sidepanel.css +1 -1
- package/dist/assets/summary-grid-item-custom.css +1 -1
- package/dist/assets/use-cached-selected-values.css +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{action-bar.DuJkjAt1.js → action-bar.Cuktzrp5.js} +4 -4
- package/dist/chunks/{action-bar.DuJkjAt1.js.map → action-bar.Cuktzrp5.js.map} +1 -1
- package/dist/chunks/{base-modal.CiTysydg.js → base-modal.DnaWOvaM.js} +3 -3
- package/dist/chunks/{base-modal.CiTysydg.js.map → base-modal.DnaWOvaM.js.map} +1 -1
- package/dist/chunks/bin.DuebwJYu.js +24 -0
- package/dist/chunks/bin.DuebwJYu.js.map +1 -0
- package/dist/chunks/{button-actions-with-menu.B9oXYIgo.js → button-actions-with-menu.twMFsb82.js} +4 -4
- package/dist/chunks/{button-actions-with-menu.B9oXYIgo.js.map → button-actions-with-menu.twMFsb82.js.map} +1 -1
- package/dist/chunks/{calendar.Bq67h02Z.js → calendar.CJToU_uI.js} +2 -2
- package/dist/chunks/{calendar.Bq67h02Z.js.map → calendar.CJToU_uI.js.map} +1 -1
- package/dist/chunks/{checkbox-group.CqSIn-lG.js → checkbox-group.DkM6n3JR.js} +4 -4
- package/dist/chunks/{checkbox-group.CqSIn-lG.js.map → checkbox-group.DkM6n3JR.js.map} +1 -1
- package/dist/chunks/checkbox.l7h6GYew.js +176 -0
- package/dist/chunks/checkbox.l7h6GYew.js.map +1 -0
- package/dist/chunks/{click-outside.DSszkIvs.js → click-outside.C1Ud8AA2.js} +2 -2
- package/dist/chunks/{click-outside.DSszkIvs.js.map → click-outside.C1Ud8AA2.js.map} +1 -1
- package/dist/chunks/{code-snippet.CW42FdpP.js → code-snippet.BsEe6nml.js} +5 -5
- package/dist/chunks/{code-snippet.CW42FdpP.js.map → code-snippet.BsEe6nml.js.map} +1 -1
- package/dist/chunks/{controls-group.D0_cJaFF.js → controls-group.vFyThDMU.js} +2 -2
- package/dist/chunks/{controls-group.D0_cJaFF.js.map → controls-group.vFyThDMU.js.map} +1 -1
- package/dist/chunks/{copy.2iD8aI5a.js → copy.DD_Yfyn_.js} +3 -3
- package/dist/chunks/{copy.2iD8aI5a.js.map → copy.DD_Yfyn_.js.map} +1 -1
- package/dist/chunks/{dashboard-section.Cmulh6WM.js → dashboard-section.z-Rnv5E-.js} +3 -3
- package/dist/chunks/{dashboard-section.Cmulh6WM.js.map → dashboard-section.z-Rnv5E-.js.map} +1 -1
- package/dist/chunks/{dashed-underline.eMF75SuT.js → dashed-underline.CfQuYKV9.js} +8 -8
- package/dist/chunks/{dashed-underline.eMF75SuT.js.map → dashed-underline.CfQuYKV9.js.map} +1 -1
- package/dist/chunks/{data-grid-template.CdHnPE1-.js → data-grid-template.73mazFER.js} +2 -2
- package/dist/chunks/{data-grid-template.CdHnPE1-.js.map → data-grid-template.73mazFER.js.map} +1 -1
- package/dist/chunks/{data-grid.DedjAz4_.js → data-grid.C_Xoz-GC.js} +28 -18
- package/dist/chunks/data-grid.C_Xoz-GC.js.map +1 -0
- package/dist/chunks/{date-picker.BdMr3Sn2.js → date-picker.bgk9aymW.js} +5 -5
- package/dist/chunks/{date-picker.BdMr3Sn2.js.map → date-picker.bgk9aymW.js.map} +1 -1
- package/dist/chunks/{date-range-picker.BHfvD0GK.js → date-range-picker.-s05jOQA.js} +8 -8
- package/dist/chunks/{date-range-picker.BHfvD0GK.js.map → date-range-picker.-s05jOQA.js.map} +1 -1
- package/dist/chunks/{directive.O3yEdalv.js → directive.Cbdox5VL.js} +2 -2
- package/dist/chunks/{directive.O3yEdalv.js.map → directive.Cbdox5VL.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.CvZ1jckk.js → dropdown-tag.8qh8J-NE.js} +3 -3
- package/dist/chunks/{dropdown-tag.CvZ1jckk.js.map → dropdown-tag.8qh8J-NE.js.map} +1 -1
- package/dist/chunks/{dropdown.CcHoKbLz.js → dropdown.DzWXcJyF.js} +50 -42
- package/dist/chunks/dropdown.DzWXcJyF.js.map +1 -0
- package/dist/chunks/{error-message.B1-ekAMa.js → error-message.CzQf7YOD.js} +2 -2
- package/dist/chunks/{error-message.B1-ekAMa.js.map → error-message.CzQf7YOD.js.map} +1 -1
- package/dist/chunks/es6.BtaxuP0b.js.map +1 -1
- package/dist/chunks/{file-uploader.Dlfzh5QQ.js → file-uploader.CcZPr-jD.js} +327 -326
- package/dist/chunks/file-uploader.CcZPr-jD.js.map +1 -0
- package/dist/chunks/{filter-bar.CwqoJGiK.js → filter-bar.BdGtQC7p.js} +305 -304
- package/dist/chunks/filter-bar.BdGtQC7p.js.map +1 -0
- package/dist/chunks/{focus-trap.CWlKh48z.js → focus-trap.CIUzScHc.js} +2 -2
- package/dist/chunks/{focus-trap.CWlKh48z.js.map → focus-trap.CIUzScHc.js.map} +1 -1
- package/dist/chunks/header-with-views.ChEgH2tn.js +1536 -0
- package/dist/chunks/header-with-views.ChEgH2tn.js.map +1 -0
- package/dist/chunks/{header.BAKjEGmH.js → header.0hX8OYwM.js} +3 -3
- package/dist/chunks/{header.BAKjEGmH.js.map → header.0hX8OYwM.js.map} +1 -1
- package/dist/chunks/index.BCUiAdb6.js +387 -0
- package/dist/chunks/{index.-wO_BQCb.js.map → index.BCUiAdb6.js.map} +1 -1
- package/dist/chunks/{info-icon-with-popover.CxXWP4TR.js → info-icon-with-popover.w6MpKOWh.js} +2 -2
- package/dist/chunks/{info-icon-with-popover.CxXWP4TR.js.map → info-icon-with-popover.w6MpKOWh.js.map} +1 -1
- package/dist/chunks/{info-icon.D3neDWqH.js → info-icon.C1ReXurF.js} +3 -3
- package/dist/chunks/{info-icon.D3neDWqH.js.map → info-icon.C1ReXurF.js.map} +1 -1
- package/dist/chunks/input-field-password.CZn4kW8v.js +198 -0
- package/dist/chunks/input-field-password.CZn4kW8v.js.map +1 -0
- package/dist/chunks/{input-field-phone-number.TXnK0dch.js → input-field-phone-number.C8WTJ1W-.js} +3 -3
- package/dist/chunks/{input-field-phone-number.TXnK0dch.js.map → input-field-phone-number.C8WTJ1W-.js.map} +1 -1
- package/dist/chunks/{input-field.De4sp76g.js → input-field.tP3Eupoo.js} +3 -3
- package/dist/chunks/{input-field.De4sp76g.js.map → input-field.tP3Eupoo.js.map} +1 -1
- package/dist/chunks/{inspector.types.ClnPOYmb.js → inspector.types.A0b4jNO3.js} +3 -3
- package/dist/chunks/{inspector.types.ClnPOYmb.js.map → inspector.types.A0b4jNO3.js.map} +1 -1
- package/dist/chunks/{layout-row.dh2VyGoD.js → layout-row.BgBazwnM.js} +2 -2
- package/dist/chunks/{layout-row.dh2VyGoD.js.map → layout-row.BgBazwnM.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.xGQr3Su1.js → listbox-option-tag.T9cfTst7.js} +2 -2
- package/dist/chunks/{listbox-option-tag.xGQr3Su1.js.map → listbox-option-tag.T9cfTst7.js.map} +1 -1
- package/dist/chunks/{menu.li3Kg9Uq.js → menu.CY7ceslP.js} +84 -83
- package/dist/chunks/{menu.li3Kg9Uq.js.map → menu.CY7ceslP.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.C4eL63TC.js → modal-fullscreen.Dz5w250z.js} +2 -2
- package/dist/chunks/{modal-fullscreen.C4eL63TC.js.map → modal-fullscreen.Dz5w250z.js.map} +1 -1
- package/dist/chunks/{modal.BpDz0Dhc.js → modal.CnmRkXZM.js} +2 -2
- package/dist/chunks/{modal.BpDz0Dhc.js.map → modal.CnmRkXZM.js.map} +1 -1
- package/dist/chunks/{on-click-outside.MUWbmGDn.js → on-click-outside.D9aY9g8G.js} +3 -2
- package/dist/chunks/{on-click-outside.MUWbmGDn.js.map → on-click-outside.D9aY9g8G.js.map} +1 -1
- package/dist/chunks/{pagination.FuELftBG.js → pagination.CvGOUwd8.js} +2 -2
- package/dist/chunks/{pagination.FuELftBG.js.map → pagination.CvGOUwd8.js.map} +1 -1
- package/dist/chunks/{popover.Cb6utVhS.js → popover.BvsqsZQ1.js} +2 -2
- package/dist/chunks/{popover.Cb6utVhS.js.map → popover.BvsqsZQ1.js.map} +1 -1
- package/dist/chunks/{popper-container.CiEkF7eb.js → popper-container.LRQgzjRf.js} +2 -2
- package/dist/chunks/{popper-container.CiEkF7eb.js.map → popper-container.LRQgzjRf.js.map} +1 -1
- package/dist/chunks/{promo-banner.PnHud5Wi.js → promo-banner.DDnJwMDC.js} +2 -2
- package/dist/chunks/{promo-banner.PnHud5Wi.js.map → promo-banner.DDnJwMDC.js.map} +1 -1
- package/dist/chunks/{radio-group._8PsjPCZ.js → radio-group.BvswbJa8.js} +4 -4
- package/dist/chunks/{radio-group._8PsjPCZ.js.map → radio-group.BvswbJa8.js.map} +1 -1
- package/dist/chunks/{search-bar.CVY2e8_B.js → search-bar.kKLreEXo.js} +3 -3
- package/dist/chunks/{search-bar.CVY2e8_B.js.map → search-bar.kKLreEXo.js.map} +1 -1
- package/dist/chunks/{secondary-nav.LxcuTR16.js → secondary-nav.C6bfsK2p.js} +3 -3
- package/dist/chunks/{secondary-nav.LxcuTR16.js.map → secondary-nav.C6bfsK2p.js.map} +1 -1
- package/dist/chunks/{segmented-control.D69WXQGh.js → segmented-control.BywW3ont.js} +2 -2
- package/dist/chunks/{segmented-control.D69WXQGh.js.map → segmented-control.BywW3ont.js.map} +1 -1
- package/dist/chunks/{selection-card-group.MTKkCBeK.js → selection-card-group.Ca4G00h5.js} +11 -11
- package/dist/chunks/{selection-card-group.MTKkCBeK.js.map → selection-card-group.Ca4G00h5.js.map} +1 -1
- package/dist/chunks/{sidepanel.BStCbRqN.js → sidepanel.D4H3Vu0m.js} +3 -3
- package/dist/chunks/{sidepanel.BStCbRqN.js.map → sidepanel.D4H3Vu0m.js.map} +1 -1
- package/dist/chunks/{structured-list-item.CeosjL40.js → structured-list-item.Bv8reTz2.js} +4 -4
- package/dist/chunks/{structured-list-item.CeosjL40.js.map → structured-list-item.Bv8reTz2.js.map} +1 -1
- package/dist/chunks/{summary-grid-item-custom.CF_TS7oA.js → summary-grid-item-custom.Bbdie4EL.js} +188 -135
- package/dist/chunks/summary-grid-item-custom.Bbdie4EL.js.map +1 -0
- package/dist/chunks/{tag.OgtZ3-ql.js → tag.IyMxowGc.js} +2 -2
- package/dist/chunks/{tag.OgtZ3-ql.js.map → tag.IyMxowGc.js.map} +1 -1
- package/dist/chunks/{teleport.B5fwsT5y.js → teleport.BHfrns33.js} +2 -2
- package/dist/chunks/{teleport.B5fwsT5y.js.map → teleport.BHfrns33.js.map} +1 -1
- package/dist/chunks/{textarea.BEISPJua.js → textarea.B9HjT5LH.js} +2 -2
- package/dist/chunks/{textarea.BEISPJua.js.map → textarea.B9HjT5LH.js.map} +1 -1
- package/dist/chunks/{timeline-item.BeWMuM8A.js → timeline-item.BIwk0vqM.js} +4 -4
- package/dist/chunks/{timeline-item.BeWMuM8A.js.map → timeline-item.BIwk0vqM.js.map} +1 -1
- package/dist/chunks/{tooltip.RPURZd36.js → tooltip.DShIiBiY.js} +2 -2
- package/dist/chunks/{tooltip.RPURZd36.js.map → tooltip.DShIiBiY.js.map} +1 -1
- package/dist/chunks/{tutorial.Ba8PTa0x.js → tutorial.DDlXTjAO.js} +4 -4
- package/dist/chunks/{tutorial.Ba8PTa0x.js.map → tutorial.DDlXTjAO.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.CxlYYUbd.js → use-cached-selected-values.LVldNial.js} +12 -8
- package/dist/chunks/{use-cached-selected-values.CxlYYUbd.js.map → use-cached-selected-values.LVldNial.js.map} +1 -1
- package/dist/click-outside.js +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/dashboard-template.js +1 -1
- package/dist/dashed-underline.js +2 -2
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/date-range-picker.js +2 -2
- package/dist/dropdown.js +3 -3
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/header-with-views.js +5 -0
- package/dist/header-with-views.js.map +1 -0
- package/dist/header.js +1 -1
- package/dist/index.js +195 -193
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +1 -1
- package/dist/input-field-password.js +1 -1
- package/dist/input-field-phone-number.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/inspector.js +1 -1
- package/dist/internal.js +10 -10
- package/dist/layout.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +2 -2
- package/dist/pagination.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/popper-container.js +1 -1
- package/dist/promo-banner.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/styles/bento-dark.css +47 -1
- package/dist/styles/bento-light.css +47 -1
- package/dist/styles/bento.css +47 -1
- package/dist/styles/legacy.css +47 -1
- package/dist/styles/styleguide.css +47 -1
- package/dist/summary-grid.js +1 -1
- package/dist/tag.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/use-form-v4.js +8300 -0
- package/dist/use-form-v4.js.map +1 -0
- package/dist/web-types.json +520 -5
- package/package.json +6 -5
- package/dist/chunks/checkbox.BeYtbfPv.js +0 -170
- package/dist/chunks/checkbox.BeYtbfPv.js.map +0 -1
- package/dist/chunks/data-grid.DedjAz4_.js.map +0 -1
- package/dist/chunks/dropdown.CcHoKbLz.js.map +0 -1
- package/dist/chunks/file-uploader.Dlfzh5QQ.js.map +0 -1
- package/dist/chunks/filter-bar.CwqoJGiK.js.map +0 -1
- package/dist/chunks/index.-wO_BQCb.js +0 -370
- package/dist/chunks/input-field-password.CO0lAgMh.js +0 -194
- package/dist/chunks/input-field-password.CO0lAgMh.js.map +0 -1
- package/dist/chunks/summary-grid-item-custom.CF_TS7oA.js.map +0 -1
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { defineComponent as N, toRefs as S, computed as o, ref as $, useAttrs as w } from "vue";
|
|
2
|
-
import { B as R } from "./typography.J1v_SPG3.js";
|
|
3
|
-
import { a as j, C as k } from "./checkbox-input.CMhyJDdo.js";
|
|
4
|
-
import { u as F } from "./use-default-slot-validator.BDn0wkYP.js";
|
|
5
|
-
import { u as z } from "./use-has-slot.C9lQZ6nz.js";
|
|
6
|
-
import { g as A } from "./generate-uid.NJ8tVoha.js";
|
|
7
|
-
import { g as f } from "./get-slot-text.BQS5Olxm.js";
|
|
8
|
-
import { u as H } from "./i18n.BQkEbtPM.js";
|
|
9
|
-
import { u as J } from "./aria-label.CaUURpnB.js";
|
|
10
|
-
import { B as O } from "./tag.OgtZ3-ql.js";
|
|
11
|
-
import { E as Y } from "./error-message.B1-ekAMa.js";
|
|
12
|
-
import { n as K } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
13
|
-
import "../assets/checkbox.css";
|
|
14
|
-
var s = /* @__PURE__ */ ((a) => (a.UPDATE = "update:model-value", a.INPUT = "input", a))(s || {});
|
|
15
|
-
const Q = {
|
|
16
|
-
"en-US": {
|
|
17
|
-
checkbox: "Checkbox",
|
|
18
|
-
optional: "optional",
|
|
19
|
-
required: "required"
|
|
20
|
-
},
|
|
21
|
-
"ja-JP": {
|
|
22
|
-
checkbox: "チェックボックス",
|
|
23
|
-
optional: "任意",
|
|
24
|
-
required: "必須"
|
|
25
|
-
},
|
|
26
|
-
"pt-BR": {
|
|
27
|
-
checkbox: "Caixa de seleção",
|
|
28
|
-
optional: "opcional",
|
|
29
|
-
required: "obrigatório"
|
|
30
|
-
}
|
|
31
|
-
}, W = N({
|
|
32
|
-
name: "bento-checkbox",
|
|
33
|
-
i18n: { messages: Q },
|
|
34
|
-
components: {
|
|
35
|
-
BentoTag: O,
|
|
36
|
-
BentoTypography: R,
|
|
37
|
-
CheckboxInput: j,
|
|
38
|
-
ErrorMessage: Y
|
|
39
|
-
},
|
|
40
|
-
inheritAttrs: !1,
|
|
41
|
-
model: { prop: "modelValue" },
|
|
42
|
-
props: {
|
|
43
|
-
/**
|
|
44
|
-
* @deprecated from version 2.0.0. Use the aria-label attribute instead.
|
|
45
|
-
*/
|
|
46
|
-
/**
|
|
47
|
-
* Accessible name for the radio button component. It is strongly recommended to pas this value in case this component is used without a label.
|
|
48
|
-
*/
|
|
49
|
-
ariaLabel: { type: String, default: null },
|
|
50
|
-
/**
|
|
51
|
-
* Setting this property to true will disable the checkbox in your form.
|
|
52
|
-
*/
|
|
53
|
-
disabled: { type: Boolean, default: !1 },
|
|
54
|
-
/**
|
|
55
|
-
* Renders the checkbox in an error state with an error message.
|
|
56
|
-
*/
|
|
57
|
-
errorMessage: { type: String, default: null },
|
|
58
|
-
/**
|
|
59
|
-
* Setting this property to true will show the checkbox in error state.
|
|
60
|
-
*/
|
|
61
|
-
hasError: { type: Boolean, default: !1 },
|
|
62
|
-
/**
|
|
63
|
-
* The :indeterminate CSS pseudo-class represents any form element
|
|
64
|
-
* whose state is indeterminate, such as checkboxes which have their HTML indeterminate attribute
|
|
65
|
-
* set to true, radio buttons which are members of a group in which all radio buttons are unchecked,
|
|
66
|
-
* and indeterminate <progress> elements. https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate
|
|
67
|
-
* This property lets you control the input.indeterminate native property.
|
|
68
|
-
*/
|
|
69
|
-
indeterminate: { type: Boolean, default: !1 },
|
|
70
|
-
/**
|
|
71
|
-
* When handling a single checkbox with a singular state, use a boolean.
|
|
72
|
-
*
|
|
73
|
-
* When handling multiple checkboxes, use an array of keys.
|
|
74
|
-
* These keys exist as a set "value" prop for each checkbox.
|
|
75
|
-
*/
|
|
76
|
-
modelValue: {
|
|
77
|
-
type: [Boolean, Array],
|
|
78
|
-
default: !1
|
|
79
|
-
},
|
|
80
|
-
/**
|
|
81
|
-
* Highlights the checkbox is optional.
|
|
82
|
-
*/
|
|
83
|
-
optional: { type: Boolean, default: !1 },
|
|
84
|
-
/**
|
|
85
|
-
* Setting this property to true will set the checkbox to read only state.
|
|
86
|
-
*/
|
|
87
|
-
readonly: { type: Boolean, default: !1 },
|
|
88
|
-
/**
|
|
89
|
-
* Highlights the checkbox is required.
|
|
90
|
-
*/
|
|
91
|
-
required: { type: Boolean, default: !1 },
|
|
92
|
-
/**
|
|
93
|
-
* Sets the properties of the BentoTag component that is placed next to the label.
|
|
94
|
-
* {@see BentoTag}
|
|
95
|
-
*/
|
|
96
|
-
tag: { type: Object, default: void 0 },
|
|
97
|
-
/**
|
|
98
|
-
* The value of the component. The DOM API casts this to a string.
|
|
99
|
-
* The browser uses "on" as the default value.
|
|
100
|
-
*
|
|
101
|
-
* In the case of multiple checkboxes this value is used as a unique key.
|
|
102
|
-
*/
|
|
103
|
-
value: { type: [String, Number], default: null }
|
|
104
|
-
},
|
|
105
|
-
emits: [s.UPDATE, s.INPUT],
|
|
106
|
-
setup(a, { attrs: e, emit: t, slots: r }) {
|
|
107
|
-
const { t: m } = H(), _ = A("description"), h = A("error"), u = z(r), { disabled: y, indeterminate: B, modelValue: d, readonly: C, value: E } = S(a), v = f(r)("default"), g = f(r)("description");
|
|
108
|
-
F("bento-checkbox", r.default, r.description);
|
|
109
|
-
const n = o(() => Array.isArray(d.value)), b = o(() => n.value ? d.value.some((l) => l === E.value) : d.value), i = o(() => B.value), I = o(
|
|
110
|
-
() => !a.disabled && !a.readonly && (a.hasError || !!a.errorMessage)
|
|
111
|
-
), x = o(() => !a.disabled && !a.readonly && !!a.errorMessage), c = o(() => u("content")), p = o(() => (i == null ? void 0 : i.value) || (b == null ? void 0 : b.value)), q = o(
|
|
112
|
-
() => (c == null ? void 0 : c.value) && (n == null ? void 0 : n.value) && (p == null ? void 0 : p.value)
|
|
113
|
-
), D = o(
|
|
114
|
-
() => `${x.value ? h : ""} ${v && g ? _ : ""}`.trim() || null
|
|
115
|
-
), L = $(e["aria-label"]), { ariaLabel: T } = S(a), M = J({
|
|
116
|
-
ariaLabel: L.value,
|
|
117
|
-
// TODO: take this line away when the aria-label props is removed
|
|
118
|
-
label: T,
|
|
119
|
-
defaultFallback: u("default") ? f(r)("default") : m("checkbox")
|
|
120
|
-
}), P = o(() => {
|
|
121
|
-
const { style: l, class: V } = w();
|
|
122
|
-
return {
|
|
123
|
-
class: V,
|
|
124
|
-
style: l
|
|
125
|
-
};
|
|
126
|
-
}), U = o(() => ({
|
|
127
|
-
[`b-checkbox--${k.DISABLED}`]: y.value,
|
|
128
|
-
[`b-checkbox--${k.READONLY}`]: C.value
|
|
129
|
-
}));
|
|
130
|
-
return {
|
|
131
|
-
// Values
|
|
132
|
-
descriptionId: _,
|
|
133
|
-
errorId: h,
|
|
134
|
-
ariaDescribedBy: D,
|
|
135
|
-
computedAriaLabel: M,
|
|
136
|
-
conditionalClass: U,
|
|
137
|
-
defaultSlotValue: v,
|
|
138
|
-
descriptionSlotValue: g,
|
|
139
|
-
isIndeterminate: i,
|
|
140
|
-
shouldShowError: I,
|
|
141
|
-
shouldShowErrorMessage: x,
|
|
142
|
-
contentSlotAvailable: q,
|
|
143
|
-
hasContentSlot: c,
|
|
144
|
-
styleAttrs: P,
|
|
145
|
-
// Methods
|
|
146
|
-
hasSlot: u,
|
|
147
|
-
onChange: (l) => {
|
|
148
|
-
y.value || (t(s.UPDATE, l), t(s.INPUT, l));
|
|
149
|
-
},
|
|
150
|
-
t: m
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
var X = function() {
|
|
155
|
-
var e = this, t = e._self._c;
|
|
156
|
-
return e._self._setupProxy, t("label", e._b({ staticClass: "b-checkbox", class: e.conditionalClass }, "label", e.styleAttrs, !1), [t("checkbox-input", e._b({ ref: "input", attrs: { "aria-label": e.computedAriaLabel, "aria-describedby": e.ariaDescribedBy, disabled: e.disabled, "has-error": e.shouldShowError, indeterminate: e.isIndeterminate, value: e.value, "model-value": e.modelValue, readonly: e.readonly }, on: { "update:model-value": e.onChange } }, "checkbox-input", e.$attrs, !1)), e.hasSlot("default") || e.shouldShowErrorMessage ? t("span", { staticClass: "b-checkbox__text" }, [e.hasSlot("default") ? t("bento-typography", { staticClass: "b-checkbox__label", attrs: { el: "span", variant: "body" } }, [t("span", [e._t("default")], 2), e.optional ? t("bento-typography", { staticClass: "b-checkbox__label-requirement", attrs: { el: "span" } }, [e._v("(" + e._s(e.t("optional")) + ")")]) : e.required ? t("bento-typography", { staticClass: "b-checkbox__label-requirement", attrs: { el: "span" } }, [e._v("(" + e._s(e.t("required")) + ")")]) : e._e(), e.tag ? t("bento-tag", e._b({ staticClass: "b-checkbox__label-tag" }, "bento-tag", e.tag, !1)) : e._e()], 1) : e._e(), e.hasSlot("default") && e.hasSlot("description") ? t("bento-typography", { staticClass: "b-checkbox__description", attrs: { id: e.descriptionId, el: "span", variant: "body" } }, [e._t("description")], 2) : e._e(), e.shouldShowErrorMessage ? t("error-message", { attrs: { id: e.errorId, "error-message": e.errorMessage } }) : e._e(), e.contentSlotAvailable ? t("bento-typography", { staticClass: "b-checkbox__content", attrs: { el: "span", variant: "body" } }, [e._t("content")], 2) : e._e()], 1) : e._e()], 1);
|
|
157
|
-
}, Z = [], G = /* @__PURE__ */ K(
|
|
158
|
-
W,
|
|
159
|
-
X,
|
|
160
|
-
Z,
|
|
161
|
-
!1,
|
|
162
|
-
null,
|
|
163
|
-
"4aad881c"
|
|
164
|
-
);
|
|
165
|
-
const pe = G.exports;
|
|
166
|
-
export {
|
|
167
|
-
pe as B,
|
|
168
|
-
s as a
|
|
169
|
-
};
|
|
170
|
-
//# sourceMappingURL=checkbox.BeYtbfPv.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.BeYtbfPv.js","sources":["../../../core/src/components/checkbox/checkbox.types.ts","../../src/components/checkbox/checkbox.vue"],"sourcesContent":["import type { BentoTagProps } from '@/core/components/tag/tag.types';\nimport type {\n CheckboxInputType as BentoCheckboxType,\n MultiCheckboxInputType as BentoMultiCheckboxType,\n} from '@/core/components/internal/checkbox-input/checkbox-input.types';\nimport { CheckboxInputState as BentoCheckboxState } from '@/core/components/internal/checkbox-input/checkbox-input.types';\n\nexport { BentoCheckboxState, BentoCheckboxType, BentoMultiCheckboxType };\n\nexport enum BentoCheckboxEvent {\n UPDATE = 'update:model-value',\n INPUT = 'input',\n}\n\nexport type BentoCheckboxTag = BentoTagProps;\n","<template>\n <label class=\"b-checkbox\" :class=\"conditionalClass\" v-bind=\"styleAttrs\">\n <checkbox-input\n ref=\"input\"\n v-bind=\"$attrs\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"ariaDescribedBy\"\n :disabled=\"disabled\"\n :has-error=\"shouldShowError\"\n :indeterminate=\"isIndeterminate\"\n :value=\"value\"\n :model-value=\"modelValue\"\n :readonly=\"readonly\"\n @update:model-value=\"onChange\"\n />\n <span v-if=\"hasSlot('default') || shouldShowErrorMessage\" class=\"b-checkbox__text\">\n <bento-typography v-if=\"hasSlot('default')\" class=\"b-checkbox__label\" el=\"span\" variant=\"body\">\n <span><slot /></span>\n <bento-typography v-if=\"optional\" class=\"b-checkbox__label-requirement\" el=\"span\"\n >({{ t('optional') }})</bento-typography\n >\n <bento-typography v-else-if=\"required\" class=\"b-checkbox__label-requirement\" el=\"span\"\n >({{ t('required') }})</bento-typography\n >\n <bento-tag v-if=\"tag\" class=\"b-checkbox__label-tag\" v-bind=\"tag\" />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('default') && hasSlot('description')\"\n :id=\"descriptionId\"\n class=\"b-checkbox__description\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"description\"></slot>\n </bento-typography>\n <error-message v-if=\"shouldShowErrorMessage\" :id=\"errorId\" :error-message=\"errorMessage\" />\n\n <bento-typography v-if=\"contentSlotAvailable\" class=\"b-checkbox__content\" el=\"span\" variant=\"body\">\n <slot name=\"content\"></slot>\n </bento-typography>\n </span>\n </label>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref, toRefs, useAttrs } from 'vue';\n import {\n BentoCheckboxEvent,\n BentoCheckboxState,\n BentoCheckboxTag,\n BentoCheckboxType,\n BentoMultiCheckboxType,\n } from '@/core/components/checkbox/checkbox.types';\n import { BentoTypography } from '@/components/typography';\n import { CheckboxInput } from '@/components/internal/checkbox-input';\n import { ErrorMessage } from '@/components/internal/error-message';\n import type { HTMLAttributes } from 'vue/types/jsx.d.ts';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { generateUid } from '@/core/utils/ts';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { useI18n } from '@/utils/ts/i18n';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { BentoTag } from '@/components/tag';\n import { BentoCheckboxGroupItems } from '@/core/components/checkbox-group/checkbox-group.types';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n /**\n * Checkboxes are used to make a binary choice about an option.\n * The label tag area is also clickable.\n *\n * @usage\n * import { BentoCheckbox } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCheckbox },\n * template: `\n * <bento-checkbox>\n * Label text\n * <template #description>Sub label text</template>\n * </bento-checkbox>\n * `,\n * }\n */\n export default defineComponent({\n name: 'bento-checkbox',\n i18n: { messages },\n components: {\n BentoTag,\n BentoTypography,\n CheckboxInput,\n ErrorMessage,\n },\n inheritAttrs: false,\n model: { prop: 'modelValue' },\n props: {\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Accessible name for the radio button component. It is strongly recommended to pas this value in case this component is used without a label.\n */\n ariaLabel: { type: String, default: null },\n\n /**\n * Setting this property to true will disable the checkbox in your form.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Renders the checkbox in an error state with an error message.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * Setting this property to true will show the checkbox in error state.\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * The :indeterminate CSS pseudo-class represents any form element\n * whose state is indeterminate, such as checkboxes which have their HTML indeterminate attribute\n * set to true, radio buttons which are members of a group in which all radio buttons are unchecked,\n * and indeterminate <progress> elements. https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate\n * This property lets you control the input.indeterminate native property.\n */\n indeterminate: { type: Boolean, default: false },\n\n /**\n * When handling a single checkbox with a singular state, use a boolean.\n *\n * When handling multiple checkboxes, use an array of keys.\n * These keys exist as a set \"value\" prop for each checkbox.\n */\n modelValue: {\n type: [Boolean, Array] as PropType<BentoCheckboxType | BentoCheckboxGroupItems>,\n default: false,\n },\n\n /**\n * Highlights the checkbox is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Setting this property to true will set the checkbox to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Highlights the checkbox is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Sets the properties of the BentoTag component that is placed next to the label.\n * {@see BentoTag}\n */\n tag: { type: Object as PropType<BentoCheckboxTag>, default: undefined },\n\n /**\n * The value of the component. The DOM API casts this to a string.\n * The browser uses \"on\" as the default value.\n *\n * In the case of multiple checkboxes this value is used as a unique key.\n */\n value: { type: [String, Number], default: null },\n },\n emits: [BentoCheckboxEvent.UPDATE, BentoCheckboxEvent.INPUT],\n setup(props, { attrs, emit, slots }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const descriptionId = generateUid('description');\n const errorId = generateUid('error');\n const hasSlot = useHasSlot(slots);\n\n const { disabled, indeterminate, modelValue, readonly, value } = toRefs(props);\n\n const defaultSlotValue = getSlotText(slots)('default');\n const descriptionSlotValue = getSlotText(slots)('description');\n\n useDefaultSlotValidator('bento-checkbox', slots.default, slots.description);\n\n const isCheckboxGroup = computed(() => Array.isArray(modelValue.value));\n const isChecked = computed(() => {\n if (!isCheckboxGroup.value) {\n return modelValue.value as boolean;\n }\n\n return (modelValue.value as BentoMultiCheckboxType).some(item => item === value.value);\n });\n const isIndeterminate = computed(() => indeterminate.value);\n\n const shouldShowError = computed(\n () => !props.disabled && !props.readonly && (props.hasError || !!props.errorMessage)\n );\n const shouldShowErrorMessage = computed(() => !props.disabled && !props.readonly && !!props.errorMessage);\n\n // Content slot logic\n const hasContentSlot = computed(() => hasSlot('content'));\n const isCheckedOrIntermediate = computed(() => isIndeterminate?.value || isChecked?.value);\n const contentSlotAvailable = computed(\n () => hasContentSlot?.value && isCheckboxGroup?.value && isCheckedOrIntermediate?.value\n );\n\n // ARIA fields\n const ariaDescribedBy = computed<HTMLAttributes['aria-describedby']>(\n () =>\n `${shouldShowErrorMessage.value ? errorId : ''} ${\n defaultSlotValue && descriptionSlotValue ? descriptionId : ''\n }`.trim() || null\n );\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: hasSlot('default') ? (getSlotText(slots)('default') as string) : t('checkbox'),\n });\n\n const styleAttrs = computed(() => {\n const { style, class: cls } = useAttrs();\n return {\n class: cls as HTMLAttributes['class'],\n style: style as HTMLAttributes['style'],\n };\n });\n\n const conditionalClass = computed(() => ({\n [`b-checkbox--${BentoCheckboxState.DISABLED}`]: disabled.value,\n [`b-checkbox--${BentoCheckboxState.READONLY}`]: readonly.value,\n }));\n\n const onChange = (newValue: BentoCheckboxType | BentoCheckboxGroupItems) => {\n if (disabled.value) {\n return;\n }\n emit(BentoCheckboxEvent.UPDATE, newValue);\n emit(BentoCheckboxEvent.INPUT, newValue);\n };\n\n return {\n // Values\n descriptionId,\n errorId,\n ariaDescribedBy,\n computedAriaLabel,\n conditionalClass,\n defaultSlotValue,\n descriptionSlotValue,\n isIndeterminate,\n shouldShowError,\n shouldShowErrorMessage,\n contentSlotAvailable,\n hasContentSlot,\n styleAttrs,\n\n // Methods\n hasSlot,\n onChange,\n\n t,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/checkbox/checkbox.scss\" />\n"],"names":["BentoCheckboxEvent","BentoCheckboxEvent2","_sfc_main","defineComponent","messages","BentoTag","BentoTypography","CheckboxInput","ErrorMessage","props","attrs","emit","slots","t","useI18n","descriptionId","generateUid","errorId","hasSlot","useHasSlot","disabled","indeterminate","modelValue","readonly","value","toRefs","defaultSlotValue","getSlotText","descriptionSlotValue","useDefaultSlotValidator","isCheckboxGroup","computed","isChecked","item","isIndeterminate","shouldShowError","shouldShowErrorMessage","hasContentSlot","isCheckedOrIntermediate","contentSlotAvailable","ariaDescribedBy","ariaLabelAttribute","ref","ariaLabel","computedAriaLabel","useAriaLabel","styleAttrs","style","cls","useAttrs","conditionalClass","CheckboxInputState","newValue"],"mappings":";;;;;;;;;;;;;AASY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,SAAA,sBACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;GC4EZE,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,MAAA,EAAA,UAAAC,EAAA;AAAA,EACA,YAAA;AAAA,IACA,UAAAC;AAAA,IACA,iBA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