@adyen/bento-vue2 1.108.2 → 1.108.3

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.
Files changed (58) hide show
  1. package/dist/@types/index.d.ts +1 -0
  2. package/dist/assets/accordion-item.css +1 -1
  3. package/dist/assets/action-bar.css +1 -1
  4. package/dist/assets/base-modal.css +1 -1
  5. package/dist/assets/button-actions.css +1 -1
  6. package/dist/assets/calendar.css +1 -1
  7. package/dist/assets/card.css +1 -1
  8. package/dist/assets/data-grid.css +1 -1
  9. package/dist/assets/date-range-picker.css +1 -1
  10. package/dist/assets/dialog-page.css +1 -1
  11. package/dist/assets/file-uploader.css +1 -1
  12. package/dist/assets/input-time.css +1 -1
  13. package/dist/assets/inspector.css +1 -1
  14. package/dist/assets/modal-fullscreen.css +1 -1
  15. package/dist/assets/navigation-menu-group.css +1 -1
  16. package/dist/assets/secondary-nav.css +1 -1
  17. package/dist/assets/selection-card-group.css +1 -1
  18. package/dist/assets/sidepanel.css +1 -1
  19. package/dist/assets/textarea.css +1 -1
  20. package/dist/chunks/{calendar.CbsgWJTo.js → calendar.B-fVLsHA.js} +289 -286
  21. package/dist/chunks/calendar.B-fVLsHA.js.map +1 -0
  22. package/dist/chunks/{data-grid.CWVHdx2g.js → data-grid.Bh8ADT7E.js} +2 -2
  23. package/dist/chunks/{data-grid.CWVHdx2g.js.map → data-grid.Bh8ADT7E.js.map} +1 -1
  24. package/dist/chunks/{date-picker.mP11cD8l.js → date-picker.BZWr0kKU.js} +3 -3
  25. package/dist/chunks/{date-picker.mP11cD8l.js.map → date-picker.BZWr0kKU.js.map} +1 -1
  26. package/dist/chunks/{date-range-picker.BK1Fe9dv.js → date-range-picker.DcG3KxuF.js} +293 -284
  27. package/dist/chunks/date-range-picker.DcG3KxuF.js.map +1 -0
  28. package/dist/chunks/{date-time-picker.Cejtycaf.js → date-time-picker.Cs8Ev9k4.js} +5 -5
  29. package/dist/chunks/{date-time-picker.Cejtycaf.js.map → date-time-picker.Cs8Ev9k4.js.map} +1 -1
  30. package/dist/chunks/{filter-bar.D_31DtTq.js → filter-bar.Cx3YORQe.js} +5 -5
  31. package/dist/chunks/{filter-bar.D_31DtTq.js.map → filter-bar.Cx3YORQe.js.map} +1 -1
  32. package/dist/chunks/{input-time.DDYaCY3r.js → input-time.D4GB-OBv.js} +21 -19
  33. package/dist/chunks/input-time.D4GB-OBv.js.map +1 -0
  34. package/dist/chunks/{selection-card-group.CGUEcVTZ.js → selection-card-group.mAC1hrzJ.js} +49 -48
  35. package/dist/chunks/{selection-card-group.CGUEcVTZ.js.map → selection-card-group.mAC1hrzJ.js.map} +1 -1
  36. package/dist/chunks/{textarea.ec4ubFuL.js → textarea.DmEgZbGe.js} +3 -3
  37. package/dist/chunks/textarea.DmEgZbGe.js.map +1 -0
  38. package/dist/chunks/{timeline-item.BoaJTmzW.js → timeline-item.BLHykoIV.js} +2 -2
  39. package/dist/chunks/{timeline-item.BoaJTmzW.js.map → timeline-item.BLHykoIV.js.map} +1 -1
  40. package/dist/chunks/{use-date-input-formatter.3Cgguj4S.js → use-date-input-formatter.CzQbwvPo.js} +2 -2
  41. package/dist/chunks/{use-date-input-formatter.3Cgguj4S.js.map → use-date-input-formatter.CzQbwvPo.js.map} +1 -1
  42. package/dist/data-grid.js +1 -1
  43. package/dist/date-picker.js +2 -2
  44. package/dist/date-range-picker.js +2 -2
  45. package/dist/date-time-picker.js +1 -1
  46. package/dist/filter-bar.js +1 -1
  47. package/dist/index.js +10 -10
  48. package/dist/input-time.js +1 -1
  49. package/dist/internal.js +1 -1
  50. package/dist/selection-card.js +1 -1
  51. package/dist/textarea.js +1 -1
  52. package/dist/timeline.js +1 -1
  53. package/dist/web-types.json +9 -1
  54. package/package.json +6 -6
  55. package/dist/chunks/calendar.CbsgWJTo.js.map +0 -1
  56. package/dist/chunks/date-range-picker.BK1Fe9dv.js.map +0 -1
  57. package/dist/chunks/input-time.DDYaCY3r.js.map +0 -1
  58. package/dist/chunks/textarea.ec4ubFuL.js.map +0 -1
@@ -1,14 +1,14 @@
1
1
  import { defineComponent as S, provide as g, useSlots as y, ref as D, computed as d, watch as h } from "vue";
2
2
  import { f as H, B as I } from "./input-field.BwGCbmk0.js";
3
- import { g as b } from "./dropdown.DGUdfiro.js";
4
- import { u as E } from "./index.CPOlyau9.js";
3
+ import { g as E } from "./dropdown.DGUdfiro.js";
4
+ import { u as b } from "./index.CPOlyau9.js";
5
5
  import { u as B } from "./use-has-slot.C9lQZ6nz.js";
6
6
  import { u as V } from "./use-touch-device.DTqFAbXh.js";
7
- import { n as w } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
7
+ import { n as k } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
8
8
  import "../assets/input-time.css";
