@adyen/bento-vue3 1.7.0 → 1.8.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/packages/core/src/components/button/button.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/action-bar/action-bar.vue.d.ts +11 -0
- package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.vue.d.ts +7 -2
- package/dist/@types/packages/vue2/src/components/button/components/loading-button/loading-button.vue.d.ts +25 -13
- package/dist/@types/packages/vue2/src/components/checkbox/checkbox.vue.d.ts +25 -0
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +13 -1
- package/dist/@types/packages/vue2/src/components/date-picker/date-picker.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/date-range-picker/components/date-range-picker-calendar/date-range-picker-calendar.types.d.ts +6 -2
- package/dist/@types/packages/vue2/src/components/date-range-picker/components/date-range-picker-calendar/date-range-picker-calendar.vue.d.ts +153 -12
- package/dist/@types/packages/vue2/src/components/date-range-picker/date-range-picker.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/date-range-picker/date-range-picker.vue.d.ts +12 -0
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue.d.ts +319 -96
- package/dist/@types/packages/vue2/src/components/dropdown/dropdown.vue.d.ts +12 -3
- package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +30 -24
- package/dist/@types/packages/vue2/src/components/filter-bar/components/date-range-filter/date-range-filter.vue.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/input-field/input-field.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/internal/calendar/calendar.types.d.ts +12 -0
- package/dist/@types/packages/vue2/src/components/internal/calendar/calendar.vue.d.ts +11 -1
- package/dist/@types/packages/vue2/src/components/internal/calendar/components/calendar-month/composables/granular-min-max-date.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/internal/calendar/components/calendar-month/composables/granular-min-max-date.types.d.ts +13 -0
- package/dist/@types/packages/vue2/src/components/internal/calendar/composables/use-granularity-adjustments.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/internal/calendar/composables/use-granularity-adjustments.types.d.ts +14 -0
- package/dist/@types/packages/vue2/src/components/internal/calendar/composables/use-granularity-memory.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/internal/calendar/composables/use-granularity-memory.types.d.ts +22 -0
- package/dist/@types/packages/vue2/src/components/internal/field-label/field-label.vue.d.ts +48 -0
- package/dist/@types/packages/vue2/src/components/internal/field-label/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/internal/grid-layout/grid-layout.vue.d.ts +11 -0
- package/dist/@types/packages/vue2/src/components/internal/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.vue.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/popover/popover.keys.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/popover/popover.vue.d.ts +18 -24
- package/dist/@types/packages/vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/structured-list/structured-list.keys.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/structured-list/structured-list.vue.d.ts +20 -1
- package/dist/@types/packages/vue2/src/components/summary-grid/summary-grid.types.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/textarea/textarea.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/timeline/components/timeline-item/timeline-item.vue.d.ts +19 -2
- package/dist/@types/packages/vue2/src/components/timeline/timeline.types.d.ts +4 -2
- package/dist/@types/packages/vue2/src/components/timeline/timeline.vue.d.ts +21 -3
- package/dist/@types/packages/vue2/src/index.d.ts +1 -0
- package/dist/accordion.js +2 -2
- package/dist/action-bar.js +146 -116
- package/dist/action-bar.js.map +1 -1
- package/dist/alert.js +3 -3
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/calendar.css +1 -1
- package/dist/assets/checkbox.css +1 -1
- package/dist/assets/controls-group.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/field-label.css +1 -0
- package/dist/assets/grid-layout.css +1 -1
- package/dist/assets/index.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/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/index46.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/loading-button.css +1 -1
- package/dist/avatar-image.js +1 -1
- package/dist/badge.js +1 -1
- package/dist/button.js +53 -51
- package/dist/button.js.map +1 -1
- package/dist/card.js +2 -2
- package/dist/checkbox.js +6 -6
- package/dist/chunks/{base-button.7897a95e.js → base-button.aa085dfa.js} +2 -2
- package/dist/chunks/{base-button.7897a95e.js.map → base-button.aa085dfa.js.map} +1 -1
- package/dist/chunks/{base-modal.0c85e7cb.js → base-modal.3dcf8376.js} +119 -105
- package/dist/chunks/base-modal.3dcf8376.js.map +1 -0
- package/dist/chunks/{button-actions-with-menu.fa35390c.js → button-actions-with-menu.3f52ea2d.js} +7 -7
- package/dist/chunks/{button-actions-with-menu.fa35390c.js.map → button-actions-with-menu.3f52ea2d.js.map} +1 -1
- package/dist/chunks/{button.e5177388.js → button.82ed953e.js} +2 -2
- package/dist/chunks/button.82ed953e.js.map +1 -0
- package/dist/chunks/calendar.d4ab387d.js +1037 -0
- package/dist/chunks/calendar.d4ab387d.js.map +1 -0
- package/dist/chunks/checkbox.03c4b0fe.js +265 -0
- package/dist/chunks/checkbox.03c4b0fe.js.map +1 -0
- package/dist/chunks/controls-group.807b5fb0.js +95 -0
- package/dist/chunks/controls-group.807b5fb0.js.map +1 -0
- package/dist/chunks/{copy.86236c8d.js → copy.28bd4298.js} +4 -4
- package/dist/chunks/{copy.86236c8d.js.map → copy.28bd4298.js.map} +1 -1
- package/dist/chunks/{dropdown-default-textbox.0b38fac3.js → dropdown-default-textbox.74c4584a.js} +2 -2
- package/dist/chunks/{dropdown-default-textbox.0b38fac3.js.map → dropdown-default-textbox.74c4584a.js.map} +1 -1
- package/dist/chunks/{dropdown.afff433b.js → dropdown.502e1f5c.js} +314 -337
- package/dist/chunks/dropdown.502e1f5c.js.map +1 -0
- package/dist/chunks/field-label.61679178.js +132 -0
- package/dist/chunks/field-label.61679178.js.map +1 -0
- package/dist/chunks/{fixed-scroller.e5aa7b00.js → fixed-scroller.92bb77a6.js} +2 -2
- package/dist/chunks/{fixed-scroller.e5aa7b00.js.map → fixed-scroller.92bb77a6.js.map} +1 -1
- package/dist/chunks/{footer-actions.1ce44374.js → footer-actions.cefaf1e2.js} +3 -3
- package/dist/chunks/{footer-actions.1ce44374.js.map → footer-actions.cefaf1e2.js.map} +1 -1
- package/dist/chunks/{grid-layout.7c919507.js → grid-layout.c2fe3057.js} +43 -34
- package/dist/chunks/grid-layout.c2fe3057.js.map +1 -0
- package/dist/chunks/{index.fa7b44f1.js → index.0ee895e0.js} +2 -2
- package/dist/chunks/{index.fa7b44f1.js.map → index.0ee895e0.js.map} +1 -1
- package/dist/chunks/{index.bcc58fdd.js → index.7262642e.js} +3 -3
- package/dist/chunks/{index.bcc58fdd.js.map → index.7262642e.js.map} +1 -1
- package/dist/chunks/index.726e2f3c.js +339 -0
- package/dist/chunks/index.726e2f3c.js.map +1 -0
- package/dist/chunks/{index.2bd3812b.js → index.75f3672e.js} +2 -2
- package/dist/chunks/{index.2bd3812b.js.map → index.75f3672e.js.map} +1 -1
- package/dist/chunks/{index.6a665ade.js → index.abb2a1d5.js} +3 -3
- package/dist/chunks/{index.6a665ade.js.map → index.abb2a1d5.js.map} +1 -1
- package/dist/chunks/index.b043371e.js +150 -0
- package/dist/chunks/index.b043371e.js.map +1 -0
- package/dist/chunks/{index.e579bc02.js → index.cf0d3be3.js} +19 -17
- package/dist/chunks/{index.e579bc02.js.map → index.cf0d3be3.js.map} +1 -1
- package/dist/chunks/{index.c207e9ab.js → index.d2542c6a.js} +132 -135
- package/dist/chunks/index.d2542c6a.js.map +1 -0
- package/dist/chunks/index.d80206ed.js +10 -0
- package/dist/chunks/index.d80206ed.js.map +1 -0
- package/dist/chunks/index.e9156fe3.js +817 -0
- package/dist/chunks/index.e9156fe3.js.map +1 -0
- package/dist/chunks/{listbox-option-tag.809ec40e.js → listbox-option-tag.5b00c85f.js} +3 -3
- package/dist/chunks/{listbox-option-tag.809ec40e.js.map → listbox-option-tag.5b00c85f.js.map} +1 -1
- package/dist/chunks/{listbox.f6e5a11d.js → listbox.d07c24e6.js} +4 -4
- package/dist/chunks/{listbox.f6e5a11d.js.map → listbox.d07c24e6.js.map} +1 -1
- package/dist/chunks/loading-button.ad7cfaee.js +108 -0
- package/dist/chunks/loading-button.ad7cfaee.js.map +1 -0
- package/dist/chunks/{tooltip.f769eb14.js → tooltip.054d2eb6.js} +3 -3
- package/dist/chunks/{tooltip.f769eb14.js.map → tooltip.054d2eb6.js.map} +1 -1
- package/dist/code-snippet.js +6 -6
- package/dist/code-snippet.js.map +1 -1
- package/dist/country.js +2 -2
- package/dist/currency.js +1 -1
- package/dist/data-grid.js +847 -820
- package/dist/data-grid.js.map +1 -1
- package/dist/date-picker.js +114 -138
- package/dist/date-picker.js.map +1 -1
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +1 -1
- package/dist/divider.js +1 -1
- package/dist/dropdown.js +4 -4
- package/dist/empty-state.js +3 -3
- package/dist/filter-bar.js +17 -16
- package/dist/filter-bar.js.map +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +2 -2
- package/dist/header.js +76 -80
- package/dist/header.js.map +1 -1
- package/dist/index.js +207 -205
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +3 -3
- package/dist/input-field.js +136 -158
- package/dist/input-field.js.map +1 -1
- package/dist/internal.js +14 -13
- package/dist/link.js +2 -2
- package/dist/loading-indicator.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal.js +4 -4
- package/dist/modal.js.map +1 -1
- package/dist/pagination.js +4 -4
- package/dist/payment-method.js +2 -2
- package/dist/popover.js +3 -359
- package/dist/popover.js.map +1 -1
- package/dist/popper-container.js +1 -1
- package/dist/radio-group.js +4 -4
- package/dist/search-bar.js +2 -2
- package/dist/segmented-control.js +3 -3
- package/dist/sidepanel.js +5 -5
- package/dist/status.js +2 -2
- package/dist/stepper.js +3 -3
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +4 -4
- package/dist/summary-grid.js.map +1 -1
- package/dist/tabs.js +3 -3
- package/dist/tag.js +3 -3
- package/dist/textarea.js +125 -149
- package/dist/textarea.js.map +1 -1
- package/dist/timeline.js +312 -229
- package/dist/timeline.js.map +1 -1
- package/dist/toast.js +3 -3
- package/dist/toggle.js +2 -2
- package/dist/tutorial.js +49 -49
- package/dist/typography.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +2 -2
- package/dist/@types/packages/vue2/src/components/modal/components/base-modal/__mocks__/base-modal.vue.d.ts +0 -120
- package/dist/assets/error-message.css +0 -1
- package/dist/chunks/base-modal.0c85e7cb.js.map +0 -1
- package/dist/chunks/button.e5177388.js.map +0 -1
- package/dist/chunks/calendar.c83d4e99.js +0 -898
- package/dist/chunks/calendar.c83d4e99.js.map +0 -1
- package/dist/chunks/checkbox.3cdbdd52.js +0 -235
- package/dist/chunks/checkbox.3cdbdd52.js.map +0 -1
- package/dist/chunks/controls-group.38b436f6.js +0 -136
- package/dist/chunks/controls-group.38b436f6.js.map +0 -1
- package/dist/chunks/dropdown.afff433b.js.map +0 -1
- package/dist/chunks/error-message.64e1964b.js +0 -49
- package/dist/chunks/error-message.64e1964b.js.map +0 -1
- package/dist/chunks/grid-layout.7c919507.js.map +0 -1
- package/dist/chunks/index.369b0e66.js +0 -734
- package/dist/chunks/index.369b0e66.js.map +0 -1
- package/dist/chunks/index.77f35162.js +0 -134
- package/dist/chunks/index.77f35162.js.map +0 -1
- package/dist/chunks/index.c207e9ab.js.map +0 -1
- package/dist/chunks/loading-button.746b7fa1.js +0 -109
- package/dist/chunks/loading-button.746b7fa1.js.map +0 -1
package/dist/input-field.js
CHANGED
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { u as ye } from "./chunks/use-has-slot.4d98bf29.js";
|
|
1
|
+
import { defineComponent as de, useAttrs as ie, useSlots as oe, ref as H, toRef as re, computed as r, toRefs as ne, openBlock as i, createBlock as p, unref as t, normalizeClass as le, withCtx as w, renderSlot as c, createCommentVNode as n, createElementVNode as I, createElementBlock as y, withModifiers as x, mergeProps as N, withKeys as se, createVNode as ue } from "vue";
|
|
2
|
+
import { B, a as G } from "./chunks/dropdown.502e1f5c.js";
|
|
3
|
+
import { d as pe, B as L } from "./chunks/index.75f3672e.js";
|
|
5
4
|
import { g as A } from "./chunks/unique-id.a2a2b458.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { u as
|
|
10
|
-
import {
|
|
5
|
+
import { g as ce } from "./chunks/get-slot-text.bead058f.js";
|
|
6
|
+
import { u as fe } from "./chunks/aria-label.ac9651a5.js";
|
|
7
|
+
import { u as be } from "./chunks/i18n.6c402773.js";
|
|
8
|
+
import { u as ve } from "./chunks/use-form-layout-loading.d03e5d48.js";
|
|
9
|
+
import { u as ye } from "./chunks/use-has-slot.4d98bf29.js";
|
|
10
|
+
import { F as me, E as De } from "./chunks/field-label.61679178.js";
|
|
11
11
|
import { _ as we } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
12
12
|
import "./assets/index45.css";
|
|
13
|
-
var
|
|
14
|
-
const
|
|
13
|
+
var f = /* @__PURE__ */ ((e) => (e.DEFAULT = "default", e.PAYMENT_METHOD = "payment-method", e.STATIC_VALUE = "static-value", e.DROPDOWN = "dropdown", e))(f || {}), l = /* @__PURE__ */ ((e) => (e.START = "start", e.END = "end", e))(l || {}), b = /* @__PURE__ */ ((e) => (e.CONDENSED = "condensed", e.DISABLED = "disabled", e.READONLY = "readonly", e.ERROR = "error", e.SMALL_PADDING_LEFT = "small-padding-left", e.SMALL_PADDING_RIGHT = "small-padding-right", e))(b || {}), k = /* @__PURE__ */ ((e) => (e.SEARCH = "search", e.TEXT = "text", e.NUMBER = "number", e))(k || {}), Ae = /* @__PURE__ */ ((e) => (e.INPUT = "input", e.ESCAPE_PRESSED = "escape-pressed", e.UPDATE_DROPDOWN = "update:dropdown", e.DROPDOWN_INPUT = "dropdown-input", e.FOCUS = "focus", e.CHANGE = "change", e.BLUR = "blur", e.KEYDOWN = "keydown", e))(Ae || {});
|
|
14
|
+
const z = {
|
|
15
15
|
"en-US": {
|
|
16
|
-
optional: "optional",
|
|
17
|
-
required: "required",
|
|
18
16
|
ariaLabelFallback: "Input field"
|
|
19
17
|
}
|
|
20
|
-
}, Se = ["
|
|
21
|
-
i18n: { messages:
|
|
22
|
-
},
|
|
23
|
-
...
|
|
18
|
+
}, Se = ["aria-disabled"], ge = ["aria-hidden"], he = ["aria-hidden"], Ee = ["id"], _e = ["id", "aria-label", "aria-describedby", "aria-owns", "aria-invalid", "placeholder", "type", "value", "disabled", "readonly"], Le = ["aria-hidden"], Te = ["id"], Ne = ["id"], ke = {
|
|
19
|
+
i18n: { messages: z }
|
|
20
|
+
}, Re = /* @__PURE__ */ de({
|
|
21
|
+
...ke,
|
|
24
22
|
__name: "input-field",
|
|
25
23
|
props: {
|
|
26
24
|
/**
|
|
@@ -97,13 +95,17 @@ const Y = {
|
|
|
97
95
|
default: l.START,
|
|
98
96
|
validator: (e) => Object.values(l).includes(e)
|
|
99
97
|
},
|
|
98
|
+
/**
|
|
99
|
+
* Adds a info icon next to the label to display the passed tooltip message.
|
|
100
|
+
*/
|
|
101
|
+
tooltipText: { type: String, default: null },
|
|
100
102
|
/**
|
|
101
103
|
* A string specifying the type of control to render.
|
|
102
104
|
*/
|
|
103
105
|
type: {
|
|
104
106
|
type: String,
|
|
105
|
-
default:
|
|
106
|
-
validator: (e) => Object.values(
|
|
107
|
+
default: k.TEXT,
|
|
108
|
+
validator: (e) => Object.values(k).includes(e)
|
|
107
109
|
},
|
|
108
110
|
/**
|
|
109
111
|
* Text displayed as the value of the input-field
|
|
@@ -114,238 +116,214 @@ const Y = {
|
|
|
114
116
|
*/
|
|
115
117
|
variant: {
|
|
116
118
|
type: String,
|
|
117
|
-
default:
|
|
118
|
-
validator: (e) => Object.values(
|
|
119
|
+
default: f.DEFAULT,
|
|
120
|
+
validator: (e) => Object.values(f).includes(e)
|
|
119
121
|
}
|
|
120
122
|
},
|
|
121
123
|
emits: ["update:dropdown", "blur", "change", "dropdown-input", "escape-pressed", "focus", "keydown", "input"],
|
|
122
|
-
setup(e, { expose:
|
|
123
|
-
const a = e,
|
|
124
|
-
() => a.variant ===
|
|
125
|
-
),
|
|
124
|
+
setup(e, { expose: j, emit: s }) {
|
|
125
|
+
const a = e, R = ie(), T = oe(), { t: W } = be({ messages: z }), u = ye(T), O = H(null), M = A("input"), m = A("input-dropdown"), S = A("input-static-value"), $ = A("input-description"), P = A("input-error"), { isReadOnly: v } = ve(re(a, "readonly")), g = r(
|
|
126
|
+
() => a.variant === f.STATIC_VALUE && !!T.staticValue
|
|
127
|
+
), Y = r(() => a.variant === f.DEFAULT), q = r(() => a.variant === f.PAYMENT_METHOD), F = r(
|
|
126
128
|
() => g.value && a.staticValuePosition === l.START
|
|
127
|
-
),
|
|
129
|
+
), K = r(
|
|
128
130
|
() => g.value && a.staticValuePosition === l.END
|
|
129
|
-
), h =
|
|
131
|
+
), h = r(() => a.variant === f.DROPDOWN && !!a.dropdown), C = r(
|
|
130
132
|
() => h.value && a.dropdownPosition === l.START
|
|
131
|
-
), U =
|
|
133
|
+
), U = r(
|
|
132
134
|
() => h.value && a.dropdownPosition === l.END
|
|
133
|
-
), E =
|
|
134
|
-
() => !a.disabled && !
|
|
135
|
-
),
|
|
136
|
-
ariaLabel:
|
|
135
|
+
), E = r(
|
|
136
|
+
() => !a.disabled && !v.value && (!!a.errorMessage || a.error)
|
|
137
|
+
), X = r(() => h.value === !0 && g.value === !0 ? `${S} ${m}` : h.value === !0 ? `${m}` : g.value === !0 ? `${S}` : null), J = H(R["aria-label"]), { ariaLabel: Q } = ne(a), Z = fe({
|
|
138
|
+
ariaLabel: J.value,
|
|
137
139
|
// TODO: take this line away when the aria-label props is removed
|
|
138
|
-
label:
|
|
139
|
-
defaultFallback:
|
|
140
|
-
}),
|
|
141
|
-
() => `${
|
|
142
|
-
),
|
|
143
|
-
[`b-input-field--${
|
|
144
|
-
[`b-input-field--${
|
|
145
|
-
[`b-input-field--${
|
|
146
|
-
[`b-input-field--${
|
|
147
|
-
[`b-input-field--${
|
|
148
|
-
[`b-input-field--${
|
|
149
|
-
})),
|
|
150
|
-
!a.disabled && !
|
|
151
|
-
},
|
|
152
|
-
s("dropdown-input",
|
|
153
|
-
},
|
|
154
|
-
|
|
140
|
+
label: Q,
|
|
141
|
+
defaultFallback: u("default") ? ce(T)("default") : W("ariaLabelFallback")
|
|
142
|
+
}), ee = r(
|
|
143
|
+
() => `${u("description") ? $ : ""} ${E.value && a.errorMessage ? P : ""}`
|
|
144
|
+
), te = r(() => ({
|
|
145
|
+
[`b-input-field--${b.CONDENSED}`]: a.condensed,
|
|
146
|
+
[`b-input-field--${b.DISABLED}`]: a.disabled,
|
|
147
|
+
[`b-input-field--${b.READONLY}`]: v.value,
|
|
148
|
+
[`b-input-field--${b.ERROR}`]: E.value,
|
|
149
|
+
[`b-input-field--${b.SMALL_PADDING_LEFT}`]: C.value,
|
|
150
|
+
[`b-input-field--${b.SMALL_PADDING_RIGHT}`]: U.value
|
|
151
|
+
})), ae = (o) => {
|
|
152
|
+
!a.disabled && !v.value && s("input", o.target.value);
|
|
153
|
+
}, V = (o) => {
|
|
154
|
+
s("dropdown-input", o), s("update:dropdown", { ...a == null ? void 0 : a.dropdown, value: o });
|
|
155
|
+
}, _ = () => {
|
|
156
|
+
O.value.focus();
|
|
155
157
|
};
|
|
156
|
-
return
|
|
157
|
-
focusInput:
|
|
158
|
-
}), a.error &&
|
|
158
|
+
return j({
|
|
159
|
+
focusInput: _
|
|
160
|
+
}), a.error && pe(
|
|
159
161
|
'BentoInputField "error" property',
|
|
160
162
|
`Use the BentoInputField "errorMessage" property instead to indicate that there is a modifier error.
|
|
161
163
|
Having the field as "undefined" will hide/remove the error.
|
|
162
164
|
<bento-dropdown errorMessage="Error message text" />`,
|
|
163
165
|
"2.0.0"
|
|
164
|
-
), (
|
|
165
|
-
class:
|
|
166
|
+
), (o, d) => (i(), p(t(L), {
|
|
167
|
+
class: le(["b-input-field", t(te)]),
|
|
166
168
|
"data-testid": "input-text-container",
|
|
167
169
|
el: "div",
|
|
168
170
|
variant: "body"
|
|
169
171
|
}, {
|
|
170
|
-
default:
|
|
171
|
-
t(
|
|
172
|
+
default: w(() => [
|
|
173
|
+
t(u)("default") ? (i(), p(t(me), {
|
|
172
174
|
key: 0,
|
|
173
|
-
for: t(
|
|
174
|
-
class: "b-input-field__label",
|
|
175
|
+
for: t(M),
|
|
175
176
|
"data-testid": "input-field-label",
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}),
|
|
188
|
-
e.optional ? (d(), u(t(y), {
|
|
189
|
-
key: 0,
|
|
190
|
-
class: "b-input-field__label-requirement",
|
|
191
|
-
el: "span"
|
|
192
|
-
}, {
|
|
193
|
-
default: c(() => [
|
|
194
|
-
q(" (" + G(t(k)("optional")) + ") ", 1)
|
|
195
|
-
]),
|
|
196
|
-
_: 1
|
|
197
|
-
})) : o("", !0),
|
|
198
|
-
e.required ? (d(), u(t(y), {
|
|
199
|
-
key: 1,
|
|
200
|
-
class: "b-input-field__label-requirement",
|
|
201
|
-
el: "span"
|
|
202
|
-
}, {
|
|
203
|
-
default: c(() => [
|
|
204
|
-
q(" (" + G(t(k)("required")) + ") ", 1)
|
|
205
|
-
]),
|
|
206
|
-
_: 1
|
|
207
|
-
})) : o("", !0)
|
|
208
|
-
], 8, Se)) : o("", !0),
|
|
209
|
-
x("div", {
|
|
177
|
+
"tooltip-text": e.tooltipText,
|
|
178
|
+
optional: e.optional,
|
|
179
|
+
required: e.required,
|
|
180
|
+
onClick: _
|
|
181
|
+
}, {
|
|
182
|
+
default: w(() => [
|
|
183
|
+
c(o.$slots, "default", {}, void 0, !0)
|
|
184
|
+
]),
|
|
185
|
+
_: 3
|
|
186
|
+
}, 8, ["for", "tooltip-text", "optional", "required"])) : n("", !0),
|
|
187
|
+
I("div", {
|
|
210
188
|
class: "b-input-field__input-box",
|
|
211
189
|
"data-testid": "input-box",
|
|
212
190
|
"aria-disabled": e.disabled,
|
|
213
|
-
onClick:
|
|
191
|
+
onClick: _
|
|
214
192
|
}, [
|
|
215
|
-
t(
|
|
193
|
+
t(Y) && t(u)("defaultIconBefore") ? (i(), y("span", {
|
|
216
194
|
key: 0,
|
|
217
195
|
"aria-hidden": e.ariaHidden ? "true" : void 0,
|
|
218
196
|
class: "b-input-field__default-icon-before"
|
|
219
197
|
}, [
|
|
220
|
-
|
|
221
|
-
], 8,
|
|
222
|
-
t(
|
|
198
|
+
c(o.$slots, "defaultIconBefore", {}, void 0, !0)
|
|
199
|
+
], 8, ge)) : n("", !0),
|
|
200
|
+
t(q) && t(u)("paymentMethod") ? (i(), y("span", {
|
|
223
201
|
key: 1,
|
|
224
202
|
"aria-hidden": e.ariaHidden ? "true" : void 0,
|
|
225
203
|
class: "b-input-field__payment-method"
|
|
226
204
|
}, [
|
|
227
|
-
|
|
228
|
-
], 8,
|
|
229
|
-
t(
|
|
205
|
+
c(o.$slots, "paymentMethod", {}, void 0, !0)
|
|
206
|
+
], 8, he)) : n("", !0),
|
|
207
|
+
t(C) ? (i(), y("div", {
|
|
230
208
|
key: 2,
|
|
231
|
-
id: t(
|
|
209
|
+
id: t(m),
|
|
232
210
|
class: "b-input-field__dropdown b-input-field__dropdown--start",
|
|
233
|
-
onClick:
|
|
211
|
+
onClick: d[0] || (d[0] = x(() => {
|
|
234
212
|
}, ["stop"]))
|
|
235
213
|
}, [
|
|
236
|
-
e.dropdown ? (
|
|
237
|
-
size: t(
|
|
214
|
+
e.dropdown ? (i(), p(t(B), N({ key: 0 }, e.dropdown, {
|
|
215
|
+
size: t(G).SMALL,
|
|
238
216
|
disabled: e.disabled,
|
|
239
|
-
readonly: t(
|
|
240
|
-
onInput:
|
|
241
|
-
}), null, 16, ["size", "disabled", "readonly"])) :
|
|
242
|
-
], 8,
|
|
243
|
-
t(
|
|
217
|
+
readonly: t(v),
|
|
218
|
+
onInput: V
|
|
219
|
+
}), null, 16, ["size", "disabled", "readonly"])) : n("", !0)
|
|
220
|
+
], 8, Ee)) : n("", !0),
|
|
221
|
+
t(F) ? (i(), p(t(L), {
|
|
244
222
|
key: 3,
|
|
245
223
|
id: t(S),
|
|
246
224
|
class: "b-input-field__static-value b-input-field__static-value--start",
|
|
247
225
|
el: "span",
|
|
248
226
|
variant: "body"
|
|
249
227
|
}, {
|
|
250
|
-
default:
|
|
251
|
-
|
|
228
|
+
default: w(() => [
|
|
229
|
+
c(o.$slots, "staticValue", {}, void 0, !0)
|
|
252
230
|
]),
|
|
253
231
|
_: 3
|
|
254
|
-
}, 8, ["id"])) :
|
|
255
|
-
|
|
232
|
+
}, 8, ["id"])) : n("", !0),
|
|
233
|
+
I("input", N({ id: t(M) }, t(R), {
|
|
256
234
|
ref_key: "inputFieldElement",
|
|
257
|
-
ref:
|
|
235
|
+
ref: O,
|
|
258
236
|
class: "b-input-field__input",
|
|
259
|
-
"aria-label": t(
|
|
260
|
-
"aria-describedby": t(
|
|
261
|
-
"aria-owns": t(
|
|
237
|
+
"aria-label": t(Z),
|
|
238
|
+
"aria-describedby": t(ee),
|
|
239
|
+
"aria-owns": t(X),
|
|
262
240
|
"aria-invalid": t(E),
|
|
263
241
|
placeholder: e.placeholder,
|
|
264
242
|
type: e.type,
|
|
265
243
|
value: e.value,
|
|
266
244
|
disabled: e.disabled,
|
|
267
|
-
readonly: t(
|
|
268
|
-
onInput:
|
|
269
|
-
onChange:
|
|
270
|
-
onFocus:
|
|
271
|
-
onBlur:
|
|
245
|
+
readonly: t(v),
|
|
246
|
+
onInput: ae,
|
|
247
|
+
onChange: d[1] || (d[1] = (D) => s("change")),
|
|
248
|
+
onFocus: d[2] || (d[2] = (D) => s("focus")),
|
|
249
|
+
onBlur: d[3] || (d[3] = (D) => s("blur")),
|
|
272
250
|
onKeydown: [
|
|
273
|
-
|
|
274
|
-
|
|
251
|
+
d[4] || (d[4] = (D) => s("keydown", D)),
|
|
252
|
+
d[5] || (d[5] = se((D) => s("escape-pressed"), ["esc"]))
|
|
275
253
|
]
|
|
276
|
-
}), null, 16,
|
|
277
|
-
t(
|
|
254
|
+
}), null, 16, _e),
|
|
255
|
+
t(u)("iconAfter") ? (i(), y("span", {
|
|
278
256
|
key: 4,
|
|
279
257
|
"aria-hidden": e.ariaHidden ? "true" : void 0,
|
|
280
258
|
class: "b-input-field__icon-after",
|
|
281
259
|
"data-testid": "input-text__icon-after"
|
|
282
260
|
}, [
|
|
283
|
-
|
|
284
|
-
], 8,
|
|
285
|
-
t(
|
|
261
|
+
c(o.$slots, "iconAfter", {}, void 0, !0)
|
|
262
|
+
], 8, Le)) : n("", !0),
|
|
263
|
+
t(K) ? (i(), p(t(L), {
|
|
286
264
|
key: 5,
|
|
287
265
|
id: t(S),
|
|
288
266
|
class: "b-input-field__static-value b-input-field__static-value--end",
|
|
289
267
|
el: "span",
|
|
290
268
|
variant: "body"
|
|
291
269
|
}, {
|
|
292
|
-
default:
|
|
293
|
-
|
|
270
|
+
default: w(() => [
|
|
271
|
+
c(o.$slots, "staticValue", {}, void 0, !0)
|
|
294
272
|
]),
|
|
295
273
|
_: 3
|
|
296
|
-
}, 8, ["id"])) :
|
|
297
|
-
t(U) ? (
|
|
274
|
+
}, 8, ["id"])) : n("", !0),
|
|
275
|
+
t(U) ? (i(), y("div", {
|
|
298
276
|
key: 6,
|
|
299
|
-
id: t(
|
|
277
|
+
id: t(m),
|
|
300
278
|
class: "b-input-field__dropdown b-input-field__dropdown--end",
|
|
301
|
-
onClick:
|
|
279
|
+
onClick: d[6] || (d[6] = x(() => {
|
|
302
280
|
}, ["stop"]))
|
|
303
281
|
}, [
|
|
304
|
-
e.dropdown ? (
|
|
282
|
+
e.dropdown ? (i(), p(t(B), N({
|
|
305
283
|
key: 0,
|
|
306
|
-
id: t(
|
|
284
|
+
id: t(m)
|
|
307
285
|
}, e.dropdown, {
|
|
308
|
-
size: t(
|
|
286
|
+
size: t(G).SMALL,
|
|
309
287
|
disabled: e.disabled,
|
|
310
|
-
readonly: t(
|
|
311
|
-
onInput:
|
|
312
|
-
}), null, 16, ["id", "size", "disabled", "readonly"])) :
|
|
313
|
-
], 8,
|
|
314
|
-
], 8,
|
|
315
|
-
t(E) && e.errorMessage ? (
|
|
288
|
+
readonly: t(v),
|
|
289
|
+
onInput: V
|
|
290
|
+
}), null, 16, ["id", "size", "disabled", "readonly"])) : n("", !0)
|
|
291
|
+
], 8, Te)) : n("", !0)
|
|
292
|
+
], 8, Se),
|
|
293
|
+
t(E) && e.errorMessage ? (i(), p(t(De), {
|
|
316
294
|
key: 1,
|
|
317
|
-
id: t(
|
|
295
|
+
id: t(P),
|
|
318
296
|
"error-message": e.errorMessage,
|
|
319
297
|
class: "b-input-field__error-message"
|
|
320
|
-
}, null, 8, ["id", "error-message"])) :
|
|
321
|
-
t(
|
|
298
|
+
}, null, 8, ["id", "error-message"])) : n("", !0),
|
|
299
|
+
t(u)("description") ? (i(), y("span", {
|
|
322
300
|
key: 2,
|
|
323
|
-
id: t(
|
|
301
|
+
id: t($),
|
|
324
302
|
class: "b-input-field__description",
|
|
325
|
-
onClick:
|
|
303
|
+
onClick: _
|
|
326
304
|
}, [
|
|
327
|
-
|
|
305
|
+
ue(t(L), {
|
|
328
306
|
el: "span",
|
|
329
307
|
variant: "body"
|
|
330
308
|
}, {
|
|
331
|
-
default:
|
|
332
|
-
|
|
309
|
+
default: w(() => [
|
|
310
|
+
c(o.$slots, "description", { id: "description" }, void 0, !0)
|
|
333
311
|
]),
|
|
334
312
|
_: 3
|
|
335
313
|
})
|
|
336
|
-
], 8,
|
|
314
|
+
], 8, Ne)) : n("", !0)
|
|
337
315
|
]),
|
|
338
316
|
_: 3
|
|
339
317
|
}, 8, ["class"]));
|
|
340
318
|
}
|
|
341
319
|
});
|
|
342
|
-
const
|
|
320
|
+
const Ge = /* @__PURE__ */ we(Re, [["__scopeId", "data-v-08dffe5b"]]);
|
|
343
321
|
export {
|
|
344
|
-
|
|
322
|
+
Ge as BentoInputField,
|
|
345
323
|
l as BentoInputFieldElementPosition,
|
|
346
324
|
Ae as BentoInputFieldEvent,
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
325
|
+
b as BentoInputFieldStateClass,
|
|
326
|
+
k as BentoInputFieldType,
|
|
327
|
+
f as BentoInputFieldVariant
|
|
350
328
|
};
|
|
351
329
|
//# sourceMappingURL=input-field.js.map
|
package/dist/input-field.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-field.js","sources":["../../vue2/src/components/input-field/input-field.types.ts","../../vue2/src/components/input-field/input-field.vue"],"sourcesContent":["import { BentoDropdown } from '@/components/dropdown/';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldVariant {\n DEFAULT = 'default',\n PAYMENT_METHOD = 'payment-method',\n STATIC_VALUE = 'static-value',\n DROPDOWN = 'dropdown',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldElementPosition {\n START = 'start',\n END = 'end',\n}\n\nexport enum BentoInputFieldStateClass {\n CONDENSED = 'condensed',\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n SMALL_PADDING_LEFT = 'small-padding-left',\n SMALL_PADDING_RIGHT = 'small-padding-right',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldType {\n SEARCH = 'search',\n TEXT = 'text',\n NUMBER = 'number',\n}\n\nexport type BentoInputFieldValue = string | number;\n\ntype DropdownProps = InstanceType<typeof BentoDropdown>['$props'];\nexport type BentoInputDropdownProps = {\n items: DropdownProps['items'];\n value: DropdownProps['value'];\n};\n\n/**\n * @deprecated The use of these enums is no longer supported.\n * Use `v-on:` or `@` to listen to the events being emitted.\n * This enum will be removed in 2.0.\n */\nexport enum BentoInputFieldEvent {\n INPUT = 'input',\n ESCAPE_PRESSED = 'escape-pressed',\n UPDATE_DROPDOWN = 'update:dropdown',\n DROPDOWN_INPUT = 'dropdown-input',\n FOCUS = 'focus',\n CHANGE = 'change',\n BLUR = 'blur',\n KEYDOWN = 'keydown',\n}\n","<template>\n <bento-typography\n class=\"b-input-field\"\n data-testid=\"input-text-container\"\n :class=\"inputFieldConditionalClasses\"\n el=\"div\"\n variant=\"body\"\n >\n <!-- Label -->\n <label\n v-if=\"hasSlot('default')\"\n :for=\"inputFieldId\"\n class=\"b-input-field__label\"\n data-testid=\"input-field-label\"\n @click=\"focusInput\"\n >\n <bento-typography el=\"span\" variant=\"body\" stronger>\n <slot></slot>\n </bento-typography>\n <bento-typography v-if=\"optional\" class=\"b-input-field__label-requirement\" el=\"span\">\n ({{ t('optional') }})\n </bento-typography>\n <bento-typography v-if=\"required\" class=\"b-input-field__label-requirement\" el=\"span\">\n ({{ t('required') }})\n </bento-typography>\n </label>\n\n <div class=\"b-input-field__input-box\" data-testid=\"input-box\" :aria-disabled=\"disabled\" @click=\"focusInput\">\n <!-- Optional Icon for Default text variant -->\n <span\n v-if=\"isDefaultVariant && hasSlot('defaultIconBefore')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__default-icon-before\"\n >\n <slot name=\"defaultIconBefore\" />\n </span>\n\n <!-- Mandatory Icon for Payment Method variant -->\n <span\n v-if=\"isPaymentMethodVariant && hasSlot('paymentMethod')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__payment-method\"\n >\n <slot name=\"paymentMethod\" />\n </span>\n\n <!-- Dropdown at start -->\n <div\n v-if=\"shouldDisplayDropdownAtStart\"\n :id=\"dropdownId\"\n class=\"b-input-field__dropdown b-input-field__dropdown--start\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n v-bind=\"dropdown\"\n :size=\"BentoDropdownSize.SMALL\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n\n <!-- Static Value at start -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtStart\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--start\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n\n <input\n :id=\"inputFieldId\"\n v-bind=\"attrs\"\n ref=\"inputFieldElement\"\n class=\"b-input-field__input\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"computedAriaDescribedBy\"\n :aria-owns=\"computedAriaOwns\"\n :aria-invalid=\"shouldShowError\"\n :placeholder=\"placeholder\"\n :type=\"type\"\n :value=\"value\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onInput\"\n @change=\"emit('change')\"\n @focus=\"emit('focus')\"\n @blur=\"emit('blur')\"\n @keydown=\"emit('keydown', $event)\"\n @keydown.esc=\"emit('escape-pressed')\"\n />\n <span\n v-if=\"hasSlot('iconAfter')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-after\"\n data-testid=\"input-text__icon-after\"\n >\n <slot name=\"iconAfter\" />\n </span>\n\n <!-- Static Value at the end -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtEnd\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--end\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n\n <!-- Dropdown at end -->\n <div\n v-if=\"shouldDisplayDropdownAtEnd\"\n :id=\"dropdownId\"\n class=\"b-input-field__dropdown b-input-field__dropdown--end\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n :id=\"dropdownId\"\n v-bind=\"dropdown\"\n :size=\"BentoDropdownSize.SMALL\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n </div>\n\n <error-message\n v-if=\"shouldShowError && !!errorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-input-field__error-message\"\n />\n\n <span v-if=\"hasSlot('description')\" :id=\"descriptionId\" class=\"b-input-field__description\" @click=\"focusInput\">\n <bento-typography el=\"span\" variant=\"body\">\n <slot id=\"description\" name=\"description\" />\n </bento-typography>\n </span>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, ref, toRef, toRefs, useAttrs, useSlots } from 'vue';\n import {\n BentoInputDropdownProps,\n BentoInputFieldElementPosition,\n BentoInputFieldStateClass,\n BentoInputFieldType,\n BentoInputFieldValue,\n BentoInputFieldVariant,\n } from './input-field.types';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage } from '@/components/internal/error-message';\n import { useFormLayoutFieldLoading, useHasSlot } from '@/composables';\n import { generateUid } from '@/utils/ts/unique-id';\n import { useI18n } from '@/utils/ts/i18n';\n import { BentoDropdownSize } from '../dropdown/dropdown.types';\n import { BentoDropdown } from '@/components/dropdown';\n import { BentoListboxSelectedValue } from '@/types';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { deprecate } from '@/utils/ts/deprecate';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n const slots = useSlots();\n\n const props = defineProps({\n /**\n * Indicates whether the element is exposed to an accessibility API.\n */\n ariaHidden: { type: Boolean, default: true },\n\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Text that labels an the input element\n */\n ariaLabel: { type: String, default: undefined },\n\n /**\n * Reduces height of the input\n */\n condensed: { type: Boolean, default: false },\n\n /**\n * Disables the possibility of changing value in the input-field\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Dropdown props for the small selectable dropdown menu.\n * @see BentoDropdown\n */\n dropdown: {\n type: Object as PropType<BentoInputDropdownProps>,\n default: undefined,\n },\n\n /**\n * Position of the dropdown before or after input value\n */\n dropdownPosition: {\n type: String as PropType<BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`>,\n default: BentoInputFieldElementPosition.START,\n validator: (value: BentoInputFieldElementPosition) =>\n Object.values(BentoInputFieldElementPosition).includes(value),\n },\n\n /**\n * Adds error validation class for outlining input-field.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n error: { type: Boolean, default: false },\n\n /**\n * Renders input-field with an error state and the error message beneath the input box\n */\n errorMessage: { type: String, default: null },\n\n /**\n * Highlights the dropdown is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Text displayed as the placeholder of the input-field\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Highlights the dropdown is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Setting this property to true will set the input field to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Static text that displayed before or after input value\n * Applicable to the Static Value variant\n */\n staticValue: { type: String, default: '' },\n\n /**\n * Position of Static Value before or after input value\n */\n staticValuePosition: {\n type: String as PropType<BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`>,\n default: BentoInputFieldElementPosition.START,\n validator: (value: BentoInputFieldElementPosition) =>\n Object.values(BentoInputFieldElementPosition).includes(value),\n },\n\n /**\n * A string specifying the type of control to render.\n */\n type: {\n type: String as PropType<BentoInputFieldType | `${BentoInputFieldType}`>,\n default: BentoInputFieldType.TEXT,\n validator: (value: BentoInputFieldType) => Object.values(BentoInputFieldType).includes(value),\n },\n\n /**\n * Text displayed as the value of the input-field\n */\n value: { type: [String, Number] as PropType<BentoInputFieldValue>, default: undefined },\n\n /**\n * Describes the different variants for the input element\n */\n variant: {\n type: String as PropType<BentoInputFieldVariant | `${BentoInputFieldVariant}`>,\n default: BentoInputFieldVariant.DEFAULT,\n validator: (value: BentoInputFieldVariant) => Object.values(BentoInputFieldVariant).includes(value),\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the Input Field's internal dropdown changes it's value. Contains every dropdown prop passed with the updated selected value as 'value'\n */\n (e: 'update:dropdown', updatedDropdownProps: BentoInputDropdownProps): void;\n\n /**\n * Emitted when the element has lost focus\n */\n (e: 'blur'): void;\n\n /**\n * Emitted when the user modifies the element's value. Unlike the 'input' event, the change event is not necessarily fired for each alteration to an element's value\n */\n (e: 'change'): void;\n\n /**\n * Emitted when the Input Field's internal dropdown changes it's value\n */\n (e: 'dropdown-input', selectedValue: BentoListboxSelectedValue): void;\n\n /**\n * Emitted when the \"ESC\" key is pressed\n */\n (e: 'escape-pressed'): void;\n\n /**\n * Emitted when the element has received focus\n */\n (e: 'focus'): void;\n\n /**\n * Emitted when a key is pressed\n */\n (e: 'keydown', event: KeyboardEvent): void;\n\n /**\n * Emitted when the component's model changes\n */\n (e: 'input', inputValue: string): void;\n }>();\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const hasSlot = useHasSlot(slots);\n const inputFieldElement = ref(null);\n const inputFieldId = generateUid('input');\n const dropdownId = generateUid('input-dropdown');\n const staticValueId = generateUid('input-static-value');\n const descriptionId = generateUid('input-description');\n const errorId = generateUid('input-error');\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const shouldShowStaticValue = computed(\n () => props.variant === BentoInputFieldVariant.STATIC_VALUE && !!slots.staticValue\n );\n\n const isDefaultVariant = computed(() => props.variant === BentoInputFieldVariant.DEFAULT);\n\n const isPaymentMethodVariant = computed(() => props.variant === BentoInputFieldVariant.PAYMENT_METHOD);\n\n const shouldDisplayStaticValueAtStart = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayStaticValueAtEnd = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowDropdown = computed(() => props.variant === BentoInputFieldVariant.DROPDOWN && !!props.dropdown);\n const shouldDisplayDropdownAtStart = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayDropdownAtEnd = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.error)\n );\n\n const computedAriaOwns = computed(() => {\n if (shouldShowDropdown.value === true && shouldShowStaticValue.value === true) {\n return `${staticValueId} ${dropdownId}`;\n }\n if (shouldShowDropdown.value === true) {\n return `${dropdownId}`;\n }\n if (shouldShowStaticValue.value === true) {\n return `${staticValueId}`;\n }\n return 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('ariaLabelFallback'),\n });\n\n const computedAriaDescribedBy = computed(\n () =>\n `${hasSlot('description') ? descriptionId : ''} ${\n shouldShowError.value && !!props.errorMessage ? errorId : ''\n }`\n );\n\n const inputFieldConditionalClasses = computed(() => ({\n [`b-input-field--${BentoInputFieldStateClass.CONDENSED}`]: props.condensed,\n [`b-input-field--${BentoInputFieldStateClass.DISABLED}`]: props.disabled,\n [`b-input-field--${BentoInputFieldStateClass.READONLY}`]: isReadOnly.value,\n [`b-input-field--${BentoInputFieldStateClass.ERROR}`]: shouldShowError.value,\n [`b-input-field--${BentoInputFieldStateClass.SMALL_PADDING_LEFT}`]: shouldDisplayDropdownAtStart.value,\n [`b-input-field--${BentoInputFieldStateClass.SMALL_PADDING_RIGHT}`]: shouldDisplayDropdownAtEnd.value,\n }));\n\n const onInput = (event: Event) => {\n if (!props.disabled && !isReadOnly.value) {\n emit('input', (event.target as HTMLInputElement).value);\n }\n };\n\n const onDropdownInput = (selectedValue: BentoListboxSelectedValue) => {\n emit('dropdown-input', selectedValue);\n emit('update:dropdown', { ...props?.dropdown, value: selectedValue });\n };\n\n const focusInput = () => {\n inputFieldElement.value.focus();\n };\n\n // Expose method so that other components can focus on it in Vue3\n defineExpose({\n focusInput,\n });\n\n if (props.error) {\n deprecate(\n 'BentoInputField \"error\" property',\n `Use the BentoInputField \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-dropdown errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Input field component is used to create interactive controls for web-based\n * forms in order to accept data from the user.\n *\n * @example\n * import { BentoInputField } from '@adyen/bento-vue2'\n *\n * const inputValue = ref('');\n *\n * export default {\n * components: { BentoInputField },\n * tempate: `\n * <bento-input-field\n * :value=\"inputValue\"\n * :input=\"newValue => inputValue.value = newValue\"\n * >\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-field.scss\" />\n"],"names":["BentoInputFieldVariant","BentoInputFieldVariant2","BentoInputFieldElementPosition","BentoInputFieldElementPosition2","BentoInputFieldStateClass","BentoInputFieldStateClass2","BentoInputFieldType","BentoInputFieldType2","BentoInputFieldEvent","BentoInputFieldEvent2","__default__","messages","attrs","useAttrs","slots","useSlots","t","useI18n","hasSlot","useHasSlot","inputFieldElement","ref","inputFieldId","generateUid","dropdownId","staticValueId","descriptionId","errorId","isReadOnly","useFormLayoutFieldLoading","toRef","props","shouldShowStaticValue","computed","isDefaultVariant","isPaymentMethodVariant","shouldDisplayStaticValueAtStart","shouldDisplayStaticValueAtEnd","shouldShowDropdown","shouldDisplayDropdownAtStart","shouldDisplayDropdownAtEnd","shouldShowError","computedAriaOwns","ariaLabelAttribute","ariaLabel","toRefs","computedAriaLabel","useAriaLabel","getSlotText","computedAriaDescribedBy","inputFieldConditionalClasses","onInput","event","emit","onDropdownInput","selectedValue","focusInput","expose","deprecate"],"mappings":";;;;;;;;;;;;AAKY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,E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eAAAJ,IAAA;AAAA,IAGsC,GAItEuB,KAAAjB,EAAA,OAAA;AAAA,MAAqD,CAAA,kBAAA7B,EAAA,WAAA,GAAA2B,EAAA;AAAA,MACgB,CAAA,kBAAA3B,EAAA,UAAA,GAAA2B,EAAA;AAAA,MACD,CAAA,kBAAA3B,EAAA,UAAA,GAAAwB,EAAA;AAAA,MACK,CAAA,kBAAAxB,EAAA,OAAA,GAAAqC,EAAA;AAAA,MACE,CAAA,kBAAArC,EAAA,oBAAA,GAAAmC,EAAA;AAAA,MAC0B,CAAA,kBAAAnC,EAAA,qBAAA,GAAAoC,EAAA;AAAA,IACD,EAAA,GAGpGW,KAAA,CAAAC,MAAA;AACI,MAAA,CAAArB,EAAA,YAAA,CAAAH,EAAA,SACIyB,EAAA,SAAAD,EAAA,OAAA,KAAA;AAAA,IACJ,GAGJE,IAAA,CAAAC,MAAA;AACI,MAAAF,EAAA,kBAAAE,CAAA,GACAF,EAAA,mBAAA,EAAA,GAAAtB,KAAA,gBAAAA,EAAA,UAAA,OAAAwB,EAAA,CAAA;AAAA,IAAoE,GAGxEC,IAAA,MAAA;AACI,MAAApC,EAAA,MAAA,MAAA;AAAA,IAA8B;AAIlC,WAAAqC,EAAA;AAAA,MAAa,YAAAD;AAAA,IACT,CAAA,GAGJzB,EAAA,SACI2B;AAAA,MAAA;AAAA,MACI;AAAA;AAAA;AAAA,MACA;AAAA,IAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"input-field.js","sources":["../../vue2/src/components/input-field/input-field.types.ts","../../vue2/src/components/input-field/input-field.vue"],"sourcesContent":["import { BentoDropdown } from '@/components/dropdown/';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldVariant {\n DEFAULT = 'default',\n PAYMENT_METHOD = 'payment-method',\n STATIC_VALUE = 'static-value',\n DROPDOWN = 'dropdown',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldElementPosition {\n START = 'start',\n END = 'end',\n}\n\nexport enum BentoInputFieldStateClass {\n CONDENSED = 'condensed',\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n SMALL_PADDING_LEFT = 'small-padding-left',\n SMALL_PADDING_RIGHT = 'small-padding-right',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldType {\n SEARCH = 'search',\n TEXT = 'text',\n NUMBER = 'number',\n}\n\nexport type BentoInputFieldValue = string | number;\n\ntype DropdownProps = InstanceType<typeof BentoDropdown>['$props'];\nexport type BentoInputDropdownProps = {\n items: DropdownProps['items'];\n value: DropdownProps['value'];\n};\n\n/**\n * @deprecated The use of these enums is no longer supported.\n * Use `v-on:` or `@` to listen to the events being emitted.\n * This enum will be removed in 2.0.\n */\nexport enum BentoInputFieldEvent {\n INPUT = 'input',\n ESCAPE_PRESSED = 'escape-pressed',\n UPDATE_DROPDOWN = 'update:dropdown',\n DROPDOWN_INPUT = 'dropdown-input',\n FOCUS = 'focus',\n CHANGE = 'change',\n BLUR = 'blur',\n KEYDOWN = 'keydown',\n}\n","<template>\n <bento-typography\n class=\"b-input-field\"\n data-testid=\"input-text-container\"\n :class=\"inputFieldConditionalClasses\"\n el=\"div\"\n variant=\"body\"\n >\n <field-label\n v-if=\"hasSlot('default')\"\n :for=\"inputFieldId\"\n data-testid=\"input-field-label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n @click=\"focusInput\"\n >\n <slot></slot>\n </field-label>\n\n <div class=\"b-input-field__input-box\" data-testid=\"input-box\" :aria-disabled=\"disabled\" @click=\"focusInput\">\n <!-- Optional Icon for Default text variant -->\n <span\n v-if=\"isDefaultVariant && hasSlot('defaultIconBefore')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__default-icon-before\"\n >\n <slot name=\"defaultIconBefore\" />\n </span>\n\n <!-- Mandatory Icon for Payment Method variant -->\n <span\n v-if=\"isPaymentMethodVariant && hasSlot('paymentMethod')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__payment-method\"\n >\n <slot name=\"paymentMethod\" />\n </span>\n\n <!-- Dropdown at start -->\n <div\n v-if=\"shouldDisplayDropdownAtStart\"\n :id=\"dropdownId\"\n class=\"b-input-field__dropdown b-input-field__dropdown--start\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n v-bind=\"dropdown\"\n :size=\"BentoDropdownSize.SMALL\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n\n <!-- Static Value at start -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtStart\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--start\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n\n <input\n :id=\"inputFieldId\"\n v-bind=\"attrs\"\n ref=\"inputFieldElement\"\n class=\"b-input-field__input\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"computedAriaDescribedBy\"\n :aria-owns=\"computedAriaOwns\"\n :aria-invalid=\"shouldShowError\"\n :placeholder=\"placeholder\"\n :type=\"type\"\n :value=\"value\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onInput\"\n @change=\"emit('change')\"\n @focus=\"emit('focus')\"\n @blur=\"emit('blur')\"\n @keydown=\"emit('keydown', $event)\"\n @keydown.esc=\"emit('escape-pressed')\"\n />\n <span\n v-if=\"hasSlot('iconAfter')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-after\"\n data-testid=\"input-text__icon-after\"\n >\n <slot name=\"iconAfter\" />\n </span>\n\n <!-- Static Value at the end -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtEnd\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--end\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n\n <!-- Dropdown at end -->\n <div\n v-if=\"shouldDisplayDropdownAtEnd\"\n :id=\"dropdownId\"\n class=\"b-input-field__dropdown b-input-field__dropdown--end\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n :id=\"dropdownId\"\n v-bind=\"dropdown\"\n :size=\"BentoDropdownSize.SMALL\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n </div>\n\n <error-message\n v-if=\"shouldShowError && !!errorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-input-field__error-message\"\n />\n\n <span v-if=\"hasSlot('description')\" :id=\"descriptionId\" class=\"b-input-field__description\" @click=\"focusInput\">\n <bento-typography el=\"span\" variant=\"body\">\n <slot id=\"description\" name=\"description\" />\n </bento-typography>\n </span>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, ref, toRef, toRefs, useAttrs, useSlots } from 'vue';\n\n // Components\n import { BentoDropdown } from '@/components/dropdown';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage, FieldLabel } from '@/internal';\n\n // Utils\n import { deprecate } from '@/utils/ts/deprecate';\n import { generateUid } from '@/utils/ts/unique-id';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useI18n } from '@/utils/ts/i18n';\n\n // Composables\n import { useFormLayoutFieldLoading, useHasSlot } from '@/composables';\n\n // Types\n import { BentoDropdownSize } from '../dropdown/dropdown.types';\n import {\n BentoInputDropdownProps,\n BentoInputFieldElementPosition,\n BentoInputFieldStateClass,\n BentoInputFieldType,\n BentoInputFieldValue,\n BentoInputFieldVariant,\n } from './input-field.types';\n import { BentoListboxSelectedValue } from '@/types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n const slots = useSlots();\n\n const props = defineProps({\n /**\n * Indicates whether the element is exposed to an accessibility API.\n */\n ariaHidden: { type: Boolean, default: true },\n\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Text that labels an the input element\n */\n ariaLabel: { type: String, default: undefined },\n\n /**\n * Reduces height of the input\n */\n condensed: { type: Boolean, default: false },\n\n /**\n * Disables the possibility of changing value in the input-field\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Dropdown props for the small selectable dropdown menu.\n * @see BentoDropdown\n */\n dropdown: {\n type: Object as PropType<BentoInputDropdownProps>,\n default: undefined,\n },\n\n /**\n * Position of the dropdown before or after input value\n */\n dropdownPosition: {\n type: String as PropType<BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`>,\n default: BentoInputFieldElementPosition.START,\n validator: (value: BentoInputFieldElementPosition) =>\n Object.values(BentoInputFieldElementPosition).includes(value),\n },\n\n /**\n * Adds error validation class for outlining input-field.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n error: { type: Boolean, default: false },\n\n /**\n * Renders input-field with an error state and the error message beneath the input box\n */\n errorMessage: { type: String, default: null },\n\n /**\n * Highlights the dropdown is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Text displayed as the placeholder of the input-field\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Highlights the dropdown is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Setting this property to true will set the input field to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Static text that displayed before or after input value\n * Applicable to the Static Value variant\n */\n staticValue: { type: String, default: '' },\n\n /**\n * Position of Static Value before or after input value\n */\n staticValuePosition: {\n type: String as PropType<BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`>,\n default: BentoInputFieldElementPosition.START,\n validator: (value: BentoInputFieldElementPosition) =>\n Object.values(BentoInputFieldElementPosition).includes(value),\n },\n\n /**\n * Adds a info icon next to the label to display the passed tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * A string specifying the type of control to render.\n */\n type: {\n type: String as PropType<BentoInputFieldType | `${BentoInputFieldType}`>,\n default: BentoInputFieldType.TEXT,\n validator: (value: BentoInputFieldType) => Object.values(BentoInputFieldType).includes(value),\n },\n\n /**\n * Text displayed as the value of the input-field\n */\n value: { type: [String, Number] as PropType<BentoInputFieldValue>, default: undefined },\n\n /**\n * Describes the different variants for the input element\n */\n variant: {\n type: String as PropType<BentoInputFieldVariant | `${BentoInputFieldVariant}`>,\n default: BentoInputFieldVariant.DEFAULT,\n validator: (value: BentoInputFieldVariant) => Object.values(BentoInputFieldVariant).includes(value),\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the Input Field's internal dropdown changes it's value. Contains every dropdown prop passed with the updated selected value as 'value'\n */\n (e: 'update:dropdown', updatedDropdownProps: BentoInputDropdownProps): void;\n\n /**\n * Emitted when the element has lost focus\n */\n (e: 'blur'): void;\n\n /**\n * Emitted when the user modifies the element's value. Unlike the 'input' event, the change event is not necessarily fired for each alteration to an element's value\n */\n (e: 'change'): void;\n\n /**\n * Emitted when the Input Field's internal dropdown changes it's value\n */\n (e: 'dropdown-input', selectedValue: BentoListboxSelectedValue): void;\n\n /**\n * Emitted when the \"ESC\" key is pressed\n */\n (e: 'escape-pressed'): void;\n\n /**\n * Emitted when the element has received focus\n */\n (e: 'focus'): void;\n\n /**\n * Emitted when a key is pressed\n */\n (e: 'keydown', event: KeyboardEvent): void;\n\n /**\n * Emitted when the component's model changes\n */\n (e: 'input', inputValue: string): void;\n }>();\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const hasSlot = useHasSlot(slots);\n const inputFieldElement = ref(null);\n const inputFieldId = generateUid('input');\n const dropdownId = generateUid('input-dropdown');\n const staticValueId = generateUid('input-static-value');\n const descriptionId = generateUid('input-description');\n const errorId = generateUid('input-error');\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const shouldShowStaticValue = computed(\n () => props.variant === BentoInputFieldVariant.STATIC_VALUE && !!slots.staticValue\n );\n\n const isDefaultVariant = computed(() => props.variant === BentoInputFieldVariant.DEFAULT);\n\n const isPaymentMethodVariant = computed(() => props.variant === BentoInputFieldVariant.PAYMENT_METHOD);\n\n const shouldDisplayStaticValueAtStart = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayStaticValueAtEnd = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowDropdown = computed(() => props.variant === BentoInputFieldVariant.DROPDOWN && !!props.dropdown);\n const shouldDisplayDropdownAtStart = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayDropdownAtEnd = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.error)\n );\n\n const computedAriaOwns = computed(() => {\n if (shouldShowDropdown.value === true && shouldShowStaticValue.value === true) {\n return `${staticValueId} ${dropdownId}`;\n }\n if (shouldShowDropdown.value === true) {\n return `${dropdownId}`;\n }\n if (shouldShowStaticValue.value === true) {\n return `${staticValueId}`;\n }\n return 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('ariaLabelFallback'),\n });\n\n const computedAriaDescribedBy = computed(\n () =>\n `${hasSlot('description') ? descriptionId : ''} ${\n shouldShowError.value && !!props.errorMessage ? errorId : ''\n }`\n );\n\n const inputFieldConditionalClasses = computed(() => ({\n [`b-input-field--${BentoInputFieldStateClass.CONDENSED}`]: props.condensed,\n [`b-input-field--${BentoInputFieldStateClass.DISABLED}`]: props.disabled,\n [`b-input-field--${BentoInputFieldStateClass.READONLY}`]: isReadOnly.value,\n [`b-input-field--${BentoInputFieldStateClass.ERROR}`]: shouldShowError.value,\n [`b-input-field--${BentoInputFieldStateClass.SMALL_PADDING_LEFT}`]: shouldDisplayDropdownAtStart.value,\n [`b-input-field--${BentoInputFieldStateClass.SMALL_PADDING_RIGHT}`]: shouldDisplayDropdownAtEnd.value,\n }));\n\n const onInput = (event: Event) => {\n if (!props.disabled && !isReadOnly.value) {\n emit('input', (event.target as HTMLInputElement).value);\n }\n };\n\n const onDropdownInput = (selectedValue: BentoListboxSelectedValue) => {\n emit('dropdown-input', selectedValue);\n emit('update:dropdown', { ...props?.dropdown, value: selectedValue });\n };\n\n const focusInput = () => {\n inputFieldElement.value.focus();\n };\n\n // Expose method so that other components can focus on it in Vue3\n defineExpose({\n focusInput,\n });\n\n if (props.error) {\n deprecate(\n 'BentoInputField \"error\" property',\n `Use the BentoInputField \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-dropdown errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Input field component is used to create interactive controls for web-based\n * forms in order to accept data from the user.\n *\n * @example\n * import { BentoInputField } from '@adyen/bento-vue2'\n *\n * const inputValue = ref('');\n *\n * export default {\n * components: { BentoInputField },\n * tempate: `\n * <bento-input-field\n * :value=\"inputValue\"\n * :input=\"newValue => inputValue.value = newValue\"\n * >\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-field.scss\" />\n"],"names":["BentoInputFieldVariant","BentoInputFieldVariant2","BentoInputFieldElementPosition","BentoInputFieldElementPosition2","BentoInputFieldStateClass","BentoInputFieldStateClass2","BentoInputFieldType","BentoInputFieldType2","BentoInputFieldEvent","BentoInputFieldEvent2","__default__","messages","attrs","useAttrs","slots","useSlots","t","useI18n","hasSlot","useHasSlot","inputFieldElement","ref","inputFieldId","generateUid","dropdownId","staticValueId","descriptionId","errorId","isReadOnly","useFormLayoutFieldLoading","toRef","props","shouldShowStaticValue","computed","isDefaultVariant","isPaymentMethodVariant","shouldDisplayStaticValueAtStart","shouldDisplayStaticValueAtEnd","shouldShowDropdown","shouldDisplayDropdownAtStart","shouldDisplayDropdownAtEnd","shouldShowError","computedAriaOwns","ariaLabelAttribute","ariaLabel","toRefs","computedAriaLabel","useAriaLabel","getSlotText","computedAriaDescribedBy","inputFieldConditionalClasses","onInput","event","emit","onDropdownInput","selectedValue","focusInput","expose","deprecate"],"mappings":";;;;;;;;;;;;AAKY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,iBAAA,kBACAA,EAAA,eAAA,gBACAA,EAAA,WAAA,YAJQA,IAAAD,KAAA,CAAA,CAAA,GAUAE,IAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,MAAA,OAFQA,IAAAD,KAAA,CAAA,CAAA,GAKAE,IAAA,kBAAAC,OACRA,EAAA,YAAA,aACAA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SACAA,EAAA,qBAAA,sBACAA,EAAA,sBAAA,uBANQA,IAAAD,KAAA,CAAA,CAAA,GAYAE,IAAA,kBAAAC,OACRA,EAAA,SAAA,UACAA,EAAA,OAAA,QACAA,EAAA,SAAA,UAHQA,IAAAD,KAAA,CAAA,CAAA,GAmBAE,KAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,iBAAA,kBACAA,EAAA,kBAAA,mBACAA,EAAA,iBAAA,kBACAA,EAAA,QAAA,SACAA,EAAA,SAAA,UACAA,EAAA,OAAA,QACAA,EAAA,UAAA,WARQA,IAAAD,MAAA,CAAA,CA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AA,CAAA;AAAA,IAAoE,GAGxEC,IAAA,MAAA;AACI,MAAApC,EAAA,MAAA,MAAA;AAAA,IAA8B;AAIlC,WAAAqC,EAAA;AAAA,MAAa,YAAAD;AAAA,IACT,CAAA,GAGJzB,EAAA,SACI2B;AAAA,MAAA;AAAA,MACI;AAAA;AAAA;AAAA,MACA;AAAA,IAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/internal.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { B as
|
|
2
|
-
import { C as s, a as p, b as x } from "./chunks/calendar.
|
|
3
|
-
import { C as f } from "./chunks/copy.
|
|
4
|
-
import { C
|
|
5
|
-
import { E as d } from "./chunks/
|
|
6
|
-
import { F as y } from "./chunks/fixed-scroller.
|
|
7
|
-
import { G as
|
|
8
|
-
import { B as u } from "./chunks/listbox.
|
|
1
|
+
import { B as o, L as e } from "./chunks/listbox-option-tag.5b00c85f.js";
|
|
2
|
+
import { C as s, a as p, b as x } from "./chunks/calendar.d4ab387d.js";
|
|
3
|
+
import { C as f } from "./chunks/copy.28bd4298.js";
|
|
4
|
+
import { C } from "./chunks/controls-group.807b5fb0.js";
|
|
5
|
+
import { E as m, F as d } from "./chunks/field-label.61679178.js";
|
|
6
|
+
import { F as y } from "./chunks/fixed-scroller.92bb77a6.js";
|
|
7
|
+
import { G as b, a as B } from "./chunks/grid-layout.c2fe3057.js";
|
|
8
|
+
import { B as u } from "./chunks/listbox.d07c24e6.js";
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
o as BentoAvatar,
|
|
11
11
|
u as BentoListbox,
|
|
12
12
|
s as Calendar,
|
|
13
13
|
p as CalendarEvent,
|
|
14
14
|
x as CalendarFirstDayOfWeek,
|
|
15
|
-
|
|
15
|
+
C as ControlsGroup,
|
|
16
16
|
f as Copy,
|
|
17
|
-
|
|
17
|
+
m as ErrorMessage,
|
|
18
|
+
d as FieldLabel,
|
|
18
19
|
y as FixedScroller,
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
b as GridLayout,
|
|
21
|
+
B as GridLayoutContainerType,
|
|
21
22
|
e as ListboxOptionTag
|
|
22
23
|
};
|
|
23
24
|
//# sourceMappingURL=internal.js.map
|
package/dist/link.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as g, computed as b, useAttrs as h, openBlock as a, createElementBlock as v, mergeProps as y, unref as e, createBlock as n, withCtx as i, renderSlot as r } from "vue";
|
|
2
2
|
import { RouterLink as T } from "vue-router";
|
|
3
|
-
import { B as k } from "./chunks/index.
|
|
3
|
+
import { B as k } from "./chunks/index.75f3672e.js";
|
|
4
4
|
import { _ as B } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
5
|
-
import "./assets/
|
|
5
|
+
import "./assets/index32.css";
|
|
6
6
|
var l = /* @__PURE__ */ ((t) => (t.DEFAULT = "default", t.QUIET = "quiet", t))(l || {});
|
|
7
7
|
const E = ["href", "title", "target"], U = {
|
|
8
8
|
name: "bento-link",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as t, onMounted as i, onUnmounted as l, computed as s, openBlock as d, createElementBlock as r, normalizeClass as c } from "vue";
|
|
2
2
|
import { _ } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
3
|
-
import "./assets/
|
|
3
|
+
import "./assets/index30.css";
|
|
4
4
|
var e = /* @__PURE__ */ ((a) => (a.START = "loading-start", a.END = "loading-end", a))(e || {});
|
|
5
5
|
const p = t({
|
|
6
6
|
name: "bento-loading-indicator",
|
package/dist/menu.js
CHANGED