@adyen/bento-vue2 1.40.0 → 1.42.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.
Files changed (213) hide show
  1. package/dist/@types/components.d.ts +10 -0
  2. package/dist/@types/index.d.ts +1041 -391
  3. package/dist/action-bar.js +1 -1
  4. package/dist/alert.js +1 -1
  5. package/dist/assets/accordion-item.css +1 -1
  6. package/dist/assets/action-bar.css +1 -1
  7. package/dist/assets/base-modal.css +1 -1
  8. package/dist/assets/card.css +1 -1
  9. package/dist/assets/currency.css +1 -1
  10. package/dist/assets/data-grid.css +1 -1
  11. package/dist/assets/dialog-page.css +1 -1
  12. package/dist/assets/file-uploader.css +1 -0
  13. package/dist/assets/filter-bar.css +1 -1
  14. package/dist/assets/input-field-password.css +1 -0
  15. package/dist/assets/input-field.css +1 -1
  16. package/dist/assets/inspector.css +1 -1
  17. package/dist/assets/layout-row.css +1 -0
  18. package/dist/assets/menu.css +1 -1
  19. package/dist/assets/modal-fullscreen.css +1 -1
  20. package/dist/assets/popover.css +1 -1
  21. package/dist/assets/promo-banner.css +1 -0
  22. package/dist/assets/selection-card-group.css +1 -1
  23. package/dist/assets/sidepanel.css +1 -1
  24. package/dist/assets/step.css +1 -1
  25. package/dist/assets/structured-list-item.css +1 -1
  26. package/dist/assets/tooltip.css +1 -1
  27. package/dist/button.js +2 -2
  28. package/dist/card.js +1 -1
  29. package/dist/checkbox.js +2 -2
  30. package/dist/chunks/{action-bar.DJmskrzB.js → action-bar.C1iwQWyj.js} +5 -5
  31. package/dist/chunks/{action-bar.DJmskrzB.js.map → action-bar.C1iwQWyj.js.map} +1 -1
  32. package/dist/chunks/{alert.Y4JUnmhl.js → alert.D2Z_aiFC.js} +19 -19
  33. package/dist/chunks/{alert.Y4JUnmhl.js.map → alert.D2Z_aiFC.js.map} +1 -1
  34. package/dist/chunks/{base-modal.SJX9uGT4.js → base-modal.DroVbSCn.js} +2 -2
  35. package/dist/chunks/{base-modal.SJX9uGT4.js.map → base-modal.DroVbSCn.js.map} +1 -1
  36. package/dist/chunks/{button-actions-with-menu.DZOHTxUi.js → button-actions-with-menu.dp6C-PKX.js} +4 -4
  37. package/dist/chunks/{button-actions-with-menu.DZOHTxUi.js.map → button-actions-with-menu.dp6C-PKX.js.map} +1 -1
  38. package/dist/chunks/{button-actions.BJMK3kZC.js → button-actions.Cpx4PQp0.js} +2 -2
  39. package/dist/chunks/{button-actions.BJMK3kZC.js.map → button-actions.Cpx4PQp0.js.map} +1 -1
  40. package/dist/chunks/{card.Cfj-r6CX.js → card.BcjxzwZV.js} +2 -2
  41. package/dist/chunks/{card.Cfj-r6CX.js.map → card.BcjxzwZV.js.map} +1 -1
  42. package/dist/chunks/{checkbox-group.BEI5FPnW.js → checkbox-group.B1FsPVSl.js} +4 -4
  43. package/dist/chunks/{checkbox-group.BEI5FPnW.js.map → checkbox-group.B1FsPVSl.js.map} +1 -1
  44. package/dist/chunks/{checkbox.5uVM-HLg.js → checkbox.kd1EnszA.js} +16 -16
  45. package/dist/chunks/{checkbox.5uVM-HLg.js.map → checkbox.kd1EnszA.js.map} +1 -1
  46. package/dist/chunks/{checkmark-circle-fill.DVl6QSwm.js → checkmark-circle-fill.Cn7JN_Tk.js} +5 -5
  47. package/dist/chunks/{checkmark-circle-fill.DVl6QSwm.js.map → checkmark-circle-fill.Cn7JN_Tk.js.map} +1 -1
  48. package/dist/chunks/{code-snippet.CmBhucys.js → code-snippet.DGMVhQoj.js} +6 -6
  49. package/dist/chunks/{code-snippet.CmBhucys.js.map → code-snippet.DGMVhQoj.js.map} +1 -1
  50. package/dist/chunks/{controls-group.Sni8leS5.js → controls-group.J8shO_JL.js} +2 -2
  51. package/dist/chunks/{controls-group.Sni8leS5.js.map → controls-group.J8shO_JL.js.map} +1 -1
  52. package/dist/chunks/{copy.C5j6vSQT.js → copy.DgzxvExj.js} +2 -2
  53. package/dist/chunks/{copy.C5j6vSQT.js.map → copy.DgzxvExj.js.map} +1 -1
  54. package/dist/chunks/{currency.CEqsVP2T.js → currency.P7Psn_SK.js} +53 -61
  55. package/dist/chunks/currency.P7Psn_SK.js.map +1 -0
  56. package/dist/chunks/{dashboard-section.9R8bIh92.js → dashboard-section.D8ey7nzl.js} +3 -3
  57. package/dist/chunks/{dashboard-section.9R8bIh92.js.map → dashboard-section.D8ey7nzl.js.map} +1 -1
  58. package/dist/chunks/{dashed-underline.6Aw4MP34.js → dashed-underline.dGO33Q_E.js} +3 -3
  59. package/dist/chunks/{dashed-underline.6Aw4MP34.js.map → dashed-underline.dGO33Q_E.js.map} +1 -1
  60. package/dist/chunks/{data-grid-template.Bhotcrsr.js → data-grid-template.BF7JMfoJ.js} +2 -2
  61. package/dist/chunks/{data-grid-template.Bhotcrsr.js.map → data-grid-template.BF7JMfoJ.js.map} +1 -1
  62. package/dist/chunks/{data-grid.Czo9hi7m.js → data-grid.bti50Fs6.js} +920 -916
  63. package/dist/chunks/data-grid.bti50Fs6.js.map +1 -0
  64. package/dist/chunks/{date-picker.lFLlAGXs.js → date-picker.Dfg1_eo6.js} +3 -3
  65. package/dist/chunks/{date-picker.lFLlAGXs.js.map → date-picker.Dfg1_eo6.js.map} +1 -1
  66. package/dist/chunks/{date-range-picker.Cr_YCwxP.js → date-range-picker.BvHFTptS.js} +7 -7
  67. package/dist/chunks/{date-range-picker.Cr_YCwxP.js.map → date-range-picker.BvHFTptS.js.map} +1 -1
  68. package/dist/chunks/dot.BCX4w7eT.js +24 -0
  69. package/dist/chunks/dot.BCX4w7eT.js.map +1 -0
  70. package/dist/chunks/{dropdown-tag.BPkMWSmY.js → dropdown-tag.DqgJnpjk.js} +3 -3
  71. package/dist/chunks/{dropdown-tag.BPkMWSmY.js.map → dropdown-tag.DqgJnpjk.js.map} +1 -1
  72. package/dist/chunks/{dropdown.D8xKm1YA.js → dropdown.2tXfuDlU.js} +4 -4
  73. package/dist/chunks/{dropdown.D8xKm1YA.js.map → dropdown.2tXfuDlU.js.map} +1 -1
  74. package/dist/chunks/{error-message.Bk2maRF8.js → error-message.B7uoqQpq.js} +2 -2
  75. package/dist/chunks/{error-message.Bk2maRF8.js.map → error-message.B7uoqQpq.js.map} +1 -1
  76. package/dist/chunks/es6.b4enG1py.js +10 -0
  77. package/dist/chunks/es6.b4enG1py.js.map +1 -0
  78. package/dist/chunks/file-uploader.CK-Frs_q.js +728 -0
  79. package/dist/chunks/file-uploader.CK-Frs_q.js.map +1 -0
  80. package/dist/chunks/{filter-bar.dQZY8j9C.js → filter-bar.DP_nQeeo.js} +702 -697
  81. package/dist/chunks/filter-bar.DP_nQeeo.js.map +1 -0
  82. package/dist/chunks/{footer-actions.B68XcD93.js → footer-actions.DwnLB4NW.js} +2 -2
  83. package/dist/chunks/{footer-actions.B68XcD93.js.map → footer-actions.DwnLB4NW.js.map} +1 -1
  84. package/dist/chunks/{form-layout-title.Cd2WlefD.js → form-layout-title.BarHgyjC.js} +2 -2
  85. package/dist/chunks/{form-layout-title.Cd2WlefD.js.map → form-layout-title.BarHgyjC.js.map} +1 -1
  86. package/dist/chunks/{header.DwTrDlSa.js → header.CAJtHW1k.js} +4 -4
  87. package/dist/chunks/{header.DwTrDlSa.js.map → header.CAJtHW1k.js.map} +1 -1
  88. package/dist/chunks/image.C2D2hKat.js +56 -0
  89. package/dist/chunks/image.C2D2hKat.js.map +1 -0
  90. package/dist/chunks/index.BiaBX5uu.js +345 -0
  91. package/dist/chunks/{index.iCshT3Hx.js.map → index.BiaBX5uu.js.map} +1 -1
  92. package/dist/chunks/{info-icon.CCR-cAFR.js → info-icon.p-28zHUJ.js} +2 -2
  93. package/dist/chunks/{info-icon.CCR-cAFR.js.map → info-icon.p-28zHUJ.js.map} +1 -1
  94. package/dist/chunks/input-field-password.ijBN-aVx.js +191 -0
  95. package/dist/chunks/input-field-password.ijBN-aVx.js.map +1 -0
  96. package/dist/chunks/{input-field.CKOdyDVy.js → input-field.BoElSWuV.js} +37 -35
  97. package/dist/chunks/input-field.BoElSWuV.js.map +1 -0
  98. package/dist/chunks/layout-row.6jCBhtd4.js +87 -0
  99. package/dist/chunks/layout-row.6jCBhtd4.js.map +1 -0
  100. package/dist/chunks/{listbox-option-tag.CuHL51H9.js → listbox-option-tag.BnX0H4HE.js} +2 -2
  101. package/dist/chunks/{listbox-option-tag.CuHL51H9.js.map → listbox-option-tag.BnX0H4HE.js.map} +1 -1
  102. package/dist/chunks/{loading-button.2h9RXXIZ.js → loading-button.CiPmvU7F.js} +2 -2
  103. package/dist/chunks/{loading-button.2h9RXXIZ.js.map → loading-button.CiPmvU7F.js.map} +1 -1
  104. package/dist/chunks/{menu.DEeyofbM.js → menu.N41WnXc8.js} +2 -2
  105. package/dist/chunks/{menu.DEeyofbM.js.map → menu.N41WnXc8.js.map} +1 -1
  106. package/dist/chunks/{modal-fullscreen.Ct4aitSv.js → modal-fullscreen.BbNe6M9T.js} +2 -2
  107. package/dist/chunks/{modal-fullscreen.Ct4aitSv.js.map → modal-fullscreen.BbNe6M9T.js.map} +1 -1
  108. package/dist/chunks/{modal.tUtoM34X.js → modal.Cb4zg5fN.js} +4 -4
  109. package/dist/chunks/{modal.tUtoM34X.js.map → modal.Cb4zg5fN.js.map} +1 -1
  110. package/dist/chunks/{pagination.CqrSR1Md.js → pagination.FbkfItkS.js} +2 -2
  111. package/dist/chunks/{pagination.CqrSR1Md.js.map → pagination.FbkfItkS.js.map} +1 -1
  112. package/dist/chunks/{popover.BcWFpCY_.js → popover.Uy-vuQq5.js} +2 -2
  113. package/dist/chunks/{popover.BcWFpCY_.js.map → popover.Uy-vuQq5.js.map} +1 -1
  114. package/dist/chunks/promo-banner.CGz3MVPw.js +70 -0
  115. package/dist/chunks/promo-banner.CGz3MVPw.js.map +1 -0
  116. package/dist/chunks/{radio-group.DtlPzh_w.js → radio-group.EnMXbuly.js} +4 -4
  117. package/dist/chunks/{radio-group.DtlPzh_w.js.map → radio-group.EnMXbuly.js.map} +1 -1
  118. package/dist/chunks/{search-bar.CN9pWrLP.js → search-bar.DD6eA0jG.js} +3 -3
  119. package/dist/chunks/{search-bar.CN9pWrLP.js.map → search-bar.DD6eA0jG.js.map} +1 -1
  120. package/dist/chunks/{secondary-nav.bchOEARi.js → secondary-nav.C56_jw55.js} +4 -4
  121. package/dist/chunks/{secondary-nav.bchOEARi.js.map → secondary-nav.C56_jw55.js.map} +1 -1
  122. package/dist/chunks/{segmented-control.uVH5ahVY.js → segmented-control.CVeUROYR.js} +2 -2
  123. package/dist/chunks/{segmented-control.uVH5ahVY.js.map → segmented-control.CVeUROYR.js.map} +1 -1
  124. package/dist/chunks/selection-card-group.DwkH9xJd.js +299 -0
  125. package/dist/chunks/selection-card-group.DwkH9xJd.js.map +1 -0
  126. package/dist/chunks/show.IEAxtCB7.js +43 -0
  127. package/dist/chunks/show.IEAxtCB7.js.map +1 -0
  128. package/dist/chunks/{sidepanel.BjrsqXLl.js → sidepanel.CRJN9Acz.js} +2 -2
  129. package/dist/chunks/{sidepanel.BjrsqXLl.js.map → sidepanel.CRJN9Acz.js.map} +1 -1
  130. package/dist/chunks/step.5g9BIi15.js +217 -0
  131. package/dist/chunks/step.5g9BIi15.js.map +1 -0
  132. package/dist/chunks/{structured-list-item.C4gxvOkq.js → structured-list-item.BEhWyaVP.js} +9 -9
  133. package/dist/chunks/structured-list-item.BEhWyaVP.js.map +1 -0
  134. package/dist/chunks/{summary-grid-item-custom.CPprUptt.js → summary-grid-item-custom.CSXo4NjY.js} +4 -4
  135. package/dist/chunks/{summary-grid-item-custom.CPprUptt.js.map → summary-grid-item-custom.CSXo4NjY.js.map} +1 -1
  136. package/dist/chunks/{tag.DSFSfnAf.js → tag.wTXg-O7i.js} +2 -2
  137. package/dist/chunks/{tag.DSFSfnAf.js.map → tag.wTXg-O7i.js.map} +1 -1
  138. package/dist/chunks/{textarea.B4MZ_pi1.js → textarea.Y3yd_3ll.js} +2 -2
  139. package/dist/chunks/{textarea.B4MZ_pi1.js.map → textarea.Y3yd_3ll.js.map} +1 -1
  140. package/dist/chunks/{timeline-item.Bmn0Pu11.js → timeline-item.CCV4U3Zx.js} +5 -5
  141. package/dist/chunks/{timeline-item.Bmn0Pu11.js.map → timeline-item.CCV4U3Zx.js.map} +1 -1
  142. package/dist/chunks/{tooltip.CS2Gij6x.js → tooltip.DH8TqpYV.js} +84 -68
  143. package/dist/chunks/tooltip.DH8TqpYV.js.map +1 -0
  144. package/dist/chunks/{tutorial.DG5I6TRS.js → tutorial.4r7MKNEU.js} +5 -5
  145. package/dist/chunks/{tutorial.DG5I6TRS.js.map → tutorial.4r7MKNEU.js.map} +1 -1
  146. package/dist/chunks/{use-cached-selected-values.D5ARl96f.js → use-cached-selected-values.-_Gk6HO_.js} +3 -3
  147. package/dist/chunks/{use-cached-selected-values.D5ARl96f.js.map → use-cached-selected-values.-_Gk6HO_.js.map} +1 -1
  148. package/dist/code-snippet.js +1 -1
  149. package/dist/currency.js +1 -1
  150. package/dist/dashboard-template.js +1 -1
  151. package/dist/dashed-underline.js +1 -1
  152. package/dist/data-grid-template.js +1 -1
  153. package/dist/data-grid.js +1 -1
  154. package/dist/date-picker.js +1 -1
  155. package/dist/date-range-picker.js +1 -1
  156. package/dist/dropdown.js +3 -3
  157. package/dist/file-uploader.js +5 -0
  158. package/dist/file-uploader.js.map +1 -0
  159. package/dist/filter-bar.js +1 -1
  160. package/dist/form-layout.js +1 -1
  161. package/dist/header.js +1 -1
  162. package/dist/image.js +1 -1
  163. package/dist/index.js +233 -217
  164. package/dist/index.js.map +1 -1
  165. package/dist/info-icon.js +1 -1
  166. package/dist/input-field-password.js +10 -0
  167. package/dist/input-field-password.js.map +1 -0
  168. package/dist/input-field.js +1 -1
  169. package/dist/internal.js +6 -6
  170. package/dist/layout.js +6 -0
  171. package/dist/layout.js.map +1 -0
  172. package/dist/menu.js +1 -1
  173. package/dist/modal-fullscreen.js +1 -1
  174. package/dist/modal.js +2 -2
  175. package/dist/pagination.js +1 -1
  176. package/dist/popover.js +1 -1
  177. package/dist/promo-banner.js +7 -0
  178. package/dist/promo-banner.js.map +1 -0
  179. package/dist/radio-group.js +1 -1
  180. package/dist/search-bar.js +2 -2
  181. package/dist/secondary-nav.js +1 -1
  182. package/dist/segmented-control.js +1 -1
  183. package/dist/selection-card.js +1 -1
  184. package/dist/sidepanel.js +1 -1
  185. package/dist/stepper.js +1 -1
  186. package/dist/structured-list.js +1 -1
  187. package/dist/styles/bento-dark.css +110 -33
  188. package/dist/styles/bento-light.css +110 -33
  189. package/dist/styles/bento.css +110 -33
  190. package/dist/styles/legacy.css +118 -41
  191. package/dist/styles/styleguide.css +110 -33
  192. package/dist/summary-grid.js +1 -1
  193. package/dist/tag.js +1 -1
  194. package/dist/textarea.js +1 -1
  195. package/dist/timeline.js +1 -1
  196. package/dist/tutorial.js +1 -1
  197. package/dist/web-types.json +939 -200
  198. package/package.json +6 -7
  199. package/dist/chunks/currency.CEqsVP2T.js.map +0 -1
  200. package/dist/chunks/data-grid.Czo9hi7m.js.map +0 -1
  201. package/dist/chunks/es6.BvpG4Oi6.js +0 -9
  202. package/dist/chunks/es6.BvpG4Oi6.js.map +0 -1
  203. package/dist/chunks/filter-bar.dQZY8j9C.js.map +0 -1
  204. package/dist/chunks/image.B3uqhFjl.js +0 -82
  205. package/dist/chunks/image.B3uqhFjl.js.map +0 -1
  206. package/dist/chunks/index.iCshT3Hx.js +0 -183
  207. package/dist/chunks/input-field.CKOdyDVy.js.map +0 -1
  208. package/dist/chunks/selection-card-group.CW7c72r2.js +0 -255
  209. package/dist/chunks/selection-card-group.CW7c72r2.js.map +0 -1
  210. package/dist/chunks/step.D3-7YL7-.js +0 -234
  211. package/dist/chunks/step.D3-7YL7-.js.map +0 -1
  212. package/dist/chunks/structured-list-item.C4gxvOkq.js.map +0 -1
  213. package/dist/chunks/tooltip.CS2Gij6x.js.map +0 -1