9
- const x = /[\d]/, N = /^\d{2}$/, k = /^\d{2}:\d{2}$/, v = (o) => /^(?:[01]\d|2[0-4]):(?:[0-5]\d):(?:[0-5]\d)$/.test(o), A = 8, $ = (o) => {
10
- const { selectionStart: e, value: i = "" } = o.target, s = ["Backspace", "Tab", "ArrowLeft", "ArrowRight"].includes(o.key), p = x.test(o.key) || s, r = [1, 2, 4, 5].includes(e) && o.key === ":", u = i.length >= A;
11
- (!p && !r || u && !s) && o.preventDefault();
9
+ const w = /[\d]/, x = /^\d{2}$/, N = /^\d{2}:\d{2}$/, v = (o) => /^(?:[01]\d|2[0-4]):(?:[0-5]\d):(?:[0-5]\d)$/.test(o), $ = 8, A = (o) => {
10
+ const { selectionStart: e, value: i = "" } = o.target, l = ["Backspace", "Tab", "ArrowLeft", "ArrowRight"].includes(o.key), p = w.test(o.key) || l, r = [1, 2, 4, 5].includes(e) && o.key === ":", u = i.length >= $;
11
+ (!p && !r || u && !l) && o.preventDefault();
12
12
  }, C = (o) => {
13
13
  if (!o)
14
14
  return o;
@@ -16,7 +16,7 @@ const x = /[\d]/, N = /^\d{2}$/, k = /^\d{2}:\d{2}$/, v = (o) => /^(?:[01]\d|2[0
16
16
  if (e.length === 1 && parseInt(o, 10) > 2)
17
17
  return `0${e}:`;
18
18
  const [i, t] = e.slice(-2);
19
- return [2, 5].includes(e.length) && t === ":" && (e = `${e.slice(0, e.length - 2)}0${i}`), (N.test(e) || k.test(e)) && (e += ":"), e;
19
+ return [2, 5].includes(e.length) && t === ":" && (e = `${e.slice(0, e.length - 2)}0${i}`), (x.test(e) || N.test(e)) && (e += ":"), e;
20
20
  }, K = {
21
21
  "de-DE": { invalidTimeFormat: "Ungültiges Zeitformat", timeFormatDescription: "HH:MM:SS" },
22
22
  "en-GB": { invalidTimeFormat: "Invalid time format", timeFormatDescription: "HH:MM:SS" },
@@ -49,25 +49,25 @@ const x = /[\d]/, N = /^\d{2}$/, k = /^\d{2}:\d{2}$/, v = (o) => /^(?:[01]\d|2[0
49
49
  condensed: { type: Boolean, default: !1 },
50
50
  modelValue: { default: void 0 }
51
51
  },
52
- emits: ["update:model-value", "keydown", "input:valid", "input:error"],
52
+ emits: ["click", "update:model-value", "keydown", "input:valid", "input:error"],
53
53
  setup(o, { emit: e }) {
54
54
  const i = o, t = 300;
55
55
  g(H, "bento-input-time");
56
- const s = y(), p = B(s), { isTouchDevice: r } = V(), { t: u } = E(), l = D(!1), m = d(() => i.errorMessage ? i.errorMessage : l.value ? u("invalidTimeFormat") : null), _ = d(() => r.value ? i.errorMessage : m.value), T = d(() => r.value ? "time" : void 0), M = d(() => i.modelValue), F = d(() => r ? void 0 : i.placeholder), c = (n) => {
56
+ const l = y(), p = B(l), { isTouchDevice: r } = V(), { t: u } = b(), s = D(!1), m = d(() => i.errorMessage ? i.errorMessage : s.value ? u("invalidTimeFormat") : null), _ = d(() => r.value ? i.errorMessage : m.value), T = d(() => r.value ? "time" : void 0), M = d(() => i.modelValue), F = d(() => r ? void 0 : i.placeholder), c = (n) => {
57
57
  if (!n) {
58
- l.value = !1;
58
+ s.value = !1;
59
59
  return;
60
60
  }
61
61
  const a = v(n);
62
- l.value = !a, e(a ? "input:valid" : "input:error");
63
- }, f = b(c, t);
62
+ s.value = !a, e(a ? "input:valid" : "input:error");
63
+ }, f = E(c, t);
64
64
  return h(
65
65
  () => i.modelValue,
66
66
  (n) => {
67
67
  const a = String(n ?? "");
68
- a.length === 8 && v(a) && (l.value = !1);
68
+ a.length === 8 && v(a) && (s.value = !1);
69
69
  }
70
- ), { __sfc: !0, VALIDATION_DEBOUNCE_TIME: t, slots: s, hasSlot: p, isTouchDevice: r, t: u, props: i, emit: e, internalError: l, computedErrorMessage: m, inputErrorMessage: _, inputType: T, inputModelValue: M, computedPlaceholder: F, validateTime: c, validateTimeWithDebounce: f, onInput: (n) => {
70
+ ), { __sfc: !0, VALIDATION_DEBOUNCE_TIME: t, slots: l, hasSlot: p, isTouchDevice: r, t: u, props: i, emit: e, internalError: s, computedErrorMessage: m, inputErrorMessage: _, inputType: T, inputModelValue: M, computedPlaceholder: F, validateTime: c, validateTimeWithDebounce: f, onInput: (n) => {
71
71
  if (!(i.disabled || i.readonly))
72
72
  if (r.value)
73
73
  e("update:model-value", String(n ?? "")), e("input:valid");
@@ -76,30 +76,32 @@ const x = /[\d]/, N = /^\d{2}$/, k = /^\d{2}:\d{2}$/, v = (o) => /^(?:[01]\d|2[0
76
76
  e("update:model-value", a), f(a);
77
77
  }
78
78
  }, onKeyDown: (n) => {
79
- r.value || $(n), e("keydown", n);
79
+ r.value || A(n), e("keydown", n);
80
80
  }, BentoInputField: I };
81
81
  }
82
82
  });
83
83
  var L = function() {
84
84
  var e = this, i = e._self._c, t = e._self._setupProxy;
85
- return i(t.BentoInputField, e._b({ staticClass: "b-input-time", attrs: { type: t.inputType, step: t.isTouchDevice ? 1 : void 0, condensed: t.props.condensed, disabled: t.props.disabled, "error-message": t.inputErrorMessage, label: t.props.label, "model-value": t.inputModelValue, optional: t.props.optional, placeholder: t.computedPlaceholder, readonly: t.props.readonly, required: t.props.required, "tooltip-text": t.props.tooltipText }, on: { "update:model-value": t.onInput, keydown: t.onKeyDown }, scopedSlots: e._u([t.hasSlot("default") ? { key: "default", fn: function() {
85
+ return i(t.BentoInputField, e._b({ staticClass: "b-input-time", attrs: { type: t.inputType, step: t.isTouchDevice ? 1 : void 0, condensed: t.props.condensed, disabled: t.props.disabled, "error-message": t.inputErrorMessage, label: t.props.label, "model-value": t.inputModelValue, optional: t.props.optional, placeholder: t.computedPlaceholder, readonly: t.props.readonly, required: t.props.required, "tooltip-text": t.props.tooltipText }, on: { click: function(l) {
86
+ return e.$emit("click");
87
+ }, "update:model-value": t.onInput, keydown: t.onKeyDown }, scopedSlots: e._u([t.hasSlot("default") ? { key: "default", fn: function() {
86
88
  return [e._t("default")];
87
89
  }, proxy: !0 } : null, t.isTouchDevice ? null : { key: "description", fn: function() {
88
90
  return [e._t("description", function() {
89
91
  return [e._v(e._s(t.props.description ? `${t.props.description} ${t.t("timeFormatDescription")}` : t.t("timeFormatDescription")))];
90
92
  })];
91
93
  }, proxy: !0 }], null, !0) }, "bento-input-field", e.$attrs, !1));
92
- }, O = [], U = /* @__PURE__ */ w(
94
+ }, O = [], U = /* @__PURE__ */ k(
93
95
  R,
94
96
  L,
95
97
  O,
96
98
  !1,
97
99
  null,
98
- "a2b489fa"
100
+ "748af542"
99
101
  );
100
102
  const Q = U.exports;
101
103
  export {
102
104
  Q as B,
103
105
  v as i
104
106
  };
105
- //# sourceMappingURL=input-time.DDYaCY3r.js.map
107
+ //# sourceMappingURL=input-time.D4GB-OBv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-time.D4GB-OBv.js","sources":["../../src/utils/ts/time-input.ts","../../src/components/input-time/input-time.vue"],"sourcesContent":["const validDigitRegex = /[\\d]/;\n\nconst hourRegex = /^\\d{2}$/;\nconst minuteRegex = /^\\d{2}:\\d{2}$/;\n\n/**\n * Validates a complete time string in HH:MM:SS format.\n * Hours: 00-24, Minutes: 00-59, Seconds: 00-59\n * @param timeText The time string to validate\n * @returns True if the time string is valid, false otherwise\n */\nexport const isValidTimeString = (timeText: string): boolean =>\n /^(?:[01]\\d|2[0-4]):(?:[0-5]\\d):(?:[0-5]\\d)$/.test(timeText);\n\nconst MAX_TIME_INPUT_LENGTH = 8;\n\nexport const validateTimeInput = (event: KeyboardEvent) => {\n const { selectionStart, value = '' } = event.target as HTMLInputElement;\n\n const allowedKeys = ['Backspace', 'Tab', 'ArrowLeft', 'ArrowRight'];\n const isAllowedKey = allowedKeys.includes(event.key);\n const isValidKey = validDigitRegex.test(event.key) || isAllowedKey;\n const isValidColon = [1, 2, 4, 5].includes(selectionStart) && event.key === ':';\n const isAtMaxLength = value.length >= MAX_TIME_INPUT_LENGTH;\n\n if ((!isValidKey && !isValidColon) || (isAtMaxLength && !isAllowedKey)) {\n event.preventDefault();\n }\n};\n\nexport const formatTimeInputValue = (value: string) => {\n if (!value) {\n return value;\n }\n\n let formattedValue = value;\n\n // Format if the first value is bigger than 2, because it can't be bigger than 24 hours\n if (formattedValue.length === 1 && parseInt(value, 10) > 2) {\n return `0${formattedValue}:`;\n }\n\n const [secondToLastDigit, lastDigit] = formattedValue.slice(-2);\n if ([2, 5].includes(formattedValue.length) && lastDigit === ':') {\n formattedValue = `${formattedValue.slice(0, formattedValue.length - 2)}0${secondToLastDigit}`;\n }\n\n // Add `:` after hour/minute\n if (hourRegex.test(formattedValue) || minuteRegex.test(formattedValue)) {\n formattedValue += ':';\n }\n return formattedValue;\n};\n","<template>\n <bento-input-field\n class=\"b-input-time\"\n :type=\"inputType\"\n :step=\"isTouchDevice ? 1 : undefined\"\n :condensed=\"props.condensed\"\n :disabled=\"props.disabled\"\n :error-message=\"inputErrorMessage\"\n :label=\"props.label\"\n :model-value=\"inputModelValue\"\n :optional=\"props.optional\"\n :placeholder=\"computedPlaceholder\"\n :readonly=\"props.readonly\"\n :required=\"props.required\"\n :tooltip-text=\"props.tooltipText\"\n v-bind=\"$attrs\"\n @click=\"$emit('click')\"\n @update:model-value=\"onInput\"\n @keydown=\"onKeyDown\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot name=\"default\"></slot>\n </template>\n <template v-if=\"!isTouchDevice\" #description>\n <slot name=\"description\">{{\n props.description ? `${props.description} ${t('timeFormatDescription')}` : t('timeFormatDescription')\n }}</slot>\n </template>\n </bento-input-field>\n</template>\n\n<script setup lang=\"ts\">\n // Components\n import { BentoInputField } from '@/components/input-field';\n import { INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY } from '@/components/input-field/input-field.keys';\n\n // Utils\n import { debounce } from '@/utils/ts/debounce';\n import { useI18n } from '@/utils/ts/i18n';\n import { formatTimeInputValue, isValidTimeString, validateTimeInput } from '@/utils/ts/time-input';\n\n // Types\n import type { BentoInputFieldValue } from '@/components/input-field/input-field.types';\n import { type BentoInputTimeProps } from './input-time.types';\n\n // Localization\n import messages from './messages.json';\n\n import { computed, provide, ref, useSlots, watch } from 'vue';\n import { useHasSlot, useTouchDevice } from '@/composables';\n\n const VALIDATION_DEBOUNCE_TIME = 300;\n\n provide(INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY, 'bento-input-time');\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const { isTouchDevice } = useTouchDevice();\n\n type MessageSchema = (typeof messages)['en-US'];\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = defineProps({\n description: { default: undefined },\n disabled: { type: Boolean, default: false },\n errorMessage: { default: null },\n label: { default: '' },\n optional: { type: Boolean, default: false },\n placeholder: { default: '' },\n readonly: { type: Boolean, default: false },\n required: { type: Boolean, default: false },\n tooltipText: { default: null },\n condensed: { type: Boolean, default: false },\n modelValue: { default: undefined }\n});\n\n const emit = defineEmits([\"click\", \"update:model-value\", \"keydown\", \"input:valid\", \"input:error\"]);\n\n const internalError = ref(false);\n const computedErrorMessage = computed(() => {\n if (props.errorMessage) {\n return props.errorMessage;\n }\n return internalError.value ? t('invalidTimeFormat') : null;\n });\n const inputErrorMessage = computed(() => (isTouchDevice.value ? props.errorMessage : computedErrorMessage.value));\n const inputType = computed(() => (isTouchDevice.value ? 'time' : undefined));\n const inputModelValue = computed(() => props.modelValue);\n const computedPlaceholder = computed(() => (isTouchDevice ? undefined : props.placeholder));\n\n const validateTime = (timeText: string) => {\n if (!timeText) {\n internalError.value = false;\n return;\n }\n\n const isValid = isValidTimeString(timeText);\n internalError.value = !isValid;\n\n if (isValid) {\n emit('input:valid');\n } else {\n emit('input:error');\n }\n };\n const validateTimeWithDebounce = debounce(validateTime, VALIDATION_DEBOUNCE_TIME);\n\n // Watch for external modelValue changes (e.g., when parent resets the value)\n watch(\n () => props.modelValue,\n newValue => {\n const timeText = String(newValue ?? '');\n // Clear the error only when the new value is a complete, valid time string\n if (timeText.length === 8 && isValidTimeString(timeText)) {\n internalError.value = false;\n }\n }\n );\n\n const onInput = (value: BentoInputFieldValue) => {\n if (props.disabled || props.readonly) {\n return;\n }\n\n if (isTouchDevice.value) {\n emit('update:model-value', String(value ?? ''));\n emit('input:valid');\n } else {\n const formatted = formatTimeInputValue(String(value ?? ''));\n emit('update:model-value', formatted);\n validateTimeWithDebounce(formatted);\n }\n };\n\n const onKeyDown = (event: KeyboardEvent) => {\n if (!isTouchDevice.value) {\n validateTimeInput(event);\n }\n emit('keydown', event);\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Input time component for entering time values in HH:MM:SS format.\n * This is an extension of the `bento-input-field` component with built-in\n * time formatting and validation logic.\n *\n * @usage\n * import { BentoInputTime } from '@adyen/bento-vue2';\n *\n * const timeValue = ref('');\n *\n * export default {\n * components: { BentoInputTime },\n * template: `\n * <bento-input-time\n * label=\"Start time\"\n * :model-value=\"timeValue\"\n * @update:model-value=\"newValue => timeValue.value = newValue\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-input-time',\n inheritAttrs: false,\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-time.scss\" />\n"],"names":["validDigitRegex","hourRegex","minuteRegex","isValidTimeString","timeText","MAX_TIME_INPUT_LENGTH","validateTimeInput","event","selectionStart","value","isAllowedKey","isValidKey","isValidColon","isAtMaxLength","formatTimeInputValue","formattedValue","secondToLastDigit","lastDigit","__default__","messages","VALIDATION_DEBOUNCE_TIME","provide","INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY","slots","useSlots","hasSlot","useHasSlot","isTouchDevice","useTouchDevice","t","useI18n","internalError","ref","computedErrorMessage","computed","props","inputErrorMessage","inputType","inputModelValue","computedPlaceholder","validateTime","isValid","emit","validateTimeWithDebounce","debounce","watch","newValue","formatted"],"mappings":";;;;;;;;AAAA,MAAAA,IAAA,QAEAC,IAAA,WACAC,IAAA,iBAQOC,IAAA,CAAAC,MAAA,8CAAA,KAAAA,CAAA,GAGPC,IAAA,GAEOC,IAAA,CAAAC,MAAA;AACH,QAAA,EAAA,gBAAAC,GAAA,OAAAC,IAAA,GAAA,IAAAF,EAAA,QAGAG,IADA,CAAA,aAAA,OAAA,aAAA,YAAA,EACA,SAAAH,EAAA,GAAA,GACAI,IAAAX,EAAA,KAAAO,EAAA,GAAA,KAAAG,GACAE,IAAA,CAAA,GAAA,GAAA,GAAA,CAAA,EAAA,SAAAJ,CAAA,KAAAD,EAAA,QAAA,KACAM,IAAAJ,EAAA,UAAAJ;AAEA,GAAA,CAAAM,KAAA,CAAAC,KAAAC,KAAA,CAAAH,MACIH,EAAA,eAAA;AAER,GAEOO,IAAA,CAAAL,MAAA;AACH,MAAA,CAAAA;AACI,WAAAA;AAGJ,MAAAM,IAAAN;AAGA,MAAAM,EAAA,WAAA,KAAA,SAAAN,GAAA,EAAA,IAAA;AACI,WAAA,IAAAM,CAAA;AAGJ,QAAA,CAAAC,GAAAC,CAAA,IAAAF,EAAA,MAAA,EAAA;AACA,SAAA,CAAA,GAAA,CAAA,EAAA,SAAAA,EAAA,MAAA,KAAAE,MAAA,QACIF,IAAA,GAAAA,EAAA,MAAA,GAAAA,EAAA,SAAA,CAAA,CAAA,IAAAC,CAAA,MAIJf,EAAA,KAAAc,CAAA,KAAAb,EAAA,KAAAa,CAAA,OACIA,KAAA,MAEJA;AACJ;;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AAA,GACAiC,EAAA,aAAA;AAAA,aAAkB;AAElB,gBAAAK,IAAAjC,EAAA,OAAAL,KAAA,EAAA,CAAA;AACA,UAAAiC,EAAA,sBAAAK,CAAA,GACAJ,EAAAI,CAAA;AAAA,QAAkC;AAAA,IACtC,cAGJ,CAAAxC,MAAA;AACI,MAAAoB,EAAA,SACIrB,EAAAC,CAAA,GAEJmC,EAAA,WAAAnC,CAAA;AAAA,IAAqB;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
- import { defineComponent as $, useSlots as L, computed as l, inject as G, ref as v, watch as A, provide as O, onMounted as D } from "vue";
2
- import { h as N } from "./index.CL3TXc0a.js";
1
+ import { defineComponent as $, useSlots as L, computed as l, inject as G, ref as v, watch as A, provide as N, onMounted as O } from "vue";
2
+ import { h as D } from "./index.CL3TXc0a.js";
3
3
  import { a as q, B as z } from "./es6.Cu3DYUPA.js";
4
4
  import { B as F } from "./typography.D1OZJbEa.js";
5
5
  import { C as j } from "./checkbox-input.C8gCpme1.js";
@@ -79,7 +79,7 @@ const P = /* @__PURE__ */ Symbol("selection card radio input injection key"), X
79
79
  },
80
80
  emits: ["input", "update:model-value"],
81
81
  setup(i, { emit: e }) {
82
- const t = i, o = L(), a = Y(o), h = M("selection-card-input-id"), r = M("selection-card-description"), d = l(
82
+ const t = i, o = L(), a = Y(o), h = M("selection-card-input-id"), n = M("selection-card-description"), p = l(
83
83
  () => t.modelValue
84
84
  ), w = l(
85
85
  () => t.modelValue
@@ -90,37 +90,37 @@ const P = /* @__PURE__ */ Symbol("selection card radio input injection key"), X
90
90
  [`b-selection-card--${S.DISABLED}`]: t.disabled,
91
91
  [`b-selection-card--${S.ERROR}`]: t.hasError,
92
92
  [`b-selection-card--${S.READONLY}`]: t.readonly,
93
- "b-selection-card--center-aligned": m.value
94
- })), f = l(() => ({
95
- "b-selection-card__checkbox-container--center-aligned": m.value
93
+ "b-selection-card--center-aligned": _.value
94
+ })), m = l(() => ({
95
+ "b-selection-card__checkbox-container--center-aligned": _.value
96
96
  })), C = l(() => ({
97
- "b-selection-card__checkbox-container-text--center-aligned": m.value
97
+ "b-selection-card__checkbox-container-text--center-aligned": _.value
98
98
  })), k = l(() => ({
99
99
  "b-selection-card__slot--with-icon": a("icon")
100
100
  })), R = W({
101
101
  ariaLabel: t.title,
102
102
  label: t.value
103
- }), u = l(() => Array.isArray(t.modelValue)), x = l(() => c.value ? t.value === t.modelValue : u.value ? t.modelValue.some((s) => s === t.value) : t.modelValue), c = G(P, v(!1)), m = l(() => !t.subtitle && !t.description), p = v(null), _ = v(null), n = v(null), y = (s) => {
104
- if (p.value.$refs.inputRef === s.target) {
103
+ }), u = l(() => Array.isArray(t.modelValue)), x = l(() => d.value ? t.value === t.modelValue : u.value ? t.modelValue.some((s) => s === t.value) : t.modelValue), d = G(P, v(!1)), _ = l(() => !t.subtitle && !t.description), f = v(null), b = v(null), r = v(null), c = (s) => {
104
+ if (f.value.$refs.inputRef === s.target) {
105
105
  const I = E();
106
106
  V(I);
107
107
  return;
108
108
  }
109
- if (t.disabled && t.readonly || !t.fullyClickable && (_.value && _.value?.$el?.contains(s.target) || n.value && n.value?.$el?.contains(s.target) || p.value && p.value?.$el?.contains(s.target)))
109
+ if (t.disabled && t.readonly || !t.fullyClickable && (b.value && b.value?.$el?.contains(s.target) || r.value && r.value?.$el?.contains(s.target) || f.value && f.value?.$el?.contains(s.target)))
110
110
  return;
111
- const b = E();
112
- V(b);
111
+ const y = E();
112
+ V(y);
113
113
  }, E = () => {
114
- const s = (p.value?.$refs.inputRef).checked;
114
+ const s = (f.value?.$refs.inputRef).checked;
115
115
  if (u.value) {
116
- const b = [...t.modelValue], I = b.indexOf(t.value);
117
- return I === -1 ? b.push(t.value) : b.splice(I, 1), b;
116
+ const y = [...t.modelValue], I = y.indexOf(t.value);
117
+ return I === -1 ? y.push(t.value) : y.splice(I, 1), y;
118
118
  }
119
- return c.value ? t.value : s;
119
+ return d.value ? t.value : s;
120
120
  }, V = (s) => {
121
121
  !t.disabled && !t.readonly && (e("update:model-value", s), e("input", s));
122
122
  };
123
- return { __sfc: !0, props: t, emit: e, slots: o, hasSlot: a, inputId: h, descriptionId: r, computedRadioInputModelValue: d, computedCheckboxInputModelValue: w, conditionalClasses: B, containerConditionalClasses: g, checkboxContainerConditionalClasses: f, checkboxContainerTextConditionalClasses: C, slotConditionalClasses: k, ariaLabel: R, isCheckboxGroup: u, isChecked: x, isRadioInput: c, isTitleOnly: m, inputRef: p, slotRef: _, dynamicSlotRef: n, handleCardClick: y, toggleInput: E, onChange: V, BentoTypography: F, CheckboxInput: j, RadioInput: Q };
123
+ return { __sfc: !0, props: t, emit: e, slots: o, hasSlot: a, inputId: h, descriptionId: n, computedRadioInputModelValue: p, computedCheckboxInputModelValue: w, conditionalClasses: B, containerConditionalClasses: g, checkboxContainerConditionalClasses: m, checkboxContainerTextConditionalClasses: C, slotConditionalClasses: k, ariaLabel: R, isCheckboxGroup: u, isChecked: x, isRadioInput: d, isTitleOnly: _, inputRef: f, slotRef: b, dynamicSlotRef: r, handleCardClick: c, toggleInput: E, onChange: V, BentoTypography: F, CheckboxInput: j, RadioInput: Q };
124
124
  }
125
125
  });
126
126
  var ee = function() {
@@ -161,38 +161,39 @@ const ae = oe.exports, le = {
161
161
  },
162
162
  emits: ["update:model-value", "input"],
163
163
  setup(i, { emit: e }) {
164
- const t = i, { emitValue: o } = U(e), a = L(), h = (n) => !!a[n], r = l(() => ({
164
+ const t = i, { emitValue: o } = U(e), a = L(), h = (r) => !!a[r], n = l(() => ({
165
165
  "b-selection-card-group__items--horizontal": t.layout === "horizontal"
166
- })), d = v(t.modelValue);
166
+ })), p = v(t.modelValue);
167
167
  A(
168
168
  () => t.modelValue,
169
169
  () => {
170
- d.value = t.modelValue;
170
+ p.value = t.modelValue;
171
171
  }
172
172
  );
173
- const w = M("error"), B = l(() => !t.disabled && !t.readonly && !!t.errorMessage), g = v(null), { width: f } = N(g), C = l(() => q.split("px")[0]), k = l(() => z.split("px")[0]), R = l(() => f.value < C.value ? "small" : f.value >= C.value && f.value < k.value ? "medium" : "large"), u = l(() => t.itemsPerRow?.[R?.value] || t.items.length), x = l(() => {
173
+ const w = M("error"), B = l(() => !t.disabled && !t.readonly && !!t.errorMessage), g = v(null), { width: m } = D(g), C = l(() => q.split("px")[0]), k = l(() => z.split("px")[0]), R = l(() => m.value < C.value ? "small" : m.value >= C.value && m.value < k.value ? "medium" : "large"), u = l(() => t.itemsPerRow?.[R?.value] || t.items.length), x = l(() => {
174
174
  if (!t.itemsPerRow)
175
175
  return [];
176
- const n = [];
177
- for (let y = 0; y < t.items.length; y += u?.value)
178
- n.push(t.items.slice(y, y + u?.value));
179
- return n;
180
- }), c = l(() => 12 / u?.value), m = l(() => u?.value ? new Array(u?.value).fill({
176
+ const r = [];
177
+ for (let c = 0; c < t.items.length; c += u?.value)
178
+ r.push(t.items.slice(c, c + u?.value));
179
+ return r;
180
+ }), d = l(() => 12 / u?.value), _ = l(() => u?.value ? new Array(u?.value).fill({
181
181
  // Instead of passing the actual screen sizes values, passing the same values per each screen size and recomputing it makes sure visually the change is smoother and not laggy
182
- small: c.value,
183
- medium: c.value,
184
- large: c.value
185
- }) : []), p = (n) => {
186
- d.value = n, o(n);
187
- }, _ = l(() => t.variant === "radio");
188
- return O(P, _), D(() => {
189
- t.itemsPerRow && Object.values(t.itemsPerRow).forEach((n) => {
190
- if (n && (n < 2 || n > 6))
182
+ small: d.value,
183
+ medium: d.value,
184
+ large: d.value
185
+ }) : []), f = (r) => {
186
+ p.value = r, o(r);
187
+ }, b = l(() => t.variant === "radio");
188
+ return N(P, b), O(() => {
189
+ t.itemsPerRow && Object.values(t.itemsPerRow).forEach((r) => {
190
+ const c = Number(r);
191
+ if (!Number.isInteger(c) || c < 1 || c > 6)
191
192
  throw new Error(
192
- "itemsPerRow values must have a value between 2 and 6 items per row. Read the documentation for more information."
193
+ "itemsPerRow values must have a value between 1 and 6 items per row. Read the documentation for more information."
193
194
  );
194
195
  });
195
- }), { __sfc: !0, props: t, emit: e, emitValue: o, slots: a, hasSlot: h, conditionalItemsClasses: r, inputValue: d, errorMessageId: w, shouldShowGroupError: B, containerRef: g, width: f, smallBreakpoint: C, mediumBreakpoint: k, currentBreakpoint: R, computedItemsPerRow: u, computedRows: x, itemColumnWidth: c, computedColumnWidth: m, onInput: p, isRadioVariant: _, BentoSelectionCard: ae, ControlsGroup: K, ErrorMessage: J, GridLayout: H };
196
+ }), { __sfc: !0, props: t, emit: e, emitValue: o, slots: a, hasSlot: h, conditionalItemsClasses: n, inputValue: p, errorMessageId: w, shouldShowGroupError: B, containerRef: g, width: m, smallBreakpoint: C, mediumBreakpoint: k, currentBreakpoint: R, computedItemsPerRow: u, computedRows: x, itemColumnWidth: d, computedColumnWidth: _, onInput: f, isRadioVariant: b, BentoSelectionCard: ae, ControlsGroup: K, ErrorMessage: J, GridLayout: H };
196
197
  }
197
198
  });
198
199
  var re = function() {
@@ -206,15 +207,15 @@ var re = function() {
206
207
  return [e._t("dynamicContent", null, null, a)];
207
208
  }, proxy: !0 } : null], null, !0) }, "bento-selection-card", a, !1));
208
209
  }), 1) : [t("div", { key: `selection-card-group-layout-breakpoint-${o.currentBreakpoint}` }, e._l(o.computedRows, function(a, h) {
209
- return t(o.GridLayout, { key: `selection-card-group-row-${h}-cols-${o.computedItemsPerRow}`, staticClass: "b-selection-card-group__items--wrap", attrs: { "column-width": o.computedColumnWidth }, scopedSlots: e._u([e._l(a, function(r, d) {
210
- return { key: `col-${Number(d) + 1}`, fn: function() {
211
- return [t(o.BentoSelectionCard, e._b({ key: `selection-card-${r.value}`, staticClass: "b-selection-card-group__item b-selection-card-group__item--full-height", attrs: { "model-value": o.inputValue, readonly: e.readonly || r.readonly, "has-error": o.shouldShowGroupError, disabled: e.disabled || r.disabled }, on: { "update:model-value": o.onInput }, scopedSlots: e._u([o.hasSlot("icon") && r.icon ? { key: "icon", fn: function() {
212
- return [e._t("icon", null, null, r)];
213
- }, proxy: !0 } : null, o.hasSlot("content") && r.content ? { key: "content", fn: function() {
214
- return [e._t("content", null, null, r)];
215
- }, proxy: !0 } : null, o.hasSlot("dynamicContent") && r.dynamicContent ? { key: "dynamicContent", fn: function() {
216
- return [e._t("dynamicContent", null, null, r)];
217
- }, proxy: !0 } : null], null, !0) }, "bento-selection-card", r, !1))];
210
+ return t(o.GridLayout, { key: `selection-card-group-row-${h}-cols-${o.computedItemsPerRow}`, staticClass: "b-selection-card-group__items--wrap", attrs: { "column-width": o.computedColumnWidth }, scopedSlots: e._u([e._l(a, function(n, p) {
211
+ return { key: `col-${Number(p) + 1}`, fn: function() {
212
+ return [t(o.BentoSelectionCard, e._b({ key: `selection-card-${n.value}`, staticClass: "b-selection-card-group__item b-selection-card-group__item--full-height", attrs: { "model-value": o.inputValue, readonly: e.readonly || n.readonly, "has-error": o.shouldShowGroupError, disabled: e.disabled || n.disabled }, on: { "update:model-value": o.onInput }, scopedSlots: e._u([o.hasSlot("icon") && n.icon ? { key: "icon", fn: function() {
213
+ return [e._t("icon", null, null, n)];
214
+ }, proxy: !0 } : null, o.hasSlot("content") && n.content ? { key: "content", fn: function() {
215
+ return [e._t("content", null, null, n)];
216
+ }, proxy: !0 } : null, o.hasSlot("dynamicContent") && n.dynamicContent ? { key: "dynamicContent", fn: function() {
217
+ return [e._t("dynamicContent", null, null, n)];
218
+ }, proxy: !0 } : null], null, !0) }, "bento-selection-card", n, !1))];
218
219
  }, proxy: !0 };
219
220
  })], null, !0) });
220
221
  }), 1)], o.shouldShowGroupError ? t(o.ErrorMessage, { staticClass: "b-selection-card-group__error-message", attrs: { id: o.errorMessageId, "error-message": e.errorMessage } }) : e._e()], 2);
@@ -224,7 +225,7 @@ var re = function() {
224
225
  se,
225
226
  !1,
226
227
  null,
227
- "f5ed58f5"
228
+ "c8bc60ad"
228
229
  );
229
230
  const Re = ie.exports;
230
231
  export {
@@ -232,4 +233,4 @@ export {
232
233
  S as a,
233
234
  Re as s
234
235
  };
235
- //# sourceMappingURL=selection-card-group.CGUEcVTZ.js.map
236
+ //# sourceMappingURL=selection-card-group.mAC1hrzJ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"selection-card-group.CGUEcVTZ.js","sources":["../../src/components/selection-card/selection-card.types.ts","../../src/components/selection-card/selection-card.keys.ts","../../src/components/selection-card/selection-card.vue","../../src/components/selection-card/components/selection-card-group/selection-card-group.vue"],"sourcesContent":["import { type RadioInputValue } from '@/components/internal/radio-input';\nimport { type BentoCheckboxType } from '@/types/checkbox';\nimport { type VueNodeElement } from '@/types/elements';\n\nexport enum BentoSelectionCardState {\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n\nexport type BentoSelectionCardValue = string | number;\n\nexport type BentoSelectionCardModelValue = BentoCheckboxType | RadioInputValue;\n\nexport interface BentoSelectionCardItem {\n content?: string | object;\n description?: string;\n disabled?: boolean;\n dynamicContent?: string | object;\n fullyClickable?: boolean;\n hasError?: boolean;\n icon?: VueNodeElement;\n readonly?: boolean;\n subtitle?: string;\n title: string;\n value: BentoSelectionCardValue;\n}\n","export const SELECTION_CARD_RADIO_INPUT_INJECTION_KEY = Symbol('selection card radio input injection key');\n","<template>\n <div class=\"b-selection-card\" :class=\"conditionalClasses\" @click=\"handleCardClick\">\n <div class=\"b-selection-card__container\" :class=\"containerConditionalClasses\">\n <div class=\"b-selection-card__checkbox-container\" :class=\"checkboxContainerConditionalClasses\">\n <div class=\"b-selection-card__checkbox-container-text\" :class=\"checkboxContainerTextConditionalClasses\">\n <div v-if=\"hasSlot('icon')\" class=\"b-selection-card__icon\" role=\"presentation\" aria-hidden=\"true\">\n <slot name=\"icon\" />\n </div>\n <label :for=\"inputId\" class=\"b-selection-card__text\" @click.stop.prevent=\"handleCardClick\">\n <bento-typography\n v-if=\"subtitle\"\n class=\"b-selection-card__description\"\n el=\"span\"\n variant=\"caption\"\n >\n {{ subtitle }}\n </bento-typography>\n <bento-typography el=\"span\" variant=\"title\">{{ title }}</bento-typography>\n <bento-typography\n v-if=\"description\"\n id=\"descriptionId\"\n class=\"b-selection-card__description\"\n el=\"span\"\n variant=\"body\"\n >\n {{ description }}\n </bento-typography>\n </label>\n </div>\n <radio-input\n v-if=\"isRadioInput\"\n :id=\"inputId\"\n ref=\"inputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"description ? descriptionId : undefined\"\n :disabled=\"disabled\"\n :has-error=\"hasError\"\n :aria-readonly=\"readonly ?? undefined\"\n :value=\"value\"\n :readonly=\"readonly\"\n :model-value=\"computedRadioInputModelValue\"\n />\n <checkbox-input\n v-else\n :id=\"inputId\"\n ref=\"inputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"description ? descriptionId : undefined\"\n :disabled=\"disabled\"\n :has-error=\"hasError\"\n :aria-readonly=\"readonly ?? undefined\"\n :value=\"value\"\n :readonly=\"readonly\"\n :model-value=\"computedCheckboxInputModelValue\"\n />\n </div>\n <bento-typography\n v-if=\"hasSlot('content')\"\n ref=\"slotRef\"\n el=\"div\"\n class=\"b-selection-card__slot\"\n :class=\"slotConditionalClasses\"\n >\n <slot name=\"content\" />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('dynamicContent') && isChecked\"\n ref=\"dynamicSlotRef\"\n el=\"div\"\n class=\"b-selection-card__slot\"\n :class=\"slotConditionalClasses\"\n >\n <slot name=\"dynamicContent\" />\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoTypography } from '@/components/typography';\n import { CheckboxInput } from '../internal/checkbox-input';\n import { RadioInput, type RadioInputValue } from '../internal/radio-input';\n import { type BentoCheckboxType, type BentoMultiCheckboxType } from '@/types/checkbox';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { generateUid } from '@/core/utils/ts';\n import { computed, type ComputedRef, inject, type PropType, type Ref, ref, useSlots } from 'vue';\n import { useHasSlot } from '@/composables';\n import type { BentoSelectionCardModelValue, BentoSelectionCardValue } from './selection-card.types';\n import { BentoSelectionCardState } from './selection-card.types';\n import { SELECTION_CARD_RADIO_INPUT_INJECTION_KEY } from './selection-card.keys';\n\n const props = defineProps({\n /**\n * The description of the selection card\n */\n description: {\n type: String,\n default: undefined,\n },\n\n /**\n * Disables the selection card\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Makes the entire selection card clickable. Clicking over interactive elements inside the card with this prop enabled will not be possible.\n */\n fullyClickable: { type: Boolean, default: false },\n\n /**\n * Shows the selection card in error state\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * This property should not be used directly.\n * It will be used by v-model directive on selection card component.\n *\n * When handling a single input, use a string or a number.\n *\n * When handling multiple inputs, use an array of keys.\n * These keys exist as a set \"value\" prop for each input.\n */\n modelValue: {\n type: [Boolean, String, Array] as PropType<BentoSelectionCardModelValue>,\n default: null,\n },\n\n /**\n * Sets the selection card to readonly\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * The subtitle of the selection card\n */\n subtitle: {\n type: String,\n default: undefined,\n },\n\n /**\n * The title of the selection card\n */\n title: {\n type: String,\n required: true,\n },\n\n /**\n * Indicates the value of the input that will be returned when it's checked.\n */\n value: {\n type: [String, Number] as PropType<BentoSelectionCardValue>,\n required: true,\n },\n });\n\n const emit = defineEmits([\"input\", \"update:model-value\"]);\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const inputId = generateUid('selection-card-input-id');\n const descriptionId = generateUid('selection-card-description');\n\n const computedRadioInputModelValue: ComputedRef<RadioInputValue> = computed(\n () => props.modelValue as RadioInputValue\n );\n const computedCheckboxInputModelValue: ComputedRef<BentoCheckboxType> = computed(\n () => props.modelValue as BentoCheckboxType\n );\n\n const conditionalClasses = computed(() => ({\n 'b-selection-card--checked': isChecked.value,\n 'b-selection-card--fully-clickable': props.fullyClickable,\n }));\n\n const containerConditionalClasses = computed(() => ({\n [`b-selection-card--${BentoSelectionCardState.DISABLED}`]: props.disabled,\n [`b-selection-card--${BentoSelectionCardState.ERROR}`]: props.hasError,\n [`b-selection-card--${BentoSelectionCardState.READONLY}`]: props.readonly,\n 'b-selection-card--center-aligned': isTitleOnly.value,\n }));\n\n const checkboxContainerConditionalClasses = computed(() => ({\n 'b-selection-card__checkbox-container--center-aligned': isTitleOnly.value,\n }));\n\n const checkboxContainerTextConditionalClasses = computed(() => ({\n 'b-selection-card__checkbox-container-text--center-aligned': isTitleOnly.value,\n }));\n\n const slotConditionalClasses = computed(() => ({\n 'b-selection-card__slot--with-icon': hasSlot('icon'),\n }));\n\n const ariaLabel = useAriaLabel({\n ariaLabel: props.title,\n label: props.value as string,\n });\n\n const isCheckboxGroup = computed(() => Array.isArray(props.modelValue));\n\n const isChecked: ComputedRef<boolean> = computed(() => {\n if (isRadioInput.value) {\n return props.value === props.modelValue;\n }\n if (!isCheckboxGroup.value) {\n return props.modelValue as boolean;\n }\n\n return (props.modelValue as BentoMultiCheckboxType).some(item => item === props.value);\n });\n\n const isRadioInput: Ref<boolean> = inject(SELECTION_CARD_RADIO_INPUT_INJECTION_KEY, ref(false));\n\n const isTitleOnly = computed(() => !props.subtitle && !props.description);\n\n const inputRef = ref<InstanceType<typeof RadioInput> | InstanceType<typeof CheckboxInput>>(null);\n const slotRef = ref(null);\n const dynamicSlotRef = ref(null);\n\n // Handle click on the whole card area\n const handleCardClick = (event: Event) => {\n if (inputRef.value.$refs.inputRef === event.target) {\n const newValue = toggleInput();\n onChange(newValue);\n return;\n }\n\n // Do nothing if disabled or readonly\n if (props.disabled && props.readonly) {\n return;\n }\n\n // If it's not fully clickable prevent selecting the card if the click\n // originated in a slot\n if (!props.fullyClickable) {\n // Check if the click originated from the slot - in that case, do nothng\n if (slotRef.value && slotRef.value?.$el?.contains(event.target)) {\n return;\n }\n // Check if the click originated from the dynamic slot - in that case, do nothng\n if (dynamicSlotRef.value && dynamicSlotRef.value?.$el?.contains(event.target)) {\n return;\n }\n // Check if the click originated from the input - in that case do nothing, as the input will emit the event already\n if (inputRef.value && inputRef.value?.$el?.contains(event.target as Node)) {\n return;\n }\n }\n\n // If the click originated outside of these two areas, emit the change event\n const newValue = toggleInput();\n\n onChange(newValue);\n };\n\n const toggleInput = (): BentoSelectionCardModelValue => {\n const currentValue: boolean = (inputRef.value?.$refs.inputRef as HTMLInputElement).checked;\n\n if (isCheckboxGroup.value) {\n const newCheckedList = [...(props.modelValue as BentoMultiCheckboxType)];\n const index = newCheckedList.indexOf(props.value);\n\n if (index === -1) {\n newCheckedList.push(props.value);\n } else {\n newCheckedList.splice(index, 1);\n }\n return newCheckedList;\n }\n\n if (isRadioInput.value) {\n return props.value;\n }\n return currentValue;\n };\n\n const onChange = newValue => {\n if (!props.disabled && !props.readonly) {\n emit('update:model-value', newValue);\n emit('input', newValue);\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Selection card component. If used standalone, only the checkbox variant can be used. If the checkbox variant is needed, please use the bento-selection-card-group component.\n *\n * @example\n * import { BentoSelectionCard } from '@adyen/bento-vue2';\n * import EmoticonHappyIcon from '@adyen/ui-assets-icons-16/vue/emoticon-happy';\n *\n * export default {\n * components: { BentoSelectionCard, EmoticonHappyIcon },\n * template: `\n * <bento-selection-card title=\"Card title\" :model-value.sync=\"yourModelValue\">\n * <template #icon>\n * <emoticon-happy-icon />\n * </template>\n * </bento-selection-card>\n * `\n * }\n */\n export default {\n name: 'bento-selection-card',\n };\n</script>\n<style lang=\"scss\" scoped src=\"./selection-card.scss\" />\n","<template>\n <controls-group\n ref=\"containerRef\"\n :aria-describedby=\"shouldShowGroupError ? errorMessageId : null\"\n :aria-required=\"required\"\n :label=\"label\"\n :hide-label=\"hideLabel\"\n :description=\"description\"\n :disabled=\"disabled\"\n :tooltip-text=\"tooltipText\"\n :readonly=\"readonly\"\n :required=\"required\"\n :optional=\"optional\"\n class=\"b-selection-card-group\"\n component-name=\"selection-card-group\"\n >\n <div\n v-if=\"!itemsPerRow || layout === 'vertical'\"\n class=\"b-selection-card-group__items\"\n :class=\"conditionalItemsClasses\"\n >\n <bento-selection-card\n v-for=\"item in items\"\n :key=\"`selection-card-${item.value}`\"\n class=\"b-selection-card-group__item\"\n v-bind=\"item\"\n :model-value=\"inputValue\"\n :readonly=\"readonly || item.readonly\"\n :has-error=\"shouldShowGroupError\"\n :disabled=\"disabled || item.disabled\"\n @update:model-value=\"onInput\"\n >\n <template v-if=\"hasSlot('icon') && item.icon\" #icon>\n <slot name=\"icon\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('content') && item.content\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('dynamicContent') && item.dynamicContent\" #dynamicContent>\n <slot name=\"dynamicContent\" v-bind=\"item\"></slot>\n </template>\n </bento-selection-card>\n </div>\n <template v-else>\n <div :key=\"`selection-card-group-layout-breakpoint-${currentBreakpoint}`\">\n <grid-layout\n v-for=\"(row, rowIndex) in computedRows\"\n :key=\"`selection-card-group-row-${rowIndex}-cols-${computedItemsPerRow}`\"\n class=\"b-selection-card-group__items--wrap\"\n :column-width=\"computedColumnWidth\"\n >\n <template v-for=\"(item, columnIndex) in row\" #[`col-${Number(columnIndex)+1}`]>\n <bento-selection-card\n :key=\"`selection-card-${item.value}`\"\n class=\"b-selection-card-group__item b-selection-card-group__item--full-height\"\n v-bind=\"item\"\n :model-value=\"inputValue\"\n :readonly=\"readonly || item.readonly\"\n :has-error=\"shouldShowGroupError\"\n :disabled=\"disabled || item.disabled\"\n @update:model-value=\"onInput\"\n >\n <template v-if=\"hasSlot('icon') && item.icon\" #icon>\n <slot name=\"icon\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('content') && item.content\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('dynamicContent') && item.dynamicContent\" #dynamicContent>\n <slot name=\"dynamicContent\" v-bind=\"item\"></slot>\n </template>\n </bento-selection-card>\n </template>\n </grid-layout>\n </div>\n </template>\n <error-message\n v-if=\"shouldShowGroupError\"\n :id=\"errorMessageId\"\n :error-message=\"errorMessage\"\n class=\"b-selection-card-group__error-message\"\n />\n </controls-group>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, provide, ref, useSlots, watch } from 'vue';\n import { useElementSize } from '@vueuse/core';\n import { BMediaQueryMMax, BMediaQuerySMax } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n import { type BentoSelectionCardGroupEmits, type BentoSelectionCardGroupProps } from './selection-card-group.types';\n import BentoSelectionCard from '../../selection-card.vue';\n import { ControlsGroup, ErrorMessage, GridLayout } from '../../../internal';\n import { SELECTION_CARD_RADIO_INPUT_INJECTION_KEY } from '../../selection-card.keys';\n import { generateUid } from '@/core/utils/ts';\n import { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\n\n const props = defineProps({\n description: { default: null },\n disabled: { type: Boolean, default: false },\n errorMessage: { default: null },\n label: { default: null },\n optional: { type: Boolean, default: false },\n placeholder: null,\n readonly: { type: Boolean, default: false },\n required: { type: Boolean, default: false },\n tooltipText: { default: null },\n formId: { default: null },\n hideLabel: { type: Boolean, default: null },\n layout: { default: 'vertical' },\n items: null,\n itemsPerRow: { default: undefined },\n modelValue: { default: null },\n variant: { default: 'checkbox' }\n});\n\n const emit = defineEmits([\"update:model-value\", \"input\"]);\n\n const { emitValue } = useFormFieldEmits(emit);\n\n const slots = useSlots();\n // Slots logic\n // Temporary, use-has-slots composable doesn't currently work for vue3 named scoped slots\n // We do the same in bento-checkbox-group\n const hasSlot = name => !!slots[name];\n\n const conditionalItemsClasses = computed(() => ({\n 'b-selection-card-group__items--horizontal': props.layout === 'horizontal',\n }));\n\n const inputValue = ref(props.modelValue);\n watch(\n () => props.modelValue,\n () => {\n inputValue.value = props.modelValue;\n }\n );\n\n // Error message logic\n const errorMessageId = generateUid('error');\n const shouldShowGroupError = computed(() => !props.disabled && !props.readonly && !!props.errorMessage);\n\n // itemsPerRow logic\n const containerRef = ref<HTMLElement | null>(null);\n const { width } = useElementSize(containerRef);\n\n const smallBreakpoint = computed(() => BMediaQuerySMax.split('px')[0]);\n const mediumBreakpoint = computed(() => BMediaQueryMMax.split('px')[0]);\n\n const currentBreakpoint = computed(() => {\n if (width.value < smallBreakpoint.value) {\n return 'small';\n }\n if (width.value >= smallBreakpoint.value && width.value < mediumBreakpoint.value) {\n return 'medium';\n }\n return 'large';\n });\n\n const computedItemsPerRow = computed(() => {\n return (props.itemsPerRow?.[currentBreakpoint?.value] as number) || props.items.length;\n });\n\n const computedRows = computed(() => {\n if (!props.itemsPerRow) {\n return [];\n }\n const rows = [];\n for (let i = 0; i < props.items.length; i += computedItemsPerRow?.value) {\n rows.push(props.items.slice(i, i + computedItemsPerRow?.value));\n }\n return rows;\n });\n\n // We need to compute the column width on 12 because we're using a 12-column system for out grid-layout logic\n const itemColumnWidth = computed(() => 12 / computedItemsPerRow?.value);\n\n /**\n * Filling the columnWidth array with the same parameters per item to pass\n * to the `grid-layout` layout so the each card can have\n * the same width according to the screen size.\n */\n const computedColumnWidth = computed(() => {\n return computedItemsPerRow?.value\n ? new Array(computedItemsPerRow?.value).fill({\n // Instead of passing the actual screen sizes values, passing the same values per each screen size and recomputing it makes sure visually the change is smoother and not laggy\n small: itemColumnWidth.value,\n medium: itemColumnWidth.value,\n large: itemColumnWidth.value,\n })\n : [];\n });\n\n const onInput = value => {\n inputValue.value = value;\n emitValue(value);\n };\n\n const isRadioVariant = computed(() => props.variant === 'radio');\n\n provide(SELECTION_CARD_RADIO_INPUT_INJECTION_KEY, isRadioVariant);\n\n onMounted(() => {\n if (props.itemsPerRow) {\n Object.values(props.itemsPerRow).forEach(el => {\n if (el && (el < 2 || el > 6)) {\n throw new Error(\n 'itemsPerRow values must have a value between 2 and 6 items per row. Read the documentation for more information.'\n );\n }\n });\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Group of bento-selection-cards.\n *\n * @example\n * import { BentoSelectionCardGroup } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSelectionCardGroup },\n * template: `\n * <bento-selection-card-group\n * :items=\"[\n * {\n * title: 'Card 1',\n * value: 'card-1',\n * content: 'Slot content 1',\n * icon: RetailIcon,\n * },\n * {\n * title: 'Card 2',\n * value: 'card-2',\n * content: 'Slot content 2',\n * icon: LeafIcon,\n * },\n * ]\"\n * >\n * <template #icon=\"{ icon }\">\n * <component :is=\"icon\"/>\n * </template>\n * <template #content=\"{ content }\">\n * <div>{{ content }}</div>\n * </template>\n * </bento-selection-card-group>\n * `,\n * }\n */\n export default {\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./selection-card-group.scss\" />\n"],"names":["BentoSelectionCardState","BentoSelectionCardState2","SELECTION_CARD_RADIO_INPUT_INJECTION_KEY","__default__$1","slots","useSlots","hasSlot","useHasSlot","inputId","generateUid","descriptionId","computedRadioInputModelValue","computed","props","computedCheckboxInputModelValue","conditionalClasses","isChecked","containerConditionalClasses","isTitleOnly","checkboxContainerConditionalClasses","checkboxContainerTextConditionalClasses","slotConditionalClasses","ariaLabel","useAriaLabel","isCheckboxGroup","isRadioInput","item","inject","ref","inputRef","slotRef","dynamicSlotRef","handleCardClick","event","newValue2","toggleInput","onChange","newValue","currentValue","newCheckedList","index","emit","__default__","emitValue","useFormFieldEmits","name","conditionalItemsClasses","inputValue","watch","errorMessageId","shouldShowGroupError","containerRef","width","useElementSize","smallBreakpoint","BMediaQuerySMax","mediumBreakpoint","BMediaQueryMMax","currentBreakpoint","computedItemsPerRow","computedRows","rows","i","itemColumnWidth","computedColumnWidth","onInput","value","isRadioVariant","provide","onMounted","el"],"mappings":";;;;;;;;;;;;;;;AAIO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SAHQA,IAAAD,KAAA,CAAA,CAAA;ACJL,MAAAE,IAAA,uBAAA,0CAAA,GCoTHC,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBArJAC,IAAAC,EAAA,GACAC,IAAAC,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,MAAA;AACI,MAAAnB,EAAA,QAAAmB,GACAvB,EAAAuB,CAAA;AAAA,IAAe,GAGnBC,IAAAvD,EAAA,MAAAC,EAAA,YAAA,OAAA;AAEA,WAAAuD,EAAAlE,GAAAiE,CAAA,GAEAE,EAAA,MAAA;AACI,MAAAxD,EAAA,eACI,OAAA,OAAAA,EAAA,WAAA,EAAA,QAAA,CAAAyD,MAAA;AACI,YAAAA,MAAAA,IAAA,KAAAA,IAAA;AACI,gBAAA,IAAA;AAAA,YAAU;AAAA,UACN;AAAA,MAER,CAAA;AAAA,IAER,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"selection-card-group.mAC1hrzJ.js","sources":["../../src/components/selection-card/selection-card.types.ts","../../src/components/selection-card/selection-card.keys.ts","../../src/components/selection-card/selection-card.vue","../../src/components/selection-card/components/selection-card-group/selection-card-group.vue"],"sourcesContent":["import { type RadioInputValue } from '@/components/internal/radio-input';\nimport { type BentoCheckboxType } from '@/types/checkbox';\nimport { type VueNodeElement } from '@/types/elements';\n\nexport enum BentoSelectionCardState {\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n\nexport type BentoSelectionCardValue = string | number;\n\nexport type BentoSelectionCardModelValue = BentoCheckboxType | RadioInputValue;\n\nexport interface BentoSelectionCardItem {\n content?: string | object;\n description?: string;\n disabled?: boolean;\n dynamicContent?: string | object;\n fullyClickable?: boolean;\n hasError?: boolean;\n icon?: VueNodeElement;\n readonly?: boolean;\n subtitle?: string;\n title: string;\n value: BentoSelectionCardValue;\n}\n","export const SELECTION_CARD_RADIO_INPUT_INJECTION_KEY = Symbol('selection card radio input injection key');\n","<template>\n <div class=\"b-selection-card\" :class=\"conditionalClasses\" @click=\"handleCardClick\">\n <div class=\"b-selection-card__container\" :class=\"containerConditionalClasses\">\n <div class=\"b-selection-card__checkbox-container\" :class=\"checkboxContainerConditionalClasses\">\n <div class=\"b-selection-card__checkbox-container-text\" :class=\"checkboxContainerTextConditionalClasses\">\n <div v-if=\"hasSlot('icon')\" class=\"b-selection-card__icon\" role=\"presentation\" aria-hidden=\"true\">\n <slot name=\"icon\" />\n </div>\n <label :for=\"inputId\" class=\"b-selection-card__text\" @click.stop.prevent=\"handleCardClick\">\n <bento-typography\n v-if=\"subtitle\"\n class=\"b-selection-card__description\"\n el=\"span\"\n variant=\"caption\"\n >\n {{ subtitle }}\n </bento-typography>\n <bento-typography el=\"span\" variant=\"title\">{{ title }}</bento-typography>\n <bento-typography\n v-if=\"description\"\n id=\"descriptionId\"\n class=\"b-selection-card__description\"\n el=\"span\"\n variant=\"body\"\n >\n {{ description }}\n </bento-typography>\n </label>\n </div>\n <radio-input\n v-if=\"isRadioInput\"\n :id=\"inputId\"\n ref=\"inputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"description ? descriptionId : undefined\"\n :disabled=\"disabled\"\n :has-error=\"hasError\"\n :aria-readonly=\"readonly ?? undefined\"\n :value=\"value\"\n :readonly=\"readonly\"\n :model-value=\"computedRadioInputModelValue\"\n />\n <checkbox-input\n v-else\n :id=\"inputId\"\n ref=\"inputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"description ? descriptionId : undefined\"\n :disabled=\"disabled\"\n :has-error=\"hasError\"\n :aria-readonly=\"readonly ?? undefined\"\n :value=\"value\"\n :readonly=\"readonly\"\n :model-value=\"computedCheckboxInputModelValue\"\n />\n </div>\n <bento-typography\n v-if=\"hasSlot('content')\"\n ref=\"slotRef\"\n el=\"div\"\n class=\"b-selection-card__slot\"\n :class=\"slotConditionalClasses\"\n >\n <slot name=\"content\" />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('dynamicContent') && isChecked\"\n ref=\"dynamicSlotRef\"\n el=\"div\"\n class=\"b-selection-card__slot\"\n :class=\"slotConditionalClasses\"\n >\n <slot name=\"dynamicContent\" />\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoTypography } from '@/components/typography';\n import { CheckboxInput } from '../internal/checkbox-input';\n import { RadioInput, type RadioInputValue } from '../internal/radio-input';\n import { type BentoCheckboxType, type BentoMultiCheckboxType } from '@/types/checkbox';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { generateUid } from '@/core/utils/ts';\n import { computed, type ComputedRef, inject, type PropType, type Ref, ref, useSlots } from 'vue';\n import { useHasSlot } from '@/composables';\n import type { BentoSelectionCardModelValue, BentoSelectionCardValue } from './selection-card.types';\n import { BentoSelectionCardState } from './selection-card.types';\n import { SELECTION_CARD_RADIO_INPUT_INJECTION_KEY } from './selection-card.keys';\n\n const props = defineProps({\n /**\n * The description of the selection card\n */\n description: {\n type: String,\n default: undefined,\n },\n\n /**\n * Disables the selection card\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Makes the entire selection card clickable. Clicking over interactive elements inside the card with this prop enabled will not be possible.\n */\n fullyClickable: { type: Boolean, default: false },\n\n /**\n * Shows the selection card in error state\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * This property should not be used directly.\n * It will be used by v-model directive on selection card component.\n *\n * When handling a single input, use a string or a number.\n *\n * When handling multiple inputs, use an array of keys.\n * These keys exist as a set \"value\" prop for each input.\n */\n modelValue: {\n type: [Boolean, String, Array] as PropType<BentoSelectionCardModelValue>,\n default: null,\n },\n\n /**\n * Sets the selection card to readonly\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * The subtitle of the selection card\n */\n subtitle: {\n type: String,\n default: undefined,\n },\n\n /**\n * The title of the selection card\n */\n title: {\n type: String,\n required: true,\n },\n\n /**\n * Indicates the value of the input that will be returned when it's checked.\n */\n value: {\n type: [String, Number] as PropType<BentoSelectionCardValue>,\n required: true,\n },\n });\n\n const emit = defineEmits([\"input\", \"update:model-value\"]);\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const inputId = generateUid('selection-card-input-id');\n const descriptionId = generateUid('selection-card-description');\n\n const computedRadioInputModelValue: ComputedRef<RadioInputValue> = computed(\n () => props.modelValue as RadioInputValue\n );\n const computedCheckboxInputModelValue: ComputedRef<BentoCheckboxType> = computed(\n () => props.modelValue as BentoCheckboxType\n );\n\n const conditionalClasses = computed(() => ({\n 'b-selection-card--checked': isChecked.value,\n 'b-selection-card--fully-clickable': props.fullyClickable,\n }));\n\n const containerConditionalClasses = computed(() => ({\n [`b-selection-card--${BentoSelectionCardState.DISABLED}`]: props.disabled,\n [`b-selection-card--${BentoSelectionCardState.ERROR}`]: props.hasError,\n [`b-selection-card--${BentoSelectionCardState.READONLY}`]: props.readonly,\n 'b-selection-card--center-aligned': isTitleOnly.value,\n }));\n\n const checkboxContainerConditionalClasses = computed(() => ({\n 'b-selection-card__checkbox-container--center-aligned': isTitleOnly.value,\n }));\n\n const checkboxContainerTextConditionalClasses = computed(() => ({\n 'b-selection-card__checkbox-container-text--center-aligned': isTitleOnly.value,\n }));\n\n const slotConditionalClasses = computed(() => ({\n 'b-selection-card__slot--with-icon': hasSlot('icon'),\n }));\n\n const ariaLabel = useAriaLabel({\n ariaLabel: props.title,\n label: props.value as string,\n });\n\n const isCheckboxGroup = computed(() => Array.isArray(props.modelValue));\n\n const isChecked: ComputedRef<boolean> = computed(() => {\n if (isRadioInput.value) {\n return props.value === props.modelValue;\n }\n if (!isCheckboxGroup.value) {\n return props.modelValue as boolean;\n }\n\n return (props.modelValue as BentoMultiCheckboxType).some(item => item === props.value);\n });\n\n const isRadioInput: Ref<boolean> = inject(SELECTION_CARD_RADIO_INPUT_INJECTION_KEY, ref(false));\n\n const isTitleOnly = computed(() => !props.subtitle && !props.description);\n\n const inputRef = ref<InstanceType<typeof RadioInput> | InstanceType<typeof CheckboxInput>>(null);\n const slotRef = ref(null);\n const dynamicSlotRef = ref(null);\n\n // Handle click on the whole card area\n const handleCardClick = (event: Event) => {\n if (inputRef.value.$refs.inputRef === event.target) {\n const newValue = toggleInput();\n onChange(newValue);\n return;\n }\n\n // Do nothing if disabled or readonly\n if (props.disabled && props.readonly) {\n return;\n }\n\n // If it's not fully clickable prevent selecting the card if the click\n // originated in a slot\n if (!props.fullyClickable) {\n // Check if the click originated from the slot - in that case, do nothng\n if (slotRef.value && slotRef.value?.$el?.contains(event.target)) {\n return;\n }\n // Check if the click originated from the dynamic slot - in that case, do nothng\n if (dynamicSlotRef.value && dynamicSlotRef.value?.$el?.contains(event.target)) {\n return;\n }\n // Check if the click originated from the input - in that case do nothing, as the input will emit the event already\n if (inputRef.value && inputRef.value?.$el?.contains(event.target as Node)) {\n return;\n }\n }\n\n // If the click originated outside of these two areas, emit the change event\n const newValue = toggleInput();\n\n onChange(newValue);\n };\n\n const toggleInput = (): BentoSelectionCardModelValue => {\n const currentValue: boolean = (inputRef.value?.$refs.inputRef as HTMLInputElement).checked;\n\n if (isCheckboxGroup.value) {\n const newCheckedList = [...(props.modelValue as BentoMultiCheckboxType)];\n const index = newCheckedList.indexOf(props.value);\n\n if (index === -1) {\n newCheckedList.push(props.value);\n } else {\n newCheckedList.splice(index, 1);\n }\n return newCheckedList;\n }\n\n if (isRadioInput.value) {\n return props.value;\n }\n return currentValue;\n };\n\n const onChange = newValue => {\n if (!props.disabled && !props.readonly) {\n emit('update:model-value', newValue);\n emit('input', newValue);\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Selection card component. If used standalone, only the checkbox variant can be used. If the checkbox variant is needed, please use the bento-selection-card-group component.\n *\n * @example\n * import { BentoSelectionCard } from '@adyen/bento-vue2';\n * import EmoticonHappyIcon from '@adyen/ui-assets-icons-16/vue/emoticon-happy';\n *\n * export default {\n * components: { BentoSelectionCard, EmoticonHappyIcon },\n * template: `\n * <bento-selection-card title=\"Card title\" :model-value.sync=\"yourModelValue\">\n * <template #icon>\n * <emoticon-happy-icon />\n * </template>\n * </bento-selection-card>\n * `\n * }\n */\n export default {\n name: 'bento-selection-card',\n };\n</script>\n<style lang=\"scss\" scoped src=\"./selection-card.scss\" />\n","<template>\n <controls-group\n ref=\"containerRef\"\n :aria-describedby=\"shouldShowGroupError ? errorMessageId : null\"\n :aria-required=\"required\"\n :label=\"label\"\n :hide-label=\"hideLabel\"\n :description=\"description\"\n :disabled=\"disabled\"\n :tooltip-text=\"tooltipText\"\n :readonly=\"readonly\"\n :required=\"required\"\n :optional=\"optional\"\n class=\"b-selection-card-group\"\n component-name=\"selection-card-group\"\n >\n <div\n v-if=\"!itemsPerRow || layout === 'vertical'\"\n class=\"b-selection-card-group__items\"\n :class=\"conditionalItemsClasses\"\n >\n <bento-selection-card\n v-for=\"item in items\"\n :key=\"`selection-card-${item.value}`\"\n class=\"b-selection-card-group__item\"\n v-bind=\"item\"\n :model-value=\"inputValue\"\n :readonly=\"readonly || item.readonly\"\n :has-error=\"shouldShowGroupError\"\n :disabled=\"disabled || item.disabled\"\n @update:model-value=\"onInput\"\n >\n <template v-if=\"hasSlot('icon') && item.icon\" #icon>\n <slot name=\"icon\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('content') && item.content\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('dynamicContent') && item.dynamicContent\" #dynamicContent>\n <slot name=\"dynamicContent\" v-bind=\"item\"></slot>\n </template>\n </bento-selection-card>\n </div>\n <template v-else>\n <div :key=\"`selection-card-group-layout-breakpoint-${currentBreakpoint}`\">\n <grid-layout\n v-for=\"(row, rowIndex) in computedRows\"\n :key=\"`selection-card-group-row-${rowIndex}-cols-${computedItemsPerRow}`\"\n class=\"b-selection-card-group__items--wrap\"\n :column-width=\"computedColumnWidth\"\n >\n <template v-for=\"(item, columnIndex) in row\" #[`col-${Number(columnIndex)+1}`]>\n <bento-selection-card\n :key=\"`selection-card-${item.value}`\"\n class=\"b-selection-card-group__item b-selection-card-group__item--full-height\"\n v-bind=\"item\"\n :model-value=\"inputValue\"\n :readonly=\"readonly || item.readonly\"\n :has-error=\"shouldShowGroupError\"\n :disabled=\"disabled || item.disabled\"\n @update:model-value=\"onInput\"\n >\n <template v-if=\"hasSlot('icon') && item.icon\" #icon>\n <slot name=\"icon\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('content') && item.content\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('dynamicContent') && item.dynamicContent\" #dynamicContent>\n <slot name=\"dynamicContent\" v-bind=\"item\"></slot>\n </template>\n </bento-selection-card>\n </template>\n </grid-layout>\n </div>\n </template>\n <error-message\n v-if=\"shouldShowGroupError\"\n :id=\"errorMessageId\"\n :error-message=\"errorMessage\"\n class=\"b-selection-card-group__error-message\"\n />\n </controls-group>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, provide, ref, useSlots, watch } from 'vue';\n import { useElementSize } from '@vueuse/core';\n import { BMediaQueryMMax, BMediaQuerySMax } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n import { type BentoSelectionCardGroupEmits, type BentoSelectionCardGroupProps } from './selection-card-group.types';\n import BentoSelectionCard from '../../selection-card.vue';\n import { ControlsGroup, ErrorMessage, GridLayout } from '../../../internal';\n import { SELECTION_CARD_RADIO_INPUT_INJECTION_KEY } from '../../selection-card.keys';\n import { generateUid } from '@/core/utils/ts';\n import { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\n\n const props = defineProps({\n description: { default: null },\n disabled: { type: Boolean, default: false },\n errorMessage: { default: null },\n label: { default: null },\n optional: { type: Boolean, default: false },\n placeholder: null,\n readonly: { type: Boolean, default: false },\n required: { type: Boolean, default: false },\n tooltipText: { default: null },\n formId: { default: null },\n hideLabel: { type: Boolean, default: null },\n layout: { default: 'vertical' },\n items: null,\n itemsPerRow: { default: undefined },\n modelValue: { default: null },\n variant: { default: 'checkbox' }\n});\n\n const emit = defineEmits([\"update:model-value\", \"input\"]);\n\n const { emitValue } = useFormFieldEmits(emit);\n\n const slots = useSlots();\n // Slots logic\n // Temporary, use-has-slots composable doesn't currently work for vue3 named scoped slots\n // We do the same in bento-checkbox-group\n const hasSlot = name => !!slots[name];\n\n const conditionalItemsClasses = computed(() => ({\n 'b-selection-card-group__items--horizontal': props.layout === 'horizontal',\n }));\n\n const inputValue = ref(props.modelValue);\n watch(\n () => props.modelValue,\n () => {\n inputValue.value = props.modelValue;\n }\n );\n\n // Error message logic\n const errorMessageId = generateUid('error');\n const shouldShowGroupError = computed(() => !props.disabled && !props.readonly && !!props.errorMessage);\n\n // itemsPerRow logic\n const containerRef = ref<HTMLElement | null>(null);\n const { width } = useElementSize(containerRef);\n\n const smallBreakpoint = computed(() => BMediaQuerySMax.split('px')[0]);\n const mediumBreakpoint = computed(() => BMediaQueryMMax.split('px')[0]);\n\n const currentBreakpoint = computed(() => {\n if (width.value < smallBreakpoint.value) {\n return 'small';\n }\n if (width.value >= smallBreakpoint.value && width.value < mediumBreakpoint.value) {\n return 'medium';\n }\n return 'large';\n });\n\n const computedItemsPerRow = computed(() => {\n return (props.itemsPerRow?.[currentBreakpoint?.value] as number) || props.items.length;\n });\n\n const computedRows = computed(() => {\n if (!props.itemsPerRow) {\n return [];\n }\n const rows = [];\n for (let i = 0; i < props.items.length; i += computedItemsPerRow?.value) {\n rows.push(props.items.slice(i, i + computedItemsPerRow?.value));\n }\n return rows;\n });\n\n // We need to compute the column width on 12 because we're using a 12-column system for out grid-layout logic\n const itemColumnWidth = computed(() => 12 / computedItemsPerRow?.value);\n\n /**\n * Filling the columnWidth array with the same parameters per item to pass\n * to the `grid-layout` layout so the each card can have\n * the same width according to the screen size.\n */\n const computedColumnWidth = computed(() => {\n return computedItemsPerRow?.value\n ? new Array(computedItemsPerRow?.value).fill({\n // Instead of passing the actual screen sizes values, passing the same values per each screen size and recomputing it makes sure visually the change is smoother and not laggy\n small: itemColumnWidth.value,\n medium: itemColumnWidth.value,\n large: itemColumnWidth.value,\n })\n : [];\n });\n\n const onInput = value => {\n inputValue.value = value;\n emitValue(value);\n };\n\n const isRadioVariant = computed(() => props.variant === 'radio');\n\n provide(SELECTION_CARD_RADIO_INPUT_INJECTION_KEY, isRadioVariant);\n\n onMounted(() => {\n if (props.itemsPerRow) {\n Object.values(props.itemsPerRow).forEach(value => {\n const numericValue = Number(value);\n if (!Number.isInteger(numericValue) || numericValue < 1 || numericValue > 6) {\n throw new Error(\n 'itemsPerRow values must have a value between 1 and 6 items per row. Read the documentation for more information.'\n );\n }\n });\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Group of bento-selection-cards.\n *\n * @example\n * import { BentoSelectionCardGroup } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSelectionCardGroup },\n * template: `\n * <bento-selection-card-group\n * :items=\"[\n * {\n * title: 'Card 1',\n * value: 'card-1',\n * content: 'Slot content 1',\n * icon: RetailIcon,\n * },\n * {\n * title: 'Card 2',\n * value: 'card-2',\n * content: 'Slot content 2',\n * icon: LeafIcon,\n * },\n * ]\"\n * >\n * <template #icon=\"{ icon }\">\n * <component :is=\"icon\"/>\n * </template>\n * <template #content=\"{ content }\">\n * <div>{{ content }}</div>\n * </template>\n * </bento-selection-card-group>\n * `,\n * }\n */\n export default {\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./selection-card-group.scss\" />\n"],"names":["BentoSelectionCardState","BentoSelectionCardState2","SELECTION_CARD_RADIO_INPUT_INJECTION_KEY","__default__$1","slots","useSlots","hasSlot","useHasSlot","inputId","generateUid","descriptionId","computedRadioInputModelValue","computed","props","computedCheckboxInputModelValue","conditionalClasses","isChecked","containerConditionalClasses","isTitleOnly","checkboxContainerConditionalClasses","checkboxContainerTextConditionalClasses","slotConditionalClasses","ariaLabel","useAriaLabel","isCheckboxGroup","isRadioInput","item","inject","ref","inputRef","slotRef","dynamicSlotRef","handleCardClick","event","newValue2","toggleInput","onChange","newValue","currentValue","newCheckedList","index","emit","__default__","emitValue","useFormFieldEmits","name","conditionalItemsClasses","inputValue","watch","errorMessageId","shouldShowGroupError","containerRef","width","useElementSize","smallBreakpoint","BMediaQuerySMax","mediumBreakpoint","BMediaQueryMMax","currentBreakpoint","computedItemsPerRow","computedRows","rows","i","itemColumnW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AAE,EAAA,KAAAhD,EAAA,MAAA,MAAAiD,GAAAA,IAAAH,GAAA,KAAA,CAAA;AAEJ,aAAAE;AAAA,IAAO,CAAA,GAIXE,IAAAnD,EAAA,MAAA,KAAA+C,GAAA,KAAA,GAOAK,IAAApD,EAAA,MACI+C,GAAA,QAAA,IAAA,MAAAA,GAAA,KAAA,EAAA,KAAA;AAAA;AAAA,MACiD,OAAAI,EAAA;AAAA,MAEhB,QAAAA,EAAA;AAAA,MACC,OAAAA,EAAA;AAAA,IACD,CAAA,IAAA,CAAA,CAE1B,GAGXE,IAAA,CAAAC,MAAA;AACI,MAAAnB,EAAA,QAAAmB,GACAvB,EAAAuB,CAAA;AAAA,IAAe,GAGnBC,IAAAvD,EAAA,MAAAC,EAAA,YAAA,OAAA;AAEA,WAAAuD,EAAAlE,GAAAiE,CAAA,GAEAE,EAAA,MAAA;AACI,MAAAxD,EAAA,eACI,OAAA,OAAAA,EAAA,WAAA,EAAA,QAAA,CAAAqD,MAAA;AACI,cAAAI,IAAA,OAAAJ,CAAA;AACA,YAAA,CAAA,OAAA,UAAAI,CAAA,KAAAA,IAAA,KAAAA,IAAA;AACI,gBAAA,IAAA;AAAA,YAAU;AAAA,UACN;AAAA,MAER,CAAA;AAAA,IAER,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -55,7 +55,7 @@ const Ee = {
55
55
  const e = r, o = se(), { height: f } = P(e), H = fe("textarea"), l = u(null), _ = u(null), n = u(e.modelValue || e.value), d = 44, x = u(e.height || `${d}px`), C = u(0), g = u("100%"), h = u(!1);
56
56
  let L = null, E = null;
57
57
  const { t: I, n: T } = be(), { isReadOnly: b } = ve(ne(e, "readonly")), { emitValue: B } = ye(a), W = i(() => `${T(n?.value?.length ?? 0)} / ${T(e.characterLimit)}`), m = i(() => !f.value), A = i(
58
- () => e.characterLimit && n.value.length > e.characterLimit
58
+ () => e.characterLimit && (n.value?.length ?? 0) > e.characterLimit
59
59
  ), y = () => {
60
60
  if (l.value) {
61
61
  const s = Math.max(
@@ -167,10 +167,10 @@ var Ae = function() {
167
167
  Re,
168
168
  !1,
169
169
  null,
170
- "a10ed22b"
170
+ "7585ceb1"
171
171
  );
172
172
  const Ke = Me.exports;
173
173
  export {
174
174
  Ke as B
175
175
  };
176
- //# sourceMappingURL=textarea.ec4ubFuL.js.map
176
+ //# sourceMappingURL=textarea.DmEgZbGe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textarea.DmEgZbGe.js","sources":["../../src/components/textarea/textarea.types.ts","../../src/components/textarea/textarea.vue"],"sourcesContent":["import type { FormField } from '../../types/form-field';\n\n/**\n * @deprecated Since v2.0.0. Use 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 UPDATE_MODEL_VALUE = 'update:model-value',\n KEYDOWN = 'keydown',\n KEYUP = 'keyup',\n}\n\nexport interface BentoTextareaProps extends FormField {\n /**\n * Text that labels the input element\n * @default undefined\n */\n ariaLabel?: string;\n\n /**\n * Text that shows number of characters in textarea\n * @default undefined\n */\n characterLimit?: number;\n\n /**\n * If set to true, shows a button to clear all the text\n * @default false\n */\n clearable?: boolean;\n\n /**\n * Sets the height of the textarea, e.g 200px OR 20vh\n * @default null\n */\n height?: string | null;\n\n /**\n * Indicates the possibility of resize the textarea.\n * Accepts the Enum or the string literal version.\n * @default BentoTextareaResizeOption.BOTH\n */\n resizable?: BentoTextareaResizeOption | `${BentoTextareaResizeOption}`;\n\n /**\n * Text displayed as the value of the textarea\n * @deprecated Since v2.0.0. Use `v-model` or `model-value` instead.\n */\n value?: string;\n\n /**\n * Text displayed as the value of the textarea\n */\n modelValue?: string;\n}\n","<template>\n <div ref=\"textareaComponent\" class=\"b-textarea\" :class=\"conditionalClasses\">\n <div :style=\"{ width: textareaWrapperWidth }\">\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 :required=\"required\"\n :aria-required=\"required\"\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 @keydown=\"onKeyDown\"\n @keyup=\"onKeyUp\"\n @mousedown=\"onMouseDown\"\n @mouseup=\"onMouseUp\"\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 </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, onMounted, onUnmounted, 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 '@/core/utils/ts';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useI18n } from '@/utils/ts/i18n';\n import { deprecate } from '@/utils/ts/deprecate';\n import { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\n\n // Composables\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n // Constants\n import { BBorderWidthAttention } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n\n // Types\n import { BentoTextareaEvent, type BentoTextareaProps, 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 description: { default: '' },\n disabled: { type: Boolean, default: false },\n errorMessage: { default: '' },\n label: { default: '' },\n optional: { type: Boolean, default: false },\n placeholder: { default: '' },\n readonly: { type: Boolean, default: false },\n required: { type: Boolean, default: false },\n tooltipText: { default: null },\n ariaLabel: { default: undefined },\n characterLimit: { default: undefined },\n clearable: { type: Boolean, default: false },\n height: { default: null },\n resizable: { default: 'both' },\n value: { default: '' },\n modelValue: { default: '' }\n});\n\n const emit = defineEmits([]);\n\n const { height } = toRefs(props);\n\n const textareaId = generateUid('textarea');\n const textareaElement = ref<HTMLTextAreaElement>(null);\n const textareaComponent = ref<HTMLDivElement>(null);\n const textareaValue = ref(props.modelValue || props.value);\n const defaultTextareaHeight = 44;\n const textareaHeight = ref(props.height || `${defaultTextareaHeight}px`);\n const userSetHeight = ref<number>(0);\n const textareaWrapperWidth = ref('100%'); // The width set to the wrapper of the label, textarea and description\n const isUserResizing = ref(false);\n let textareaElementObserver: ResizeObserver | null = null;\n let textareaComponentObserver: ResizeObserver | null = null;\n\n const { t, n } = useI18n<{ message: MessageSchema }>({ messages });\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const { emitValue } = useFormFieldEmits<string>(emit);\n\n const counter = computed(() => `${n(textareaValue?.value?.length ?? 0)} / ${n(props.characterLimit)}`);\n const isDynamicHeight = computed(() => !height.value);\n const isOverCharacterLimit = computed(\n () => props.characterLimit && (textareaValue.value?.length ?? 0) > props.characterLimit\n );\n\n /**\n * Calculates and sets the height of the textarea.\n * The height is determined by the maximum of the following values:\n *\n * 1. The content's scroll height (with a minimum of `defaultTextareaHeight`) + the border width.\n * 2. The height set by the user manually resizing the textarea (`userSetHeight`).\n * 3. The default minimum height (`defaultTextareaHeight`).\n *\n * This ensures the textarea grows with content, shrinks when content is removed,\n * but never goes below the manually set height or the default height.\n */\n const calculateHeight = () => {\n if (textareaElement.value) {\n const newHeight = Math.max(\n textareaElement.value.scrollHeight <= defaultTextareaHeight\n ? defaultTextareaHeight\n : textareaElement.value.scrollHeight + TEXTAREA_BORDER_WIDTH * 2,\n userSetHeight.value,\n defaultTextareaHeight\n );\n textareaHeight.value = `${newHeight}px`;\n }\n };\n\n watch(height, () => {\n if (isDynamicHeight.value) {\n calculateHeight();\n } else {\n textareaHeight.value = height.value;\n }\n });\n\n watch(\n () => [props.value, props.modelValue],\n () => {\n textareaValue.value = props.modelValue || props.value;\n },\n { immediate: true }\n );\n\n watch(\n () => textareaValue.value,\n async () => {\n if (isDynamicHeight.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`]: isDynamicHeight.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 emitValue('');\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 emitValue(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 const onKeyDown = (event: KeyboardEvent) => {\n event.stopPropagation();\n emit(BentoTextareaEvent.KEYDOWN, event);\n };\n\n const onKeyUp = (event: KeyboardEvent) => {\n event.stopPropagation();\n emit(BentoTextareaEvent.KEYUP, event);\n };\n\n const onMouseDown = () => {\n isUserResizing.value = true;\n };\n\n const onMouseUp = () => {\n isUserResizing.value = false;\n };\n\n /**\n * Updates the textarea width depending if the container or the user update its size.\n * @param isTextareaElement - sets to true if the element being observed is the textarea HTML element.\n */\n const resizeTextareaWrapper = (isTextareaElement = false) => {\n // Width assigned by the browser whenever the textarea is manually resized. String of the format `<value>px`.\n const textareaStyleWidth = textareaElement.value.style.width;\n\n // Make sure the tracked textareaHeight is always in sync with the height size in case we manually resize the textarea\n if (textareaElement.value.style.height) {\n if (isUserResizing.value) {\n userSetHeight.value = parseInt(textareaElement.value.style.height, 10);\n }\n textareaHeight.value = textareaElement.value.style.height;\n }\n\n // If the textarea element observer is being triggered, but there's no textareaStyleWidth, we want to ignore it, as no manual resize as happened yet\n // The component wrapper will handle the resizing logic instead\n if (isTextareaElement && !textareaStyleWidth) {\n return;\n }\n\n // Width of the whole bento-textarea component\n const textareaComponentWidth = textareaComponent?.value?.offsetWidth;\n\n // If there is no textareaStyleWidth or the textareaStyleWidth is larger than the component container, the wrapper should be 100% of the container\n if (!textareaStyleWidth || parseInt(textareaStyleWidth, 10) > textareaComponentWidth) {\n textareaWrapperWidth.value = '100%';\n } else {\n // Else the wrapper should always be as wide as the textarea element itself\n textareaWrapperWidth.value = textareaStyleWidth;\n }\n };\n\n const focus = () => {\n textareaElement.value.focus();\n };\n\n defineExpose({\n focus,\n });\n\n onMounted(() => {\n textareaElementObserver = observeSizeOfElement(textareaElement.value, () => {\n resizeTextareaWrapper(true);\n });\n\n textareaComponentObserver = observeSizeOfElement(textareaComponent.value, () => {\n resizeTextareaWrapper();\n });\n\n if (isDynamicHeight.value) {\n calculateHeight();\n }\n\n if (props.value) {\n deprecate(\n 'BentoTextarea \"value\" property',\n `The use of \"value\" prop in \"BentoTextarea\" is no longer supported.\n Use the \"v-model\" or \"model-value\" property instead.`,\n '2.0.0'\n );\n }\n });\n\n onUnmounted(() => {\n textareaElementObserver?.disconnect();\n textareaComponentObserver?.disconnect();\n });\n</script>\n\n<script lang=\"ts\">\n const TEXTAREA_BORDER_WIDTH = parseFloat(BBorderWidthAttention);\n\n export default {\n i18n: { messages },\n name: 'bento-textarea',\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./textarea.scss\" />\n"],"names":["BentoTextareaStateClass","BentoTextareaStateClass2","BentoTextareaEvent","BentoTextareaEvent2","TEXTAREA_BORDER_WIDTH","BBorderWidthAttention","__default__","messages","attrs","useAttrs","height","toRefs","props","textareaId","generateUid","textareaElement","ref","textareaComponent","textareaValue","defaultTextareaHeight","textareaHeight","userSetHeight","textareaWrapperWidth","isUserResizing","textareaElementObserver","textareaComponentObserver","t","n","useI18n","isReadOnly","useFormLayoutFieldLoading","toRef","emitValue","useFormFieldEmits","emit","counter","computed","isDynamicHeight","isOverCharacterLimit","calculateHeight","newHeight","watch","nextTick","invalidInput","conditionalClasses","conditionalClassesInput","conditionalClassesLabelBox","conditionalClassesLabelItem","counterErrorText","ariaLabelAttribute","ariaLabel","label","computedAriaLabel","useAriaLabel","showClearButton","onClear","onInput","event","onBlur","onFocus","onChange","onPressEscape","onKeyDown","onKeyUp","onMouseDown","onMouseUp","resizeTextareaWrapper","isTextareaElement","textareaStyleWidth","textareaComponentWidth","focus","expose","onMounted","observeSizeOfElement","deprecate","onUnmounted"],"mappings":";;;;;;;;;;;;;;;AAYO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,YAAA,aACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SACAA,EAAA,WAAA,YAJQA,IAAAD,KAAA,CAAA,CAAA,GAOLE,IAAA,kBAAAC,OACHA,EAAA,OAAA,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AAA,EAAA,gBAAA,GACAvB,EAAAhC,EAAA,OAAAuD,CAAA;AAAA,IAAoC,GAGxCO,KAAA,MAAA;AACI,MAAAzC,EAAA,QAAA;AAAA,IAAuB,GAG3B0C,KAAA,MAAA;AACI,MAAA1C,EAAA,QAAA;AAAA,IAAuB,GAO3B2C,IAAA,CAAAC,IAAA,OAAA;AAEI,YAAAC,IAAArD,EAAA,MAAA,MAAA;AAYA,UATAA,EAAA,MAAA,MAAA,WACIQ,EAAA,UACIF,EAAA,QAAA,SAAAN,EAAA,MAAA,MAAA,QAAA,EAAA,IAEJK,EAAA,QAAAL,EAAA,MAAA,MAAA,SAKJoD,KAAA,CAAAC;AACI;AAIJ,YAAAC,KAAApD,GAAA,OAAA;AAGA,MAAA,CAAAmD,KAAA,SAAAA,GAAA,EAAA,IAAAC,KACI/C,EAAA,QAAA,SAGAA,EAAA,QAAA8C;AAAA,IACJ,GAGJE,IAAA,MAAA;AACI,MAAAvD,EAAA,MAAA,MAAA;AAAA,IAA4B;AAGhC,WAAAwD,EAAA;AAAA,MAAa,OAAAD;AAAA,IACT,CAAA,GAGJE,GAAA,MAAA;AACI,MAAAhD,IAAAiD,EAAA1D,EAAA,OAAA,MAAA;AACI,QAAAmD,EAAA,EAAA;AAAA,MAA0B,CAAA,GAG9BzC,IAAAgD,EAAAxD,EAAA,OAAA,MAAA;AACI,QAAAiD,EAAA;AAAA,MAAsB,CAAA,GAG1B7B,EAAA,SACIE,EAAA,GAGJ3B,EAAA,SACI8D;AAAA,QAAA;AAAA,QACI;AAAA;AAAA,QACA;AAAA,MAEA;AAAA,IAER,CAAA,GAGJC,GAAA,MAAA;AACI,MAAAnD,GAAA,WAAA,GACAC,GAAA,WAAA;AAAA,IAAsC,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as S, computed as o, ref as N, toRefs as W, watch as X, provide as A, nextTick as Z, useSlots as Q, inject as O, onUnmounted as ee } from "vue";
2
2
  import { B as P } from "./button.C4kKejsg.js";
3
- import { B as te } from "./textarea.ec4ubFuL.js";
3
+ import { B as te } from "./textarea.DmEgZbGe.js";
4
4
  import { u as H } from "./index.CPOlyau9.js";
5
5
  import { B as se } from "./button-actions.DDLh7iWK.js";
6
6
  import { n as R } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
@@ -249,4 +249,4 @@ export {
249
249
  we as d,
250
250
  tt as t
251
251
  };
252
- //# sourceMappingURL=timeline-item.BoaJTmzW.js.map
252
+ //# sourceMappingURL=timeline-item.BLHykoIV.js.map