@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/textarea.js
CHANGED
|
@@ -1,52 +1,51 @@
|
|
|
1
|
-
import { openBlock as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { openBlock as s, createElementBlock as y, mergeProps as se, toDisplayString as N, createCommentVNode as d, pushScopeId as ie, popScopeId as ne, createElementVNode as k, defineComponent as ce, useAttrs as ue, toRefs as P, ref as f, toRef as de, computed as o, watch as R, nextTick as be, onMounted as fe, normalizeClass as m, unref as t, normalizeStyle as D, createBlock as p, withCtx as g, createTextVNode as T, createVNode as $, withKeys as I } from "vue";
|
|
2
|
+
import { a as pe } from "./chunks/button.82ed953e.js";
|
|
3
|
+
import { B } from "./chunks/index.75f3672e.js";
|
|
4
|
+
import { _ as V } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
4
5
|
import { g as ve } from "./chunks/unique-id.a2a2b458.js";
|
|
5
|
-
import { o as
|
|
6
|
-
import { u as me } from "./chunks/
|
|
7
|
-
import { u as
|
|
8
|
-
import { u as
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
let T = 0;
|
|
14
|
-
const ye = {
|
|
6
|
+
import { o as he } from "./chunks/resize.a041304d.js";
|
|
7
|
+
import { u as me } from "./chunks/aria-label.ac9651a5.js";
|
|
8
|
+
import { u as ge } from "./chunks/i18n.6c402773.js";
|
|
9
|
+
import { u as ye } from "./chunks/use-form-layout-loading.d03e5d48.js";
|
|
10
|
+
import { F as _e, E as U } from "./chunks/field-label.61679178.js";
|
|
11
|
+
import "./assets/index23.css";
|
|
12
|
+
let K = 0;
|
|
13
|
+
const Le = {
|
|
15
14
|
beforeCreate() {
|
|
16
|
-
this.uuid =
|
|
15
|
+
this.uuid = K.toString(), K += 1;
|
|
17
16
|
}
|
|
18
|
-
},
|
|
17
|
+
}, xe = (e) => (ie("data-v-3c9e4cfb"), e = e(), ne(), e), Ce = { key: 0 }, Ee = /* @__PURE__ */ xe(() => /* @__PURE__ */ k("path", {
|
|
19
18
|
fill: "#00112C",
|
|
20
19
|
"fill-rule": "evenodd",
|
|
21
20
|
d: "M2.25 8C2.25 4.82436 4.82436 2.25 8 2.25C11.1756 2.25 13.75 4.82436 13.75 8C13.75 11.1756 11.1756 13.75 8 13.75C4.82436 13.75 2.25 11.1756 2.25 8ZM5.46967 5.46967C5.17678 5.76256 5.17678 6.23744 5.46967 6.53033L6.93934 8L5.46967 9.46967C5.17678 9.76256 5.17678 10.2374 5.46967 10.5303C5.76256 10.8232 6.23744 10.8232 6.53033 10.5303L8 9.06066L9.46967 10.5303C9.76256 10.8232 10.2374 10.8232 10.5303 10.5303C10.8232 10.2374 10.8232 9.76256 10.5303 9.46967L9.06066 8L10.5303 6.53033C10.8232 6.23744 10.8232 5.76256 10.5303 5.46967C10.2374 5.17678 9.76256 5.17678 9.46967 5.46967L8 6.93934L6.53033 5.46967C6.23744 5.17678 5.76256 5.17678 5.46967 5.46967Z",
|
|
22
21
|
"clip-rule": "evenodd"
|
|
23
22
|
}, null, -1));
|
|
24
|
-
function
|
|
25
|
-
return
|
|
23
|
+
function Se(e, i, a, O, c, _) {
|
|
24
|
+
return s(), y("svg", se({ role: "img" }, e.$attrs, {
|
|
26
25
|
xmlns: "http://www.w3.org/2000/svg",
|
|
27
26
|
width: "16",
|
|
28
27
|
height: "16",
|
|
29
28
|
fill: "none"
|
|
30
29
|
}), [
|
|
31
|
-
e.$attrs["svg-title"] ? (
|
|
32
|
-
|
|
30
|
+
e.$attrs["svg-title"] ? (s(), y("title", Ce, N(e.$attrs["svg-title"]), 1)) : d("", !0),
|
|
31
|
+
Ee
|
|
33
32
|
], 16);
|
|
34
33
|
}
|
|
35
|
-
const
|
|
34
|
+
const Ae = /* @__PURE__ */ V(Le, [["render", Se], ["__scopeId", "data-v-3c9e4cfb"]]);
|
|
35
|
+
var w = /* @__PURE__ */ ((e) => (e.HORIZONTAL = "horizontal", e.VERTICAL = "vertical", e.BOTH = "both", e.NONE = "none", e))(w || {}), b = /* @__PURE__ */ ((e) => (e.CLEARABLE = "clearable", e.DISABLED = "disabled", e.ERROR = "error", e.READONLY = "readonly", e))(b || {}), n = /* @__PURE__ */ ((e) => (e.BLUR = "blur", e.CHANGE = "change", e.CLEAR = "clear", e.ESCAPE_PRESSED = "escape-pressed", e.FOCUS = "focus", e.INPUT = "input", e))(n || {});
|
|
36
|
+
const W = {
|
|
36
37
|
"en-US": {
|
|
37
38
|
clearText: "Clear text",
|
|
38
|
-
optional: "optional",
|
|
39
|
-
required: "required",
|
|
40
39
|
textarea: "textarea",
|
|
41
40
|
yourTextCanBenAtMost: "Your text can be at most {characterLimit} characters"
|
|
42
41
|
}
|
|
43
|
-
},
|
|
42
|
+
}, Re = ["id", "value", "aria-label", "aria-invalid", "readonly", "disabled", "placeholder", "onKeydown"], $e = {
|
|
44
43
|
key: 0,
|
|
45
44
|
class: "b-textarea__clear-button"
|
|
46
45
|
}, Ie = {
|
|
47
|
-
i18n: { messages:
|
|
46
|
+
i18n: { messages: W },
|
|
48
47
|
name: "bento-textarea"
|
|
49
|
-
},
|
|
48
|
+
}, Be = /* @__PURE__ */ ce({
|
|
50
49
|
...Ie,
|
|
51
50
|
props: {
|
|
52
51
|
/**
|
|
@@ -98,200 +97,177 @@ const Se = /* @__PURE__ */ q(ye, [["render", Ee], ["__scopeId", "data-v-3c9e4cfb
|
|
|
98
97
|
*/
|
|
99
98
|
resizable: {
|
|
100
99
|
type: String,
|
|
101
|
-
default:
|
|
102
|
-
validator: (e) => Object.values(
|
|
100
|
+
default: w.BOTH,
|
|
101
|
+
validator: (e) => Object.values(w).includes(e)
|
|
103
102
|
},
|
|
104
103
|
/**
|
|
105
104
|
* Highlights the textarea is required.
|
|
106
105
|
*/
|
|
107
106
|
required: { type: Boolean, default: !1 },
|
|
107
|
+
/**
|
|
108
|
+
* Adds a info icon next to the label to display the passed tooltip message.
|
|
109
|
+
*/
|
|
110
|
+
tooltipText: { type: String, default: null },
|
|
108
111
|
/**
|
|
109
112
|
* Text displayed as the value of the textarea
|
|
110
113
|
*/
|
|
111
114
|
value: { type: String, default: "" }
|
|
112
115
|
},
|
|
113
|
-
setup(e, { emit:
|
|
114
|
-
const
|
|
115
|
-
() =>
|
|
116
|
-
),
|
|
117
|
-
|
|
116
|
+
setup(e, { emit: i }) {
|
|
117
|
+
const a = e, O = ue(), { height: c } = P(a), _ = ve("textarea"), l = f(null), r = f(a.value), L = 44, v = f(a.height || `${L}px`), F = f("100%"), { t: H } = ge({ messages: W }), { isReadOnly: h } = ye(de(a, "readonly")), q = o(() => `${r.value.length} / ${a.characterLimit}`), x = o(
|
|
118
|
+
() => a.characterLimit && r.value.length > a.characterLimit
|
|
119
|
+
), C = () => {
|
|
120
|
+
l.value && l.value.scrollHeight > L && (v.value = `${l.value.scrollHeight + 3}px`);
|
|
118
121
|
};
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}),
|
|
122
|
-
() =>
|
|
122
|
+
R(c, () => {
|
|
123
|
+
c.value ? v.value = c.value : C();
|
|
124
|
+
}), R(
|
|
125
|
+
() => a.value,
|
|
123
126
|
() => {
|
|
124
|
-
|
|
127
|
+
r.value = a.value;
|
|
125
128
|
},
|
|
126
129
|
{ immediate: !0 }
|
|
127
|
-
),
|
|
128
|
-
() =>
|
|
130
|
+
), R(
|
|
131
|
+
() => r.value,
|
|
129
132
|
async () => {
|
|
130
|
-
if (!
|
|
131
|
-
if (
|
|
133
|
+
if (!c.value) {
|
|
134
|
+
if (v.value = `${L}px`, !r.value)
|
|
132
135
|
return;
|
|
133
|
-
await be(),
|
|
136
|
+
await be(), C();
|
|
134
137
|
}
|
|
135
138
|
},
|
|
136
139
|
{ immediate: !0 }
|
|
137
140
|
);
|
|
138
|
-
const
|
|
139
|
-
[`b-textarea--${
|
|
140
|
-
})), Y =
|
|
141
|
-
[`b-textarea__input--${
|
|
142
|
-
[`b-textarea__input--${
|
|
143
|
-
[`b-textarea__input--${
|
|
144
|
-
["b-textarea__input--dynamic-height"]: !
|
|
145
|
-
})), Z =
|
|
146
|
-
["b-textarea__label-box--no-label"]: !
|
|
147
|
-
})), G =
|
|
148
|
-
[`b-textarea__label-item--${
|
|
149
|
-
})), j =
|
|
141
|
+
const M = o(() => !!a.errorMessage || x.value), z = o(() => ({
|
|
142
|
+
[`b-textarea--${b.DISABLED}`]: a.disabled
|
|
143
|
+
})), Y = o(() => ({
|
|
144
|
+
[`b-textarea__input--${b.CLEARABLE}`]: a.clearable,
|
|
145
|
+
[`b-textarea__input--${b.READONLY}`]: h.value,
|
|
146
|
+
[`b-textarea__input--${b.ERROR}`]: M.value,
|
|
147
|
+
["b-textarea__input--dynamic-height"]: !c.value
|
|
148
|
+
})), Z = o(() => ({
|
|
149
|
+
["b-textarea__label-box--no-label"]: !a.label
|
|
150
|
+
})), G = o(() => ({
|
|
151
|
+
[`b-textarea__label-item--${b.ERROR}`]: x.value
|
|
152
|
+
})), j = o(() => H("yourTextCanBenAtMost", { characterLimit: a.characterLimit })), J = f(O["aria-label"]), { ariaLabel: Q, label: E } = P(a), X = me({
|
|
150
153
|
ariaLabel: J.value,
|
|
151
154
|
// TODO: take this line away when the aria-label props is removed
|
|
152
155
|
label: Q,
|
|
153
|
-
defaultFallback:
|
|
154
|
-
}), ee =
|
|
155
|
-
() =>
|
|
156
|
-
),
|
|
157
|
-
|
|
158
|
-
},
|
|
159
|
-
|
|
160
|
-
},
|
|
161
|
-
|
|
156
|
+
defaultFallback: E
|
|
157
|
+
}), ee = o(
|
|
158
|
+
() => a.clearable && r.value && !a.disabled && !h.value
|
|
159
|
+
), S = () => {
|
|
160
|
+
r.value = "", i(n.CLEAR), i(n.INPUT, "");
|
|
161
|
+
}, te = (u) => {
|
|
162
|
+
u.stopImmediatePropagation(), !a.disabled && !h.value && (r.value = u.target.value, i(n.INPUT, r.value));
|
|
163
|
+
}, ae = () => {
|
|
164
|
+
l.value.scrollTop = 0, i(n.BLUR);
|
|
162
165
|
}, le = () => {
|
|
163
|
-
|
|
166
|
+
l.value.focus(), i(n.FOCUS);
|
|
164
167
|
}, re = () => {
|
|
165
|
-
n
|
|
168
|
+
i(n.CHANGE);
|
|
166
169
|
}, oe = () => {
|
|
167
|
-
n
|
|
170
|
+
i(n.ESCAPE_PRESSED);
|
|
168
171
|
};
|
|
169
172
|
return fe(() => {
|
|
170
|
-
|
|
171
|
-
var
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
}),
|
|
175
|
-
}), (
|
|
176
|
-
class:
|
|
177
|
-
style:
|
|
173
|
+
he(l.value, () => {
|
|
174
|
+
var A;
|
|
175
|
+
const u = (A = l == null ? void 0 : l.value) == null ? void 0 : A.offsetWidth;
|
|
176
|
+
F.value = u ? `${u}px` : "100%";
|
|
177
|
+
}), c.value || C();
|
|
178
|
+
}), (u, A) => (s(), y("div", {
|
|
179
|
+
class: m(["b-textarea", t(z)]),
|
|
180
|
+
style: D({ width: F.value })
|
|
178
181
|
}, [
|
|
179
|
-
|
|
180
|
-
class:
|
|
182
|
+
k("div", {
|
|
183
|
+
class: m(["b-textarea__label-box", t(Z)])
|
|
181
184
|
}, [
|
|
182
|
-
|
|
185
|
+
t(E) ? (s(), p(t(_e), {
|
|
183
186
|
key: 0,
|
|
184
|
-
for:
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
default: b(() => [
|
|
192
|
-
h(v(a(I)), 1)
|
|
193
|
-
]),
|
|
194
|
-
_: 1
|
|
195
|
-
}),
|
|
196
|
-
e.optional && !e.required ? (l(), f(a(p), {
|
|
197
|
-
key: 0,
|
|
198
|
-
el: "span",
|
|
199
|
-
class: "b-textarea__label-item"
|
|
200
|
-
}, {
|
|
201
|
-
default: b(() => [
|
|
202
|
-
h(" (" + v(a(L)("optional")) + ") ", 1)
|
|
203
|
-
]),
|
|
204
|
-
_: 1
|
|
205
|
-
})) : i("", !0),
|
|
206
|
-
e.required ? (l(), f(a(p), {
|
|
207
|
-
key: 1,
|
|
208
|
-
el: "span",
|
|
209
|
-
class: "b-textarea__label-item"
|
|
210
|
-
}, {
|
|
211
|
-
default: b(() => [
|
|
212
|
-
h(" (" + v(a(L)("required")) + ") ", 1)
|
|
213
|
-
]),
|
|
214
|
-
_: 1
|
|
215
|
-
})) : i("", !0)
|
|
216
|
-
], 8, Ae)) : i("", !0),
|
|
217
|
-
e.characterLimit ? (l(), f(a(p), {
|
|
187
|
+
for: t(_),
|
|
188
|
+
label: t(E),
|
|
189
|
+
"tooltip-text": e.tooltipText,
|
|
190
|
+
optional: e.optional,
|
|
191
|
+
required: e.required
|
|
192
|
+
}, null, 8, ["for", "label", "tooltip-text", "optional", "required"])) : d("", !0),
|
|
193
|
+
e.characterLimit ? (s(), p(t(B), {
|
|
218
194
|
key: 1,
|
|
219
195
|
el: "span",
|
|
220
|
-
class:
|
|
196
|
+
class: m(["b-textarea__label-item", t(G)])
|
|
221
197
|
}, {
|
|
222
|
-
default:
|
|
223
|
-
|
|
198
|
+
default: g(() => [
|
|
199
|
+
T(N(t(q)), 1)
|
|
224
200
|
]),
|
|
225
201
|
_: 1
|
|
226
|
-
}, 8, ["class"])) :
|
|
202
|
+
}, 8, ["class"])) : d("", !0)
|
|
227
203
|
], 2),
|
|
228
|
-
|
|
204
|
+
$(t(B), {
|
|
229
205
|
el: "div",
|
|
230
206
|
class: "b-textarea__input-box",
|
|
231
207
|
"aria-disabled": e.disabled
|
|
232
208
|
}, {
|
|
233
|
-
default:
|
|
234
|
-
|
|
235
|
-
id:
|
|
209
|
+
default: g(() => [
|
|
210
|
+
k("textarea", {
|
|
211
|
+
id: t(_),
|
|
236
212
|
ref_key: "textareaElement",
|
|
237
|
-
ref:
|
|
238
|
-
value:
|
|
239
|
-
class:
|
|
240
|
-
"aria-label":
|
|
241
|
-
"aria-invalid":
|
|
242
|
-
readonly:
|
|
213
|
+
ref: l,
|
|
214
|
+
value: r.value,
|
|
215
|
+
class: m(["b-textarea__input", t(Y)]),
|
|
216
|
+
"aria-label": t(X),
|
|
217
|
+
"aria-invalid": t(M),
|
|
218
|
+
readonly: t(h),
|
|
243
219
|
disabled: e.disabled,
|
|
244
220
|
placeholder: e.placeholder,
|
|
245
|
-
style:
|
|
246
|
-
onBlur:
|
|
221
|
+
style: D({ resize: e.resizable, height: v.value }),
|
|
222
|
+
onBlur: ae,
|
|
247
223
|
onChange: re,
|
|
248
224
|
onFocus: le,
|
|
249
|
-
onInput:
|
|
250
|
-
onKeydown:
|
|
225
|
+
onInput: te,
|
|
226
|
+
onKeydown: I(oe, ["esc"])
|
|
251
227
|
}, `
|
|
252
228
|
`, 46, Re),
|
|
253
|
-
|
|
254
|
-
|
|
229
|
+
t(ee) ? (s(), y("div", $e, [
|
|
230
|
+
$(t(pe), {
|
|
255
231
|
variant: "tertiary",
|
|
256
232
|
disabled: e.disabled,
|
|
257
|
-
onClick:
|
|
258
|
-
onKeypress:
|
|
259
|
-
onKeyup:
|
|
233
|
+
onClick: S,
|
|
234
|
+
onKeypress: I(S, ["enter"]),
|
|
235
|
+
onKeyup: I(S, ["space"])
|
|
260
236
|
}, {
|
|
261
|
-
iconLeft:
|
|
262
|
-
|
|
263
|
-
"svg-title":
|
|
237
|
+
iconLeft: g(() => [
|
|
238
|
+
$(t(Ae), {
|
|
239
|
+
"svg-title": t(H)("clearText")
|
|
264
240
|
}, null, 8, ["svg-title"])
|
|
265
241
|
]),
|
|
266
242
|
_: 1
|
|
267
243
|
}, 8, ["disabled", "onKeypress", "onKeyup"])
|
|
268
|
-
])) :
|
|
244
|
+
])) : d("", !0)
|
|
269
245
|
]),
|
|
270
246
|
_: 1
|
|
271
247
|
}, 8, ["aria-disabled"]),
|
|
272
|
-
|
|
248
|
+
t(x) ? (s(), p(t(U), {
|
|
273
249
|
key: 0,
|
|
274
|
-
"error-message":
|
|
275
|
-
}, null, 8, ["error-message"])) :
|
|
276
|
-
e.errorMessage ? (
|
|
250
|
+
"error-message": t(j)
|
|
251
|
+
}, null, 8, ["error-message"])) : d("", !0),
|
|
252
|
+
e.errorMessage ? (s(), p(t(U), {
|
|
277
253
|
key: 1,
|
|
278
254
|
"error-message": e.errorMessage
|
|
279
|
-
}, null, 8, ["error-message"])) :
|
|
280
|
-
e.description ? (
|
|
255
|
+
}, null, 8, ["error-message"])) : d("", !0),
|
|
256
|
+
e.description ? (s(), p(t(B), {
|
|
281
257
|
key: 2,
|
|
282
258
|
class: "b-textarea__description",
|
|
283
259
|
el: "span"
|
|
284
260
|
}, {
|
|
285
|
-
default:
|
|
286
|
-
|
|
261
|
+
default: g(() => [
|
|
262
|
+
T(N(e.description), 1)
|
|
287
263
|
]),
|
|
288
264
|
_: 1
|
|
289
|
-
})) :
|
|
265
|
+
})) : d("", !0)
|
|
290
266
|
], 6));
|
|
291
267
|
}
|
|
292
268
|
});
|
|
293
|
-
const
|
|
269
|
+
const Ue = /* @__PURE__ */ V(Be, [["__scopeId", "data-v-b57fd4c1"]]);
|
|
294
270
|
export {
|
|
295
|
-
|
|
271
|
+
Ue as BentoTextarea
|
|
296
272
|
};
|
|
297
273
|
//# sourceMappingURL=textarea.js.map
|
package/dist/textarea.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.js","sources":["../../vue2/src/components/textarea/textarea.types.ts","../../../node_modules/@adyen/ui-assets-icons-16/dist/vue/cross-circle-fill-small.vue","../../vue2/src/components/textarea/textarea.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoTextareaResizeOption {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n BOTH = 'both',\n NONE = 'none',\n}\n\nexport enum BentoTextareaStateClass {\n CLEARABLE = 'clearable',\n DISABLED = 'disabled',\n ERROR = 'error',\n READONLY = 'readonly',\n}\n\nexport enum BentoTextareaEvent {\n BLUR = 'blur',\n CHANGE = 'change',\n CLEAR = 'clear',\n ESCAPE_PRESSED = 'escape-pressed',\n FOCUS = 'focus',\n INPUT = 'input',\n}\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#00112C\" fill-rule=\"evenodd\" d=\"M2.25 8C2.25 4.82436 4.82436 2.25 8 2.25C11.1756 2.25 13.75 4.82436 13.75 8C13.75 11.1756 11.1756 13.75 8 13.75C4.82436 13.75 2.25 11.1756 2.25 8ZM5.46967 5.46967C5.17678 5.76256 5.17678 6.23744 5.46967 6.53033L6.93934 8L5.46967 9.46967C5.17678 9.76256 5.17678 10.2374 5.46967 10.5303C5.76256 10.8232 6.23744 10.8232 6.53033 10.5303L8 9.06066L9.46967 10.5303C9.76256 10.8232 10.2374 10.8232 10.5303 10.5303C10.8232 10.2374 10.8232 9.76256 10.5303 9.46967L9.06066 8L10.5303 6.53033C10.8232 6.23744 10.8232 5.76256 10.5303 5.46967C10.2374 5.17678 9.76256 5.17678 9.46967 5.46967L8 6.93934L6.53033 5.46967C6.23744 5.17678 5.76256 5.17678 5.46967 5.46967Z\" clip-rule=\"evenodd\"/></svg>\n</template>\n<script>\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n<style scoped lang=\"scss\">\n svg {\n display: inline-flex;\n flex-shrink: 0;\n }\n \n svg,\n svg * {\n fill: currentcolor;\n }\n</style>\n","<template>\n <div class=\"b-textarea\" :class=\"conditionalClasses\" :style=\"{ width: textareaWidth }\">\n <div class=\"b-textarea__label-box\" :class=\"conditionalClassesLabelBox\">\n <label v-if=\"label\" :for=\"textareaId\" class=\"b-textarea__label\">\n <bento-typography el=\"span\" stronger>{{ label }}</bento-typography>\n <bento-typography v-if=\"optional && !required\" el=\"span\" class=\"b-textarea__label-item\">\n ({{ t('optional') }})\n </bento-typography>\n <bento-typography v-if=\"required\" el=\"span\" class=\"b-textarea__label-item\">\n ({{ t('required') }})\n </bento-typography>\n </label>\n <bento-typography\n v-if=\"characterLimit\"\n el=\"span\"\n class=\"b-textarea__label-item\"\n :class=\"conditionalClassesLabelItem\"\n >\n {{ counter }}\n </bento-typography>\n </div>\n <bento-typography el=\"div\" class=\"b-textarea__input-box\" :aria-disabled=\"disabled\">\n <textarea\n :id=\"textareaId\"\n ref=\"textareaElement\"\n :value=\"textareaValue\"\n class=\"b-textarea__input\"\n :class=\"conditionalClassesInput\"\n :aria-label=\"computedAriaLabel\"\n :aria-invalid=\"invalidInput\"\n :readonly=\"isReadOnly\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n :style=\"{ resize: resizable, height: textareaHeight }\"\n @blur=\"onBlur\"\n @change=\"onChange\"\n @focus=\"onFocus\"\n @input=\"onInput\"\n @keydown.esc=\"onPressEscape\"\n >\n </textarea>\n\n <div v-if=\"showClearButton\" class=\"b-textarea__clear-button\">\n <bento-button\n variant=\"tertiary\"\n :disabled=\"disabled\"\n @click=\"onClear\"\n @keypress.enter=\"onClear\"\n @keyup.space=\"onClear\"\n >\n <template #iconLeft>\n <cross-circle-fill-small-icon :svg-title=\"t('clearText')\" />\n </template>\n </bento-button>\n </div>\n </bento-typography>\n\n <error-message v-if=\"isOverCharacterLimit\" :error-message=\"counterErrorText\" />\n\n <error-message v-if=\"errorMessage\" :error-message=\"errorMessage\" />\n\n <bento-typography v-if=\"description\" class=\"b-textarea__description\" el=\"span\">\n {{ description }}\n </bento-typography>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, onMounted, PropType, ref, toRef, toRefs, useAttrs, watch } from 'vue';\n import { BentoTextareaEvent, BentoTextareaResizeOption, BentoTextareaStateClass } from './textarea.types';\n import { BentoTypography } from '@/components/typography';\n import { BentoButton } from '@/components/button';\n import { ErrorMessage } from '@/components/internal';\n import { generateUid } from '@/utils/ts/unique-id';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import { useI18n } from '@/utils/ts/i18n';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n import CrossCircleFillSmallIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill-small';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n\n const props = defineProps({\n /**\n * Text that labels an the input element\n */\n ariaLabel: { type: String, default: undefined },\n\n /**\n * Text that shows number of characters in textarea\n */\n characterLimit: { type: Number, default: undefined },\n\n /**\n * Text displayed as the help text of the textarea\n */\n description: { type: String, default: '' },\n\n /**\n * Disables the possibility of changing value in the textarea\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * If set to true, shows a button to clear all the text\n */\n clearable: { type: Boolean, default: false },\n\n /**\n * Adds error text\n */\n errorMessage: { type: String, default: '' },\n\n /**\n * Sets the height of the textarea, e.g 200px OR 20vh\n */\n height: { type: String, default: null },\n\n /**\n * Text displayed as the label of the textarea\n */\n label: { type: String, default: '' },\n\n /**\n * Highlights the textarea is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Text displayed as the placeholder of the textarea\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Set the textarea to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Indicates the possibility of resize the textarea\n */\n resizable: {\n type: String as PropType<BentoTextareaResizeOption | `${BentoTextareaResizeOption}`>,\n default: BentoTextareaResizeOption.BOTH,\n validator: (value: BentoTextareaResizeOption) => Object.values(BentoTextareaResizeOption).includes(value),\n },\n\n /**\n * Highlights the textarea is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Text displayed as the value of the textarea\n */\n value: { type: String, default: '' },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the element has lost focus\n */\n (e: BentoTextareaEvent.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: BentoTextareaEvent.CHANGE): void;\n\n /**\n * Emitted when the \"Clear\" button was clicked\n */\n (e: BentoTextareaEvent.CLEAR): void;\n\n /**\n * Emitted when the \"ESC\" key is pressed\n */\n (e: BentoTextareaEvent.ESCAPE_PRESSED): void;\n\n /**\n * Emitted when the element has received focus\n */\n (e: BentoTextareaEvent.FOCUS): void;\n\n /**\n * Emitted when the component's model changes\n */\n (e: BentoTextareaEvent.INPUT, value: string): void;\n }>();\n\n const { height } = toRefs(props);\n\n const textareaId = generateUid('textarea');\n const textareaElement = ref<HTMLTextAreaElement>(null);\n const textareaValue = ref(props.value);\n const defaultTextareaHeight = 44;\n const textareaHeight = ref(props.height || `${defaultTextareaHeight}px`);\n const textareaWidth = ref('100%');\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const counter = computed(() => `${textareaValue.value.length} / ${props.characterLimit}`);\n const isOverCharacterLimit = computed(\n () => props.characterLimit && textareaValue.value.length > props.characterLimit\n );\n\n const calculateHeight = () => {\n const borderWidth = 3;\n if (textareaElement.value && textareaElement.value.scrollHeight > defaultTextareaHeight) {\n textareaHeight.value = `${textareaElement.value.scrollHeight + borderWidth}px`;\n }\n };\n\n watch(height, () => {\n if (!height.value) {\n calculateHeight();\n } else {\n textareaHeight.value = height.value;\n }\n });\n\n watch(\n () => props.value,\n () => {\n textareaValue.value = props.value;\n },\n { immediate: true }\n );\n\n watch(\n () => textareaValue.value,\n async () => {\n if (!height.value) {\n // Hack to make the textarea calculate its height properly\n // Set the textarea back to the original value before calculating the height\n textareaHeight.value = `${defaultTextareaHeight}px`;\n if (!textareaValue.value) {\n return;\n }\n\n await nextTick();\n calculateHeight();\n }\n },\n { immediate: true }\n );\n\n const invalidInput = computed(() => !!props.errorMessage || isOverCharacterLimit.value);\n\n const conditionalClasses = computed(() => ({\n [`b-textarea--${BentoTextareaStateClass.DISABLED}`]: props.disabled,\n }));\n\n const conditionalClassesInput = computed(() => ({\n [`b-textarea__input--${BentoTextareaStateClass.CLEARABLE}`]: props.clearable,\n [`b-textarea__input--${BentoTextareaStateClass.READONLY}`]: isReadOnly.value,\n [`b-textarea__input--${BentoTextareaStateClass.ERROR}`]: invalidInput.value,\n [`b-textarea__input--dynamic-height`]: !height.value,\n }));\n\n const conditionalClassesLabelBox = computed(() => ({\n [`b-textarea__label-box--no-label`]: !props.label,\n }));\n\n const conditionalClassesLabelItem = computed(() => ({\n [`b-textarea__label-item--${BentoTextareaStateClass.ERROR}`]: isOverCharacterLimit.value,\n }));\n\n const counterErrorText = computed(() => t('yourTextCanBenAtMost', { characterLimit: props.characterLimit }));\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel, label } = 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: label,\n });\n\n const showClearButton = computed(\n () => props.clearable && textareaValue.value && !props.disabled && !isReadOnly.value\n );\n\n const onClear = () => {\n textareaValue.value = '';\n emit(BentoTextareaEvent.CLEAR);\n emit(BentoTextareaEvent.INPUT, '');\n };\n\n const onInput = (event: InputEvent) => {\n event.stopImmediatePropagation();\n\n if (!props.disabled && !isReadOnly.value) {\n textareaValue.value = (event.target as HTMLInputElement).value;\n /**\n * Triggered when input value is changed\n *\n * @event input\n * @property {String} inputValue - the updated textarea value\n */\n emit(BentoTextareaEvent.INPUT, textareaValue.value);\n }\n };\n\n const onBlur = () => {\n textareaElement.value.scrollTop = 0;\n emit(BentoTextareaEvent.BLUR);\n };\n\n const onFocus = () => {\n textareaElement.value.focus();\n emit(BentoTextareaEvent.FOCUS);\n };\n\n const onChange = () => {\n emit(BentoTextareaEvent.CHANGE);\n };\n\n const onPressEscape = () => {\n emit(BentoTextareaEvent.ESCAPE_PRESSED);\n };\n\n onMounted(() => {\n observeSizeOfElement(textareaElement.value, () => {\n const offsetWidth = textareaElement?.value?.offsetWidth;\n textareaWidth.value = offsetWidth ? `${offsetWidth}px` : '100%';\n });\n\n if (!height.value) {\n calculateHeight();\n }\n });\n</script>\n\n<script lang=\"ts\">\n export default {\n i18n: { messages },\n name: 'bento-textarea',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./textarea.scss\" />\n"],"names":["BentoTextareaResizeOption","BentoTextareaResizeOption2","BentoTextareaStateClass","BentoTextareaStateClass2","BentoTextareaEvent","BentoTextareaEvent2","uuid","openBlock","createElementBlock","mergeProps","_ctx","_hoisted_1$1","toDisplayString","__default__","messages","attrs","useAttrs","height","toRefs","props","textareaId","generateUid","textareaElement","ref","textareaValue","defaultTextareaHeight","textareaHeight","textareaWidth","t","useI18n","isReadOnly","useFormLayoutFieldLoading","toRef","counter","computed","isOverCharacterLimit","calculateHeight","watch","nextTick","invalidInput","conditionalClasses","conditionalClassesInput","conditionalClassesLabelBox","conditionalClassesLabelItem","counterErrorText","ariaLabelAttribute","ariaLabel","label","computedAriaLabel","useAriaLabel","showClearButton","onClear","emit","onInput","event","onBlur","onFocus","onChange","onPressEscape","onMounted","observeSizeOfElement","offsetWidth","_a"],"mappings":";;;;;;;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,YACAA,EAAA,OAAA,QACAA,EAAA,OAAA,QAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,YAAA,aACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SACAA,EAAA,WAAA,YAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,SAAA,UACAA,EAAA,QAAA,SACAA,EAAA,iBAAA,kBACAA,EAAA,QAAA,SACAA,EAAA,QAAA,SANQA,IAAAD,KAAA,CAAA,CAAA;ACZR,IAAAE,IAAA;;EAGI,eAAA;8BAEIA,KAAA;AAAA;;EARuK,MAAA;AAAA,EAAe,aAAA;AAAA,EAAoB,GAAA;AAAA,EAAgpB,aAAA;;;AAAl2B,SAAAC,EAAA,GAAAC,EAAA,OAAAC,GAAA,EAAA,MAAA,MAAA,GAAAC,EAAA,QAAA;AAAA,IAAgC,OAAA;AAAA,IAAmC,OAAA;AAAA,IAAW,QAAA;AAAA,IAAY,MAAA;AAAA;6BAAYH,EAAA,GAAAC,EAAA,SAAAG,IAAAC,EAAAF,EAAA,OAAA,WAAA,CAAA,GAAA,CAAA;;;;;;;;;;;;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AAAA,EAAA,yBAAA,GAEA,CAAAnC,EAAA,YAAA,CAAAW,EAAA,UACIN,EAAA,QAAA8B,EAAA,OAAA,OAOAF,EAAAhD,EAAA,OAAAoB,EAAA,KAAA;AAAA,IACJ,GAGJ+B,KAAA,MAAA;AACI,MAAAjC,EAAA,MAAA,YAAA,GACA8B,EAAAhD,EAAA,IAAA;AAAA,IAA4B,GAGhCoD,KAAA,MAAA;AACI,MAAAlC,EAAA,MAAA,MAAA,GACA8B,EAAAhD,EAAA,KAAA;AAAA,IAA6B,GAGjCqD,KAAA,MAAA;AACI,MAAAL,EAAAhD,EAAA,MAAA;AAAA,IAA8B,GAGlCsD,KAAA,MAAA;AACI,MAAAN,EAAAhD,EAAA,cAAA;AAAA,IAAsC;AAG1C,WAAAuD,GAAA,MAAA;AACI,MAAAC,GAAAtC,EAAA,OAAA,MAAA;;AACI,cAAAuC,KAAAC,IAAAxC,KAAA,gBAAAA,EAAA,UAAA,gBAAAwC,EAAA;AACA,QAAAnC,EAAA,QAAAkC,IAAA,GAAAA,QAAA;AAAA,MAAyD,CAAA,GAG7D5C,EAAA,SACImB,EAAA;AAAA,IACJ,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[1]}
|
|
1
|
+
{"version":3,"file":"textarea.js","sources":["../../../node_modules/@adyen/ui-assets-icons-16/dist/vue/cross-circle-fill-small.vue","../../vue2/src/components/textarea/textarea.types.ts","../../vue2/src/components/textarea/textarea.vue"],"sourcesContent":["\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#00112C\" fill-rule=\"evenodd\" d=\"M2.25 8C2.25 4.82436 4.82436 2.25 8 2.25C11.1756 2.25 13.75 4.82436 13.75 8C13.75 11.1756 11.1756 13.75 8 13.75C4.82436 13.75 2.25 11.1756 2.25 8ZM5.46967 5.46967C5.17678 5.76256 5.17678 6.23744 5.46967 6.53033L6.93934 8L5.46967 9.46967C5.17678 9.76256 5.17678 10.2374 5.46967 10.5303C5.76256 10.8232 6.23744 10.8232 6.53033 10.5303L8 9.06066L9.46967 10.5303C9.76256 10.8232 10.2374 10.8232 10.5303 10.5303C10.8232 10.2374 10.8232 9.76256 10.5303 9.46967L9.06066 8L10.5303 6.53033C10.8232 6.23744 10.8232 5.76256 10.5303 5.46967C10.2374 5.17678 9.76256 5.17678 9.46967 5.46967L8 6.93934L6.53033 5.46967C6.23744 5.17678 5.76256 5.17678 5.46967 5.46967Z\" clip-rule=\"evenodd\"/></svg>\n</template>\n<script>\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n<style scoped lang=\"scss\">\n svg {\n display: inline-flex;\n flex-shrink: 0;\n }\n \n svg,\n svg * {\n fill: currentcolor;\n }\n</style>\n","/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoTextareaResizeOption {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n BOTH = 'both',\n NONE = 'none',\n}\n\nexport enum BentoTextareaStateClass {\n CLEARABLE = 'clearable',\n DISABLED = 'disabled',\n ERROR = 'error',\n READONLY = 'readonly',\n}\n\nexport enum BentoTextareaEvent {\n BLUR = 'blur',\n CHANGE = 'change',\n CLEAR = 'clear',\n ESCAPE_PRESSED = 'escape-pressed',\n FOCUS = 'focus',\n INPUT = 'input',\n}\n","<template>\n <div class=\"b-textarea\" :class=\"conditionalClasses\" :style=\"{ width: textareaWidth }\">\n <div class=\"b-textarea__label-box\" :class=\"conditionalClassesLabelBox\">\n <field-label\n v-if=\"label\"\n :for=\"textareaId\"\n :label=\"label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n />\n <bento-typography\n v-if=\"characterLimit\"\n el=\"span\"\n class=\"b-textarea__label-item\"\n :class=\"conditionalClassesLabelItem\"\n >\n {{ counter }}\n </bento-typography>\n </div>\n <bento-typography el=\"div\" class=\"b-textarea__input-box\" :aria-disabled=\"disabled\">\n <textarea\n :id=\"textareaId\"\n ref=\"textareaElement\"\n :value=\"textareaValue\"\n class=\"b-textarea__input\"\n :class=\"conditionalClassesInput\"\n :aria-label=\"computedAriaLabel\"\n :aria-invalid=\"invalidInput\"\n :readonly=\"isReadOnly\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n :style=\"{ resize: resizable, height: textareaHeight }\"\n @blur=\"onBlur\"\n @change=\"onChange\"\n @focus=\"onFocus\"\n @input=\"onInput\"\n @keydown.esc=\"onPressEscape\"\n >\n </textarea>\n\n <div v-if=\"showClearButton\" class=\"b-textarea__clear-button\">\n <bento-button\n variant=\"tertiary\"\n :disabled=\"disabled\"\n @click=\"onClear\"\n @keypress.enter=\"onClear\"\n @keyup.space=\"onClear\"\n >\n <template #iconLeft>\n <cross-circle-fill-small-icon :svg-title=\"t('clearText')\" />\n </template>\n </bento-button>\n </div>\n </bento-typography>\n\n <error-message v-if=\"isOverCharacterLimit\" :error-message=\"counterErrorText\" />\n\n <error-message v-if=\"errorMessage\" :error-message=\"errorMessage\" />\n\n <bento-typography v-if=\"description\" class=\"b-textarea__description\" el=\"span\">\n {{ description }}\n </bento-typography>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, onMounted, PropType, ref, toRef, toRefs, useAttrs, watch } from 'vue';\n\n // Components\n import { BentoButton } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage, FieldLabel } from '@/internal';\n import CrossCircleFillSmallIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill-small';\n\n // Utils\n import { generateUid } from '@/utils/ts/unique-id';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useI18n } from '@/utils/ts/i18n';\n\n // Composables\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n // Types\n import { BentoTextareaEvent, BentoTextareaResizeOption, BentoTextareaStateClass } from './textarea.types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n\n const props = defineProps({\n /**\n * Text that labels an the input element\n */\n ariaLabel: { type: String, default: undefined },\n\n /**\n * Text that shows number of characters in textarea\n */\n characterLimit: { type: Number, default: undefined },\n\n /**\n * Text displayed as the help text of the textarea\n */\n description: { type: String, default: '' },\n\n /**\n * Disables the possibility of changing value in the textarea\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * If set to true, shows a button to clear all the text\n */\n clearable: { type: Boolean, default: false },\n\n /**\n * Adds error text\n */\n errorMessage: { type: String, default: '' },\n\n /**\n * Sets the height of the textarea, e.g 200px OR 20vh\n */\n height: { type: String, default: null },\n\n /**\n * Text displayed as the label of the textarea\n */\n label: { type: String, default: '' },\n\n /**\n * Highlights the textarea is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Text displayed as the placeholder of the textarea\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Set the textarea to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Indicates the possibility of resize the textarea\n */\n resizable: {\n type: String as PropType<BentoTextareaResizeOption | `${BentoTextareaResizeOption}`>,\n default: BentoTextareaResizeOption.BOTH,\n validator: (value: BentoTextareaResizeOption) => Object.values(BentoTextareaResizeOption).includes(value),\n },\n\n /**\n * Highlights the textarea is required.\n */\n required: { type: Boolean, default: false },\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 * Text displayed as the value of the textarea\n */\n value: { type: String, default: '' },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the element has lost focus\n */\n (e: BentoTextareaEvent.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: BentoTextareaEvent.CHANGE): void;\n\n /**\n * Emitted when the \"Clear\" button was clicked\n */\n (e: BentoTextareaEvent.CLEAR): void;\n\n /**\n * Emitted when the \"ESC\" key is pressed\n */\n (e: BentoTextareaEvent.ESCAPE_PRESSED): void;\n\n /**\n * Emitted when the element has received focus\n */\n (e: BentoTextareaEvent.FOCUS): void;\n\n /**\n * Emitted when the component's model changes\n */\n (e: BentoTextareaEvent.INPUT, value: string): void;\n }>();\n\n const { height } = toRefs(props);\n\n const textareaId = generateUid('textarea');\n const textareaElement = ref<HTMLTextAreaElement>(null);\n const textareaValue = ref(props.value);\n const defaultTextareaHeight = 44;\n const textareaHeight = ref(props.height || `${defaultTextareaHeight}px`);\n const textareaWidth = ref('100%');\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const counter = computed(() => `${textareaValue.value.length} / ${props.characterLimit}`);\n const isOverCharacterLimit = computed(\n () => props.characterLimit && textareaValue.value.length > props.characterLimit\n );\n\n const calculateHeight = () => {\n const borderWidth = 3;\n if (textareaElement.value && textareaElement.value.scrollHeight > defaultTextareaHeight) {\n textareaHeight.value = `${textareaElement.value.scrollHeight + borderWidth}px`;\n }\n };\n\n watch(height, () => {\n if (!height.value) {\n calculateHeight();\n } else {\n textareaHeight.value = height.value;\n }\n });\n\n watch(\n () => props.value,\n () => {\n textareaValue.value = props.value;\n },\n { immediate: true }\n );\n\n watch(\n () => textareaValue.value,\n async () => {\n if (!height.value) {\n // Hack to make the textarea calculate its height properly\n // Set the textarea back to the original value before calculating the height\n textareaHeight.value = `${defaultTextareaHeight}px`;\n if (!textareaValue.value) {\n return;\n }\n\n await nextTick();\n calculateHeight();\n }\n },\n { immediate: true }\n );\n\n const invalidInput = computed(() => !!props.errorMessage || isOverCharacterLimit.value);\n\n const conditionalClasses = computed(() => ({\n [`b-textarea--${BentoTextareaStateClass.DISABLED}`]: props.disabled,\n }));\n\n const conditionalClassesInput = computed(() => ({\n [`b-textarea__input--${BentoTextareaStateClass.CLEARABLE}`]: props.clearable,\n [`b-textarea__input--${BentoTextareaStateClass.READONLY}`]: isReadOnly.value,\n [`b-textarea__input--${BentoTextareaStateClass.ERROR}`]: invalidInput.value,\n [`b-textarea__input--dynamic-height`]: !height.value,\n }));\n\n const conditionalClassesLabelBox = computed(() => ({\n [`b-textarea__label-box--no-label`]: !props.label,\n }));\n\n const conditionalClassesLabelItem = computed(() => ({\n [`b-textarea__label-item--${BentoTextareaStateClass.ERROR}`]: isOverCharacterLimit.value,\n }));\n\n const counterErrorText = computed(() => t('yourTextCanBenAtMost', { characterLimit: props.characterLimit }));\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel, label } = 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: label,\n });\n\n const showClearButton = computed(\n () => props.clearable && textareaValue.value && !props.disabled && !isReadOnly.value\n );\n\n const onClear = () => {\n textareaValue.value = '';\n emit(BentoTextareaEvent.CLEAR);\n emit(BentoTextareaEvent.INPUT, '');\n };\n\n const onInput = (event: InputEvent) => {\n event.stopImmediatePropagation();\n\n if (!props.disabled && !isReadOnly.value) {\n textareaValue.value = (event.target as HTMLInputElement).value;\n /**\n * Triggered when input value is changed\n *\n * @event input\n * @property {String} inputValue - the updated textarea value\n */\n emit(BentoTextareaEvent.INPUT, textareaValue.value);\n }\n };\n\n const onBlur = () => {\n textareaElement.value.scrollTop = 0;\n emit(BentoTextareaEvent.BLUR);\n };\n\n const onFocus = () => {\n textareaElement.value.focus();\n emit(BentoTextareaEvent.FOCUS);\n };\n\n const onChange = () => {\n emit(BentoTextareaEvent.CHANGE);\n };\n\n const onPressEscape = () => {\n emit(BentoTextareaEvent.ESCAPE_PRESSED);\n };\n\n onMounted(() => {\n observeSizeOfElement(textareaElement.value, () => {\n const offsetWidth = textareaElement?.value?.offsetWidth;\n textareaWidth.value = offsetWidth ? `${offsetWidth}px` : '100%';\n });\n\n if (!height.value) {\n calculateHeight();\n }\n });\n</script>\n\n<script lang=\"ts\">\n export default {\n i18n: { messages },\n name: 'bento-textarea',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./textarea.scss\" />\n"],"names":["uuid","openBlock","createElementBlock","mergeProps","_ctx","_hoisted_1$1","toDisplayString","BentoTextareaResizeOption","BentoTextareaResizeOption2","BentoTextareaStateClass","BentoTextareaStateClass2","BentoTextareaEvent","BentoTextareaEvent2","__default__","messages","attrs","useAttrs","height","toRefs","props","textareaId","generateUid","textareaElement","ref","textareaValue","defaultTextareaHeight","textareaHeight","textareaWidth","t","useI18n","isReadOnly","useFormLayoutFieldLoading","toRef","counter","computed","isOverCharacterLimit","calculateHeight","watch","nextTick","invalidInput","conditionalClasses","conditionalClassesInput","conditionalClassesLabelBox","conditionalClassesLabelItem","counterErrorText","ariaLabelAttribute","ariaLabel","label","computedAriaLabel","useAriaLabel","showClearButton","onClear","emit","onInput","event","onBlur","onFocus","onChange","onPressEscape","onMounted","observeSizeOfElement","offsetWidth","_a"],"mappings":";;;;;;;;;;;AAKI,IAAAA,IAAA;;EAGI,eAAA;8BAEIA,KAAA;AAAA;;EARuK,MAAA;AAAA,EAAe,aAAA;AAAA,EAAoB,GAAA;AAAA,EAAgpB,aAAA;;;AAAl2B,SAAAC,EAAA,GAAAC,EAAA,OAAAC,GAAA,EAAA,MAAA,MAAA,GAAAC,EAAA,QAAA;AAAA,IAAgC,OAAA;AAAA,IAAmC,OAAA;AAAA,IAAW,QAAA;AAAA,IAAY,MAAA;AAAA;6BAAYH,EAAA,GAAAC,EAAA,SAAAG,IAAAC,EAAAF,EAAA,OAAA,WAAA,CAAA,GAAA,CAAA;;;;;ACC9F,IAAAG,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAA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