@@ -1,82 +0,0 @@
1
- import { defineComponent as _, computed as u } from "vue";
2
- import { n as c } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
3
- var e = /* @__PURE__ */ ((r) => (r.LANDSCAPE = "landscape", r.P4_3 = "4:3", r.P3_3 = "3:3", r.P16_9 = "16:9", r.P2_1 = "2:1", r.PORTRAIT = "portrait", r.P3_4 = "3:4", r.P2_3 = "2:3", r.P9_16 = "9:16", r.P1_2 = "1:2", r.SQUARE = "square", r.P1_1 = "1:1", r))(e || {}), n = /* @__PURE__ */ ((r) => (r.COVER = "cover", r.FILL = "fill", r.CONTAIN = "contain", r))(n || {});
4
- const i = _({
5
- name: "bento-image",
6
- props: {
7
- /**
8
- * Url to image, same as src attribute of `<img>` tag
9
- */
10
- src: {
11
- type: String,
12
- required: !0
13
- },
14
- /**
15
- * Accessible text describing the image, same as alt attribute of `<img>` tag
16
- */
17
- alt: {
18
- type: String,
19
- required: !0
20
- },
21
- /**
22
- * Aspect ratio of the image, maps to css aspect-ratio
23
- */
24
- aspectRatio: {
25
- type: String,
26
- default: null,
27
- validator: (r) => Object.values(e).includes(r)
28
- },
29
- /**
30
- * Object fitting strategy, maps to css object-fit
31
- */
32
- objectFit: {
33
- type: String,
34
- default: null,
35
- validator: (r) => Object.values(n).includes(r)
36
- }
37
- },
38
- setup(r) {
39
- const l = (a) => {
40
- let s = e.P16_9;
41
- switch (a) {
42
- case e.LANDSCAPE:
43
- s = e.P16_9;
44
- break;
45
- case e.PORTRAIT:
46
- s = e.P3_4;
47
- break;
48
- case e.SQUARE:
49
- s = e.P1_1;
50
- break;
51
- default:
52
- s = a;
53
- break;
54
- }
55
- return `${s}`.replace(":", "/");
56
- };
57
- return {
58
- imageStyles: u(() => ({
59
- aspectRatio: l(r.aspectRatio),
60
- objectFit: r.objectFit
61
- }))
62
- };
63
- }
64
- });
65
- var P = function() {
66
- var l = this, t = l._self._c;
67
- return l._self._setupProxy, t("img", { style: l.imageStyles, attrs: { src: l.src, alt: l.alt } });
68
- }, d = [], f = /* @__PURE__ */ c(
69
- i,
70
- P,
71
- d,
72
- !1,
73
- null,
74
- null
75
- );
76
- const p = f.exports;
77
- export {
78
- p as B,
79
- e as a,
80
- n as b
81
- };
82
- //# sourceMappingURL=image.B3uqhFjl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"image.B3uqhFjl.js","sources":["../../src/components/image/image.types.ts","../../src/components/image/image.vue"],"sourcesContent":["export enum BentoImageAspectRatio {\n LANDSCAPE = 'landscape',\n P4_3 = '4:3',\n P3_3 = '3:3',\n P16_9 = '16:9',\n P2_1 = '2:1',\n PORTRAIT = 'portrait',\n P3_4 = '3:4',\n P2_3 = '2:3',\n P9_16 = '9:16',\n P1_2 = '1:2',\n SQUARE = 'square',\n P1_1 = '1:1',\n}\n\nexport enum BentoImageObjectFit {\n COVER = 'cover',\n FILL = 'fill',\n CONTAIN = 'contain',\n}\n","<template>\n <img :src=\"src\" :alt=\"alt\" :style=\"imageStyles\" />\n</template>\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoImageAspectRatio, BentoImageObjectFit } from './image.types';\n\n export default defineComponent({\n name: 'bento-image',\n props: {\n /**\n * Url to image, same as src attribute of `<img>` tag\n */\n src: {\n type: String,\n required: true,\n },\n /**\n * Accessible text describing the image, same as alt attribute of `<img>` tag\n */\n alt: {\n type: String,\n required: true,\n },\n /**\n * Aspect ratio of the image, maps to css aspect-ratio\n */\n aspectRatio: {\n type: String as PropType<BentoImageAspectRatio | `${BentoImageAspectRatio}`>,\n default: null,\n validator: (value: BentoImageAspectRatio) => Object.values(BentoImageAspectRatio).includes(value),\n },\n /**\n * Object fitting strategy, maps to css object-fit\n */\n objectFit: {\n type: String as PropType<BentoImageObjectFit | `${BentoImageObjectFit}`>,\n default: null,\n validator: (value: BentoImageObjectFit) => Object.values(BentoImageObjectFit).includes(value),\n },\n },\n setup(props) {\n const convertAspectRatio = (aspectRatio: BentoImageAspectRatio | `${BentoImageAspectRatio}`) => {\n let parsedAspectRatio: BentoImageAspectRatio | `${BentoImageAspectRatio}` = BentoImageAspectRatio.P16_9;\n switch (aspectRatio) {\n case BentoImageAspectRatio.LANDSCAPE:\n parsedAspectRatio = BentoImageAspectRatio.P16_9;\n break;\n case BentoImageAspectRatio.PORTRAIT:\n parsedAspectRatio = BentoImageAspectRatio.P3_4;\n break;\n case BentoImageAspectRatio.SQUARE:\n parsedAspectRatio = BentoImageAspectRatio.P1_1;\n break;\n default:\n parsedAspectRatio = aspectRatio;\n break;\n }\n return `${parsedAspectRatio}`.replace(':', '/');\n };\n\n const imageStyles = computed(() => ({\n aspectRatio: convertAspectRatio(props.aspectRatio),\n objectFit: props.objectFit,\n }));\n\n return {\n imageStyles,\n };\n },\n });\n</script>\n"],"names":["BentoImageAspectRatio","BentoImageObjectFit","_sfc_main","defineComponent","value","props","convertAspectRatio","aspectRatio","parsedAspectRatio","computed"],"mappings":";;AAAY,IAAAA,sBAAAA,OACRA,EAAA,YAAY,aACZA,EAAA,OAAO,OACPA,EAAA,OAAO,OACPA,EAAA,QAAQ,QACRA,EAAA,OAAO,OACPA,EAAA,WAAW,YACXA,EAAA,OAAO,OACPA,EAAA,OAAO,OACPA,EAAA,QAAQ,QACRA,EAAA,OAAO,OACPA,EAAA,SAAS,UACTA,EAAA,OAAO,OAZCA,IAAAA,KAAA,CAAA,CAAA,GAeAC,sBAAAA,OACRA,EAAA,QAAQ,SACRA,EAAA,OAAO,QACPA,EAAA,UAAU,WAHFA,IAAAA,KAAA,CAAA,CAAA;ACRZ,MAAAC,IAAAC,EAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,KAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,KAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA,OAAA,OAAAJ,CAAA,EAAA,SAAAI,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAA,MAAA,OAAA,OAAAH,CAAA,EAAA,SAAAG,CAAA;AAAA,IAAA;AAAA,EAEA;AAAA,EACA,MAAAC,GAAA;AACA,UAAAC,IAAA,CAAAC,MAAA;AACA,UAAAC,IAAAR,EAAA;AACA,cAAAO,GAAA;AAAA,QACA,KAAAP,EAAA;AACA,UAAAQ,IAAAR,EAAA;AACA;AAAA,QACA,KAAAA,EAAA;AACA,UAAAQ,IAAAR,EAAA;AACA;AAAA,QACA,KAAAA,EAAA;AACA,UAAAQ,IAAAR,EAAA;AACA;AAAA,QACA;AACA,UAAAQ,IAAAD;AACA;AAAA,MAAA;AAEA,aAAA,GAAAC,CAAA,GAAA,QAAA,KAAA,GAAA;AAAA,IACA;AAOA,WAAA;AAAA,MACA,aANAC,EAAA,OAAA;AAAA,QACA,aAAAH,EAAAD,EAAA,WAAA;AAAA,QACA,WAAAA,EAAA;AAAA,MAAA,EACA;AAAA,IAIA;AAAA,EAAA;AAEA,CAAA;;;;;;;;;;;;;"}
@@ -1,183 +0,0 @@
1
- import "./index.Cl4_42j5.js";
2
- import { onMounted as b, nextTick as I, getCurrentScope as M, onScopeDispose as x, unref as W, getCurrentInstance as g, computed as w, ref as l, watch as E, watchEffect as L } from "vue";
3
- function O(t) {
4
- return M() ? (x(t), !0) : !1;
5
- }
6
- function y(t) {
7
- return typeof t == "function" ? t() : W(t);
8
- }
9
- const N = typeof window < "u" && typeof document < "u";
10
- typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
11
- const T = Object.prototype.toString, j = (t) => T.call(t) === "[object Object]", A = () => {
12
- };
13
- function C(t, r) {
14
- var n;
15
- if (typeof t == "number")
16
- return t + r;
17
- const o = ((n = t.match(/^-?[0-9]+\.?[0-9]*/)) == null ? void 0 : n[0]) || "", i = t.slice(o.length), s = Number.parseFloat(o) + r;
18
- return Number.isNaN(s) ? t : s + i;
19
- }
20
- function Y(t) {
21
- return g();
22
- }
23
- function q(t, r = !0, n) {
24
- Y() ? b(t, n) : r ? t() : I(t);
25
- }
26
- function G(t) {
27
- var r;
28
- const n = y(t);
29
- return (r = n == null ? void 0 : n.$el) != null ? r : n;
30
- }
31
- const h = N ? window : void 0;
32
- function S(...t) {
33
- let r, n, o, i;
34
- if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([n, o, i] = t, r = h) : [r, n, o, i] = t, !r)
35
- return A;
36
- Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
37
- const s = [], c = () => {
38
- s.forEach((d) => d()), s.length = 0;
39
- }, e = (d, f, p, v) => (d.addEventListener(f, p, v), () => d.removeEventListener(f, p, v)), u = E(
40
- () => [G(r), y(i)],
41
- ([d, f]) => {
42
- if (c(), !d)
43
- return;
44
- const p = j(f) ? { ...f } : f;
45
- s.push(
46
- ...n.flatMap((v) => o.map(($) => e(d, v, $, p)))
47
- );
48
- },
49
- { immediate: !0, flush: "post" }
50
- ), a = () => {
51
- u(), c();
52
- };
53
- return O(a), a;
54
- }
55
- function V() {
56
- const t = l(!1);
57
- return g() && b(() => {
58
- t.value = !0;
59
- }), t;
60
- }
61
- function _(t) {
62
- const r = V();
63
- return w(() => (r.value, !!t()));
64
- }
65
- function m(t, r = {}) {
66
- const { window: n = h } = r, o = _(() => n && "matchMedia" in n && typeof n.matchMedia == "function");
67
- let i;
68
- const s = l(!1), c = (a) => {
69
- s.value = a.matches;
70
- }, e = () => {
71
- i && ("removeEventListener" in i ? i.removeEventListener("change", c) : i.removeListener(c));
72
- }, u = L(() => {
73
- o.value && (e(), i = n.matchMedia(y(t)), "addEventListener" in i ? i.addEventListener("change", c) : i.addListener(c), s.value = i.matches);
74
- });
75
- return O(() => {
76
- u(), e(), i = void 0;
77
- }), s;
78
- }
79
- function F(t, r = {}) {
80
- function n(e, u) {
81
- let a = y(t[e]);
82
- return u != null && (a = C(a, u)), typeof a == "number" && (a = `${a}px`), a;
83
- }
84
- const { window: o = h } = r;
85
- function i(e) {
86
- return o ? o.matchMedia(e).matches : !1;
87
- }
88
- const s = (e) => m(() => `(min-width: ${n(e)})`, r), c = Object.keys(t).reduce((e, u) => (Object.defineProperty(e, u, {
89
- get: () => s(u),
90
- enumerable: !0,
91
- configurable: !0
92
- }), e), {});
93
- return Object.assign(c, {
94
- greater(e) {
95
- return m(() => `(min-width: ${n(e, 0.1)})`, r);
96
- },
97
- greaterOrEqual: s,
98
- smaller(e) {
99
- return m(() => `(max-width: ${n(e, -0.1)})`, r);
100
- },
101
- smallerOrEqual(e) {
102
- return m(() => `(max-width: ${n(e)})`, r);
103
- },
104
- between(e, u) {
105
- return m(() => `(min-width: ${n(e)}) and (max-width: ${n(u, -0.1)})`, r);
106
- },
107
- isGreater(e) {
108
- return i(`(min-width: ${n(e, 0.1)})`);
109
- },
110
- isGreaterOrEqual(e) {
111
- return i(`(min-width: ${n(e)})`);
112
- },
113
- isSmaller(e) {
114
- return i(`(max-width: ${n(e, -0.1)})`);
115
- },
116
- isSmallerOrEqual(e) {
117
- return i(`(max-width: ${n(e)})`);
118
- },
119
- isInBetween(e, u) {
120
- return i(`(min-width: ${n(e)}) and (max-width: ${n(u, -0.1)})`);
121
- },
122
- current() {
123
- const e = Object.keys(t).map((u) => [u, s(u)]);
124
- return w(() => e.filter(([, u]) => u.value).map(([u]) => u));
125
- }
126
- });
127
- }
128
- function H(t = {}) {
129
- const { window: r = h, behavior: n = "auto" } = t;
130
- if (!r)
131
- return {
132
- x: l(0),
133
- y: l(0)
134
- };
135
- const o = l(r.scrollX), i = l(r.scrollY), s = w({
136
- get() {
137
- return o.value;
138
- },
139
- set(e) {
140
- scrollTo({ left: e, behavior: n });
141
- }
142
- }), c = w({
143
- get() {
144
- return i.value;
145
- },
146
- set(e) {
147
- scrollTo({ top: e, behavior: n });
148
- }
149
- });
150
- return S(
151
- r,
152
- "scroll",
153
- () => {
154
- o.value = r.scrollX, i.value = r.scrollY;
155
- },
156
- {
157
- capture: !1,
158
- passive: !0
159
- }
160
- ), { x: s, y: c };
161
- }
162
- function P(t = {}) {
163
- const {
164
- window: r = h,
165
- initialWidth: n = Number.POSITIVE_INFINITY,
166
- initialHeight: o = Number.POSITIVE_INFINITY,
167
- listenOrientation: i = !0,
168
- includeScrollbar: s = !0
169
- } = t, c = l(n), e = l(o), u = () => {
170
- r && (s ? (c.value = r.innerWidth, e.value = r.innerHeight) : (c.value = r.document.documentElement.clientWidth, e.value = r.document.documentElement.clientHeight));
171
- };
172
- if (u(), q(u), S("resize", u, { passive: !0 }), i) {
173
- const a = m("(orientation: portrait)");
174
- E(a, () => u());
175
- }
176
- return { width: c, height: e };
177
- }
178
- export {
179
- H as a,
180
- F as b,
181
- P as u
182
- };
183
- //# sourceMappingURL=index.iCshT3Hx.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"input-field.CKOdyDVy.js","sources":["../../src/components/input-field/input-field.types.ts","../../src/components/input-field/input-field.vue"],"sourcesContent":["import { BentoDropdown } from '@/components/dropdown/';\nimport type { HTMLAttributes } from 'vue/types/jsx';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldVariant {\n DEFAULT = 'default',\n PAYMENT_METHOD = 'payment-method',\n STATIC_VALUE = 'static-value',\n DROPDOWN = 'dropdown',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldElementPosition {\n START = 'start',\n END = 'end',\n}\n\nexport enum BentoInputFieldStateClass {\n CONDENSED = 'condensed',\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldType {\n SEARCH = 'search',\n TEXT = 'text',\n NUMBER = 'number',\n}\n\nexport type BentoInputFieldValue = string | number;\n\ntype DropdownProps = InstanceType<typeof BentoDropdown>['$props'];\nexport type BentoInputDropdownProps = {\n items: DropdownProps['items'];\n value: DropdownProps['value'];\n dynamicFiltering?: DropdownProps['dynamicFiltering'];\n 'aria-label'?: HTMLAttributes['aria-label'];\n};\n\n/**\n * @deprecated The use of these enums is no longer supported.\n * Use `v-on:` or `@` to listen to the events being emitted.\n * This enum will be removed in 2.0.\n */\nexport enum BentoInputFieldEvent {\n INPUT = 'input',\n ESCAPE_PRESSED = 'escape-pressed',\n UPDATE_DROPDOWN = 'update:dropdown',\n DROPDOWN_INPUT = 'dropdown-input',\n FOCUS = 'focus',\n CHANGE = 'change',\n BLUR = 'blur',\n KEYDOWN = 'keydown',\n}\n","<template>\n <bento-typography\n class=\"b-input-field\"\n data-testid=\"input-text-container\"\n :class=\"inputFieldConditionalClasses\"\n el=\"div\"\n variant=\"body\"\n >\n <field-label\n v-if=\"hasSlot('default')\"\n :for=\"inputFieldId\"\n data-testid=\"input-field-label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n @click=\"focusInput\"\n >\n <slot></slot>\n </field-label>\n\n <div class=\"b-input-field__input-box\" data-testid=\"input-box\" :aria-disabled=\"disabled\" @click=\"focusInput\">\n <!-- Optional Icon for Default text variant -->\n <span\n v-if=\"isDefaultVariant && (hasSlot('defaultIconBefore') || hasSlot('iconBefore'))\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-before\"\n >\n <slot v-if=\"hasSlot('iconBefore')\" name=\"iconBefore\" />\n <slot v-if=\"hasSlot('defaultIconBefore') && !hasSlot('iconBefore')\" name=\"defaultIconBefore\" />\n </span>\n\n <!-- Mandatory Icon for Payment Method variant -->\n <span\n v-if=\"isPaymentMethodVariant && hasSlot('paymentMethod')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__payment-method\"\n >\n <slot name=\"paymentMethod\" />\n </span>\n\n <!-- Dropdown at start -->\n <div\n v-if=\"shouldDisplayDropdownAtStart\"\n :id=\"dropdownId\"\n class=\"b-input-field__dropdown b-input-field__dropdown--start\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n v-bind=\"inputFieldDropdownProps\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n\n <!-- Static Value at start -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtStart\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--start\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n <div class=\"b-input-field__input-container\">\n <input\n :id=\"inputFieldId\"\n v-bind=\"attrs\"\n ref=\"inputFieldElement\"\n class=\"b-input-field__input\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"computedAriaDescribedBy\"\n :aria-owns=\"computedAriaOwns\"\n :aria-invalid=\"shouldShowError\"\n :placeholder=\"placeholder\"\n :type=\"type\"\n :value=\"value\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onInput\"\n @change=\"emit('change')\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n @keydown=\"emit('keydown', $event)\"\n @keydown.esc=\"emit('escape-pressed')\"\n />\n\n <!-- Hint at the end -->\n <bento-typography v-if=\"hint && isFocused && value\" el=\"span\" class=\"b-input-field__hint\">\n {{ hint }}\n </bento-typography>\n </div>\n\n <span\n v-if=\"hasSlot('iconAfter')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-after\"\n data-testid=\"input-text__icon-after\"\n >\n <slot name=\"iconAfter\" />\n </span>\n\n <!-- Static Value at the end -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtEnd\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--end\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n\n <!-- Dropdown at end -->\n <div\n v-if=\"shouldDisplayDropdownAtEnd\"\n :id=\"dropdownId\"\n data-testid=\"input-field-dropdown-container-end\"\n class=\"b-input-field__dropdown b-input-field__dropdown--end\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n :id=\"dropdownId\"\n v-bind=\"inputFieldDropdownProps\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n </div>\n\n <error-message\n v-if=\"shouldShowError && !!errorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-input-field__error-message\"\n />\n\n <span v-if=\"hasSlot('description')\" :id=\"descriptionId\" class=\"b-input-field__description\" @click=\"focusInput\">\n <bento-typography el=\"span\" variant=\"body\">\n <slot id=\"description\" name=\"description\" />\n </bento-typography>\n </span>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, PropType, provide, Ref, ref, toRef, toRefs, useAttrs, useSlots } from 'vue';\n\n // Components\n import { BentoDropdown } from '@/components/dropdown';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage, FieldLabel } from '@/internal';\n\n // Utils\n import { deprecate } from '@/utils/ts/deprecate';\n import { generateUid } from '@/core/utils/ts';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useI18n } from '@/utils/ts/i18n';\n import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\n import {\n INPUT_FIELD_COMPONENT_INJECTION_KEY,\n INPUT_FIELD_HINT_INJECTION_KEY,\n } from '@/components/input-field/input-field.keys';\n\n // Composables\n import { useFormLayoutFieldLoading, useHasSlot } from '@/composables';\n\n // Types\n import {\n BentoInputDropdownProps,\n BentoInputFieldElementPosition,\n BentoInputFieldStateClass,\n BentoInputFieldType,\n BentoInputFieldValue,\n BentoInputFieldVariant,\n } from './input-field.types';\n import { BentoListboxSelectedValue } from '@/types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n const slots = useSlots();\n\n const props = defineProps({\n /**\n * Indicates whether the element is exposed to an accessibility API.\n */\n ariaHidden: { type: Boolean, default: true },\n\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Text that labels an the input element\n */\n ariaLabel: { type: String, default: undefined },\n\n /**\n * Reduces height of the input\n */\n condensed: { type: Boolean, default: false },\n\n /**\n * Disables the possibility of changing value in the input-field\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Dropdown props for the small selectable dropdown menu.\n * Properties supported:\n *\n * - `value`: Selected value of the dropdown\n * - `items`: List of available items\n * - `aria-label`: Text that labels the dropdown element\n *\n */\n dropdown: {\n type: Object as PropType<BentoInputDropdownProps>,\n default: undefined,\n },\n\n /**\n * Position of the dropdown before or after input value\n */\n dropdownPosition: {\n type: String as PropType<BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`>,\n default: BentoInputFieldElementPosition.START,\n validator: (value: BentoInputFieldElementPosition) =>\n Object.values(BentoInputFieldElementPosition).includes(value),\n },\n\n /**\n * Adds error validation class for outlining input-field.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n error: { type: Boolean, default: false },\n\n /**\n * Renders input-field with an error state and the error message beneath the input box\n */\n errorMessage: { type: String, default: null },\n\n /**\n * Highlights the dropdown is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Text displayed as the placeholder of the input-field\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Highlights the dropdown is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Setting this property to true will set the input field to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Static text that displayed before or after input value\n * Applicable to the Static Value variant\n */\n staticValue: { type: String, default: '' },\n\n /**\n * Position of Static Value before or after input value\n */\n staticValuePosition: {\n type: String as PropType<BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`>,\n default: BentoInputFieldElementPosition.START,\n validator: (value: BentoInputFieldElementPosition) =>\n Object.values(BentoInputFieldElementPosition).includes(value),\n },\n\n /**\n * Adds a info icon next to the label to display the passed tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * A string specifying the type of control to render.\n * All `input` types are available but only `search`, `text` and `number` are fully supported.\n *\n * If `type` is `search`, use `bento-search-bar` instead.\n */\n type: {\n type: String as PropType<BentoInputFieldType | `${BentoInputFieldType}` | HTMLInputElement['type']>,\n default: BentoInputFieldType.TEXT,\n },\n\n /**\n * Text displayed as the value of the input-field\n */\n value: { type: [String, Number] as PropType<BentoInputFieldValue>, default: undefined },\n\n /**\n * Describes the different variants for the input element\n */\n variant: {\n type: String as PropType<BentoInputFieldVariant | `${BentoInputFieldVariant}`>,\n default: BentoInputFieldVariant.DEFAULT,\n validator: (value: BentoInputFieldVariant) => Object.values(BentoInputFieldVariant).includes(value),\n },\n });\n\n const emit = defineEmits([\"update:dropdown\", \"blur\", \"change\", \"dropdown-input\", \"escape-pressed\", \"focus\", \"keydown\", \"input\"]);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const hasSlot = useHasSlot(slots);\n const inputFieldElement = ref(null);\n const inputFieldId = generateUid('input');\n const dropdownId = generateUid('input-dropdown');\n const staticValueId = generateUid('input-static-value');\n const descriptionId = generateUid('input-description');\n const errorId = generateUid('input-error');\n const isFocused = ref(false);\n\n // Provide INPUT_FIELD_COMPONENT_INJECTION_KEY as true, to set the input only dropdown size variant in the BentoDropdown comp\n provide(INPUT_FIELD_COMPONENT_INJECTION_KEY, true);\n // Renders the input with a hint if a string is provided\n const hint = inject<Ref<string | undefined>>(INPUT_FIELD_HINT_INJECTION_KEY, ref(undefined));\n\n const onFocus = () => {\n isFocused.value = true;\n emit('focus');\n };\n\n const onBlur = () => {\n isFocused.value = false;\n emit('blur');\n };\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const shouldShowStaticValue = computed(\n () => props.variant === BentoInputFieldVariant.STATIC_VALUE && !!slots.staticValue\n );\n\n const isDefaultVariant = computed(() => props.variant === BentoInputFieldVariant.DEFAULT);\n\n const isPaymentMethodVariant = computed(() => props.variant === BentoInputFieldVariant.PAYMENT_METHOD);\n\n const shouldDisplayStaticValueAtStart = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayStaticValueAtEnd = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowDropdown = computed(() => props.variant === BentoInputFieldVariant.DROPDOWN && !!props.dropdown);\n const shouldDisplayDropdownAtStart = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayDropdownAtEnd = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.error)\n );\n\n const computedAriaOwns = computed(() => {\n if (shouldShowDropdown.value === true && shouldShowStaticValue.value === true) {\n return `${staticValueId} ${dropdownId}`;\n }\n if (shouldShowDropdown.value === true) {\n return `${dropdownId}`;\n }\n if (shouldShowStaticValue.value === true) {\n return `${staticValueId}`;\n }\n return null;\n });\n\n // vue-i18n issue with t() used in script - direct usage in template works\n // requires either createI18n({ legacy: false }) or to be wrapped in computed()\n const computedAriaLabelFallbackMessage = computed(() => t('ariaLabelFallback'));\n const computedAriaLabelDropdowFallback = computed(() =>\n t('ariaLabelDropdownFallback', { inputLabel: computedAriaLabel.value })\n );\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: hasSlot('default')\n ? (getSlotText(slots)('default') as string)\n : computedAriaLabelFallbackMessage,\n });\n\n const computedAriaDescribedBy = computed(\n () =>\n `${hasSlot('description') ? descriptionId : ''} ${\n shouldShowError.value && !!props.errorMessage ? errorId : ''\n }`\n );\n\n const inputFieldConditionalClasses = computed(() => ({\n [`b-input-field--${BentoInputFieldStateClass.CONDENSED}`]: props.condensed,\n [`b-input-field--${BentoInputFieldStateClass.DISABLED}`]: props.disabled,\n [`b-input-field--${BentoInputFieldStateClass.READONLY}`]: isReadOnly.value,\n [`b-input-field--${BentoInputFieldStateClass.ERROR}`]: shouldShowError.value,\n }));\n\n const inputFieldDropdownProps = computed(() => ({\n 'aria-label': computedAriaLabelDropdowFallback.value,\n ...props.dropdown,\n }));\n\n const onInput = (event: Event) => {\n const inputValue = (event.target as HTMLInputElement).value;\n if (!props.disabled && !isReadOnly.value) {\n emit('input', inputValue);\n }\n };\n\n const onDropdownInput = (selectedValue: BentoListboxSelectedValue) => {\n emit('dropdown-input', selectedValue);\n emit('update:dropdown', { ...props?.dropdown, value: selectedValue });\n };\n\n const focusInput = () => {\n inputFieldElement.value.focus();\n };\n\n // Expose method so that other components can focus on it in Vue3\n defineExpose({\n focusInput,\n });\n\n if (!Object.values(BentoInputFieldType).includes(props.type as BentoInputFieldType)) {\n printDevelopmentWarning(`\"bento-input-field\" dropdown does not support the type ${props.type}`);\n }\n\n /**\n * Deprecations\n */\n if (props.error) {\n deprecate(\n 'BentoInputField \"error\" property',\n `Use the BentoInputField \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-dropdown errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n if (hasSlot('defaultIconBefore')) {\n deprecate(\n 'BentoInputField \"defaultIconBefore\" slot',\n `Use the BentoInputField \"iconBefore\" slot instead to add an icon at the left side of the input field\n <bento-input-field>\n \\t<template #iconBefore>\n \\t\\t<my-icon-goes-here />\n \\t</template>\n </bento-input-field>`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Input field component is used to create interactive controls for web-based\n * forms in order to accept data from the user.\n *\n * @example\n * import { BentoInputField } from '@adyen/bento-vue2'\n *\n * const inputValue = ref('');\n *\n * export default {\n * components: { BentoInputField },\n * tempate: `\n * <bento-input-field\n * :value=\"inputValue\"\n * :input=\"newValue => inputValue.value = newValue\"\n * >\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-field.scss\" />\n"],"names":["BentoInputFieldVariant","BentoInputFieldVariant2","BentoInputFieldElementPosition","BentoInputFieldElementPosition2","BentoInputFieldStateClass","BentoInputFieldStateClass2","BentoInputFieldType","BentoInputFieldType2","BentoInputFieldEvent","BentoInputFieldEvent2","__default__","messages","attrs","useAttrs","slots","useSlots","t","useI18n","hasSlot","useHasSlot","inputFieldElement","ref","inputFieldId","generateUid","dropdownId","staticValueId","descriptionId","errorId","isFocused","provide","INPUT_FIELD_COMPONENT_INJECTION_KEY","hint","inject","INPUT_FIELD_HINT_INJECTION_KEY","onFocus","emit","onBlur","isReadOnly","useFormLayoutFieldLoading","toRef","props","shouldShowStaticValue","computed","isDefaultVariant","isPaymentMethodVariant","shouldDisplayStaticValueAtStart","shouldDisplayStaticValueAtEnd","shouldShowDropdown","shouldDisplayDropdownAtStart","shouldDisplayDropdownAtEnd","shouldShowError","computedAriaOwns","computedAriaLabelFallbackMessage","computedAriaLabelDropdowFallback","computedAriaLabel","ariaLabelAttribute","ariaLabel","toRefs","useAriaLabel","getSlotText","computedAriaDescribedBy","inputFieldConditionalClasses","inputFieldDropdownProps","onInput","event","inputValue","onDropdownInput","selectedValue","focusInput","expose","printDevelopmentWarning","deprecate"],"mappings":"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"}
@@ -1,255 +0,0 @@
1
- import { defineComponent as A, useSlots as M, computed as l, inject as z, ref as p, watch as Y, provide as j } from "vue";
2
- import { B as F } from "./typography.Bu_WAKdf.js";
3
- import { a as U } from "./checkbox-input.Bo4NxNOh.js";
4
- import { u as H } from "./aria-label.CaUURpnB.js";
5
- import { g as E } from "./generate-uid.D-HFI38h.js";
6
- import { u as J } from "./use-has-slot.C9lQZ6nz.js";
7
- import { a as K } from "./radio-input.q980f8Uf.js";
8
- import { n as D } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
9
- import { C as Q } from "./controls-group.Sni8leS5.js";
10
- import { E as W } from "./error-message.Bk2maRF8.js";
11
- import "../assets/selection-card-group.css";
12
- var b = /* @__PURE__ */ ((r) => (r.DISABLED = "disabled", r.READONLY = "readonly", r.ERROR = "error", r))(b || {});
13
- const O = Symbol("selection card radio input injection key"), X = {
14
- name: "bento-selection-card"
15
- }, Z = /* @__PURE__ */ A({
16
- ...X,
17
- props: {
18
- /**
19
- * The description of the selection card
20
- */
21
- description: {
22
- type: String,
23
- default: void 0
24
- },
25
- /**
26
- * Disables the selection card
27
- */
28
- disabled: { type: Boolean, default: !1 },
29
- /**
30
- * Makes the entire selection card clickable. Clicking over interactive elements inside the card with this prop enabled will not be possible.
31
- */
32
- fullyClickable: { type: Boolean, default: !1 },
33
- /**
34
- * Shows the selection card in error state
35
- */
36
- hasError: { type: Boolean, default: !1 },
37
- /**
38
- * This property should not be used directly.
39
- * It will be used by v-model directive on selection card component.
40
- *
41
- * When handling a single input, use a string or a number.
42
- *
43
- * When handling multiple inputs, use an array of keys.
44
- * These keys exist as a set "value" prop for each input.
45
- */
46
- modelValue: {
47
- type: [Boolean, String, Array],
48
- default: null
49
- },
50
- /**
51
- * Sets the selection card to readonly
52
- */
53
- readonly: { type: Boolean, default: !1 },
54
- /**
55
- * The subtitle of the selection card
56
- */
57
- subtitle: {
58
- type: String,
59
- default: void 0
60
- },
61
- /**
62
- * The title of the selection card
63
- */
64
- title: {
65
- type: String,
66
- required: !0
67
- },
68
- /**
69
- * Indicates the value of the input that will be returned when it's checked.
70
- */
71
- value: {
72
- type: [String, Number],
73
- required: !0
74
- }
75
- },
76
- emits: ["input", "update:model-value"],
77
- setup(r, { emit: e }) {
78
- const t = r, a = M(), o = J(a), C = E("selection-card-input-id"), c = E("selection-card-description"), m = l(
79
- () => t.modelValue
80
- ), v = l(
81
- () => t.modelValue
82
- ), h = l(() => ({
83
- "b-selection-card--checked": V.value,
84
- "b-selection-card--fully-clickable": t.fullyClickable
85
- })), _ = l(() => ({
86
- [`b-selection-card--${b.DISABLED}`]: t.disabled,
87
- [`b-selection-card--${b.ERROR}`]: t.hasError,
88
- [`b-selection-card--${b.READONLY}`]: t.readonly,
89
- "b-selection-card--center-aligned": f.value
90
- })), s = l(() => ({
91
- "b-selection-card__checkbox-container--center-aligned": f.value
92
- })), w = l(() => ({
93
- "b-selection-card__checkbox-container-text--center-aligned": f.value
94
- })), G = l(() => ({
95
- "b-selection-card__slot--with-icon": o("icon")
96
- })), N = H({
97
- ariaLabel: t.title,
98
- label: t.value
99
- }), g = l(() => Array.isArray(t.modelValue)), V = l(() => I.value ? t.value === t.modelValue : g.value ? t.modelValue.some((n) => n === t.value) : t.modelValue), I = z(O, p(!1)), f = l(() => !t.subtitle && !t.description), d = p(null), k = p(null), x = p(null), q = (n) => {
100
- var i, u, B, T, L, $;
101
- if (d.value.$refs.inputRef === n.target) {
102
- const P = S();
103
- R(P);
104
- return;
105
- }
106
- if (t.disabled && t.readonly || !t.fullyClickable && (k.value && ((u = (i = k.value) == null ? void 0 : i.$el) != null && u.contains(n.target)) || x.value && ((T = (B = x.value) == null ? void 0 : B.$el) != null && T.contains(n.target)) || d.value && (($ = (L = d.value) == null ? void 0 : L.$el) != null && $.contains(n.target))))
107
- return;
108
- const y = S();
109
- R(y);
110
- }, S = () => {
111
- var y;
112
- const n = ((y = d.value) == null ? void 0 : y.$refs.inputRef).checked;
113
- if (g.value) {
114
- const i = [...t.modelValue], u = i.indexOf(t.value);
115
- return u === -1 ? i.push(t.value) : i.splice(u, 1), i;
116
- }
117
- return I.value ? t.value : n;
118
- }, R = (n) => {
119
- !t.disabled && !t.readonly && (e("update:model-value", n), e("input", n));
120
- };
121
- return { __sfc: !0, props: t, emit: e, slots: a, hasSlot: o, inputId: C, descriptionId: c, computedRadioInputModelValue: m, computedCheckboxInputModelValue: v, conditionalClasses: h, containerConditionalClasses: _, checkboxContainerConditionalClasses: s, checkboxContainerTextConditionalClasses: w, slotConditionalClasses: G, ariaLabel: N, isCheckboxGroup: g, isChecked: V, isRadioInput: I, isTitleOnly: f, inputRef: d, slotRef: k, dynamicSlotRef: x, handleCardClick: q, toggleInput: S, onChange: R, BentoTypography: F, CheckboxInput: U, RadioInput: K };
122
- }
123
- });
124
- var ee = function() {
125
- var e = this, t = e._self._c, a = e._self._setupProxy;
126
- return t("div", { staticClass: "b-selection-card", class: a.conditionalClasses, on: { click: a.handleCardClick } }, [t("div", { staticClass: "b-selection-card__container", class: a.containerConditionalClasses }, [t("div", { staticClass: "b-selection-card__checkbox-container", class: a.checkboxContainerConditionalClasses }, [t("div", { staticClass: "b-selection-card__checkbox-container-text", class: a.checkboxContainerTextConditionalClasses }, [a.hasSlot("icon") ? t("div", { staticClass: "b-selection-card__icon", attrs: { role: "presentation" } }, [e._t("icon")], 2) : e._e(), t("label", { staticClass: "b-selection-card__text", attrs: { for: a.inputId }, on: { click: function(o) {
127
- return o.stopPropagation(), o.preventDefault(), a.handleCardClick.apply(null, arguments);
128
- } } }, [e.subtitle ? t(a.BentoTypography, { staticClass: "b-selection-card__description", attrs: { el: "span", variant: "caption" } }, [e._v(" " + e._s(e.subtitle) + " ")]) : e._e(), t(a.BentoTypography, { attrs: { el: "span", variant: "title" } }, [e._v(e._s(e.title))]), e.description ? t(a.BentoTypography, { staticClass: "b-selection-card__description", attrs: { id: "descriptionId", el: "span", variant: "body" } }, [e._v(" " + e._s(e.description) + " ")]) : e._e()], 1)]), a.isRadioInput ? t(a.RadioInput, { ref: "inputRef", attrs: { id: a.inputId, "aria-label": a.ariaLabel, "aria-describedby": e.description ? a.descriptionId : void 0, disabled: e.disabled, "has-error": e.hasError, "aria-readonly": e.readonly ?? void 0, value: e.value, readonly: e.readonly, "model-value": a.computedRadioInputModelValue } }) : t(a.CheckboxInput, { ref: "inputRef", attrs: { id: a.inputId, "aria-label": a.ariaLabel, "aria-describedby": e.description ? a.descriptionId : void 0, disabled: e.disabled, "has-error": e.hasError, "aria-readonly": e.readonly ?? void 0, value: e.value, readonly: e.readonly, "model-value": a.computedCheckboxInputModelValue } })], 1), a.hasSlot("content") ? t(a.BentoTypography, { ref: "slotRef", staticClass: "b-selection-card__slot", class: a.slotConditionalClasses, attrs: { el: "div" } }, [e._t("content")], 2) : e._e(), a.hasSlot("dynamicContent") && a.isChecked ? t(a.BentoTypography, { ref: "dynamicSlotRef", staticClass: "b-selection-card__slot", class: a.slotConditionalClasses, attrs: { el: "div" } }, [e._t("dynamicContent")], 2) : e._e()], 1)]);
129
- }, te = [], ae = /* @__PURE__ */ D(
130
- Z,
131
- ee,
132
- te,
133
- !1,
134
- null,
135
- "308f55e6"
136
- );
137
- const oe = ae.exports, le = {}, ne = /* @__PURE__ */ A({
138
- ...le,
139
- __name: "selection-card-group",
140
- props: {
141
- /**
142
- * Descriptive supporting text visbile underneath the label.
143
- */
144
- description: { type: String, default: null },
145
- /**
146
- * If set to true, renders all cards in the group in a disabled state.
147
- */
148
- disabled: { type: Boolean, default: !1 },
149
- /**
150
- * Renders all cards in an error state with an error message.
151
- */
152
- errorMessage: { type: String, default: null },
153
- /**
154
- * The form id the selection card group is associated with. Defaults to null, as a selection card group can also be used standalone.
155
- */
156
- formId: { type: String, default: null },
157
- /**
158
- * Shows/hides the group label.
159
- */
160
- hideLabel: { type: Boolean, default: null },
161
- /**
162
- * Label of the group. Required for accessibility purposes, even if it's not shown
163
- */
164
- label: {
165
- type: String,
166
- required: !0
167
- },
168
- /**
169
- * The selection card group's layout. It can be vertical or horizontal. Defaults to vertical.
170
- * @values horizontal, vertical
171
- */
172
- layout: {
173
- type: String,
174
- default: "vertical"
175
- },
176
- /**
177
- * The selection card group's items.
178
- */
179
- items: {
180
- type: Array,
181
- required: !0
182
- },
183
- /**
184
- * Determines the initially selected value of the group. Corresponds to the BentoSelectionCardItem's value.
185
- * Defaults to no value selected.
186
- */
187
- modelValue: {
188
- type: [Array, String, Number],
189
- default: null
190
- },
191
- /**
192
- * Indicates the field is optional.
193
- */
194
- optional: { type: Boolean, default: !1 },
195
- /**
196
- * Indicates the field is required.
197
- */
198
- required: { type: Boolean, default: !1 },
199
- /**
200
- * Tooltip message.
201
- */
202
- tooltipText: { type: String, default: null },
203
- /**
204
- * If set to true, renders all cards in the group in a readonly state.
205
- */
206
- readonly: { type: Boolean, default: !1 },
207
- /**
208
- * Renders the cards with a checkbox or a radio input. Selection logic will also apply in accordance.
209
- * @values checkbox, radio
210
- */
211
- variant: { type: String, default: "checkbox" }
212
- },
213
- emits: ["input", "update:model-value"],
214
- setup(r, { emit: e }) {
215
- const t = r, a = M(), o = (s) => !!a[s], C = l(() => ({
216
- "b-selection-card-group__items--horizontal": t.layout === "horizontal"
217
- })), c = p(t.modelValue);
218
- Y(
219
- () => t.modelValue,
220
- () => {
221
- c.value = t.modelValue;
222
- }
223
- );
224
- const m = E("error"), v = l(() => !t.disabled && !t.readonly && !!t.errorMessage), h = (s) => {
225
- c.value = s, e("update:model-value", s), e("input", s);
226
- }, _ = l(() => t.variant === "radio");
227
- return j(O, _), { __sfc: !0, props: t, emit: e, slots: a, hasSlot: o, conditionalItemsClasses: C, inputValue: c, errorMessageId: m, shouldShowGroupError: v, onInput: h, isRadioVariant: _, BentoSelectionCard: oe, ControlsGroup: Q, ErrorMessage: W };
228
- }
229
- });
230
- var re = function() {
231
- var e = this, t = e._self._c, a = e._self._setupProxy;
232
- return t(a.ControlsGroup, { staticClass: "b-selection-card-group", attrs: { "aria-describedby": a.shouldShowGroupError ? a.errorMessageId : null, label: e.label, "hide-label": e.hideLabel, description: e.description, disabled: e.disabled, "tooltip-text": e.tooltipText, readonly: e.readonly, required: e.required, optional: e.optional, "component-name": "selection-card-group" } }, [t("div", { staticClass: "b-selection-card-group__items", class: a.conditionalItemsClasses }, e._l(e.items, function(o) {
233
- return t(a.BentoSelectionCard, e._b({ key: `selection-card-${o.value}`, staticClass: "b-selection-card-group__item", attrs: { "model-value": a.inputValue, readonly: e.readonly || o.readonly, "has-error": a.shouldShowGroupError, disabled: e.disabled || o.disabled }, on: { "update:model-value": a.onInput }, scopedSlots: e._u([a.hasSlot("icon") && o.icon ? { key: "icon", fn: function() {
234
- return [e._t("icon", null, null, o)];
235
- }, proxy: !0 } : null, a.hasSlot("content") && o.content ? { key: "content", fn: function() {
236
- return [e._t("content", null, null, o)];
237
- }, proxy: !0 } : null, a.hasSlot("dynamicContent") && o.dynamicContent ? { key: "dynamicContent", fn: function() {
238
- return [e._t("dynamicContent", null, null, o)];
239
- }, proxy: !0 } : null], null, !0) }, "bento-selection-card", o, !1));
240
- }), 1), a.shouldShowGroupError ? t(a.ErrorMessage, { staticClass: "b-selection-card-group__error-message", attrs: { id: a.errorMessageId, "error-message": e.errorMessage } }) : e._e()], 1);
241
- }, se = [], ie = /* @__PURE__ */ D(
242
- ne,
243
- re,
244
- se,
245
- !1,
246
- null,
247
- "7cd98116"
248
- );
249
- const ve = ie.exports;
250
- export {
251
- oe as B,
252
- b as a,
253
- ve as s
254
- };
255
- //# sourceMappingURL=selection-card-group.CW7c72r2.js.map