@adyen/bento-vue3 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/packages/vue2/src/components/avatar-image/avatar-image.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/button/button.vue.d.ts +77 -77
- package/dist/@types/packages/vue2/src/components/button/components/loading-button/loading-button.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/card/card.vue.d.ts +7 -1
- package/dist/@types/packages/vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useCalculateColumnWidth/useCalculateColumnWidth.d.ts +6 -2
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useCalculateStickyElementHeight/useCalculateStickyElementHeight.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useColumnReorderer/useColumnReorderer.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useConfigSettings/useConfigSettings.d.ts +3 -0
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.types.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +49 -11
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-default-textbox/dropdown-default-textbox.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue.d.ts +32 -33
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-small-textbox/dropdown-small-textbox.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/dropdown/dropdown.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +60 -60
- package/dist/@types/packages/vue2/src/components/filter-bar/components/base-filter-button/base-filter-button.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/filter-bar/components/boolean-filter/boolean-filter.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/filter-bar/components/date-filter/date-filter.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/filter-bar/components/date-range-filter/date-range-filter.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/filter-bar/components/input-filter/input-filter.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/filter-bar/components/range-filter/range-filter.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/select-filter.vue.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/filter-bar/filter-bar.types.d.ts +7 -3
- package/dist/@types/packages/vue2/src/components/filter-bar/filter-bar.vue.d.ts +11 -1
- package/dist/@types/packages/vue2/src/components/form-layout/components/form-layout-field-tip/form-layout-field-tip.vue.d.ts +17 -1
- package/dist/@types/packages/vue2/src/components/form-layout/components/form-layout-field-tip/form-layout-tip.types.d.ts +3 -0
- package/dist/@types/packages/vue2/src/components/header/header.vue.d.ts +3 -0
- package/dist/@types/packages/vue2/src/components/info-icon/info-icon.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/internal/base-button/base-button.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/internal/fixed-scroller/composables/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/internal/fixed-scroller/composables/useFixedScroller.d.ts +15 -0
- package/dist/@types/packages/vue2/src/components/internal/fixed-scroller/fixed-scroller.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/internal/fixed-scroller/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/internal/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/menu/components/menu-item/menu-item.vue.d.ts +4 -5
- package/dist/@types/packages/vue2/src/components/menu/menu.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/modal/modal.vue.d.ts +10 -1
- package/dist/@types/packages/vue2/src/components/pagination/pagination.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/popover/popover.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/popper-container/popper-container.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/radio-group/radio-group.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/status/status.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/stepper/stepper.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item/summary-grid-item.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-amount/summary-grid-item-amount.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-numeric/summary-grid-item-numeric.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-percentage/summary-grid-item-percentage.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/tabs/components/tab.types.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/tabs/tabs.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/tag/tag.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/textarea/textarea.vue.d.ts +24 -52
- package/dist/@types/packages/vue2/src/components/timeline/components/timeline-item/timeline-item.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/tooltip/tooltip.vue.d.ts +13 -13
- package/dist/@types/packages/vue2/src/composables/use-expandable-content-height/use-expandable-content-height.d.ts +4 -0
- package/dist/@types/packages/vue2/src/templates/data-grid-template/data-grid-template.keys.d.ts +1 -0
- package/dist/@types/packages/vue2/src/templates/data-grid-template/data-grid-template.types.d.ts +6 -0
- package/dist/@types/packages/vue2/src/templates/data-grid-template/data-grid-template.vue.d.ts +77 -1
- package/dist/@types/packages/vue2/src/templates/data-grid-template/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/utils/ts/truncate.d.ts +1 -1
- package/dist/accordion.js +42 -47
- package/dist/accordion.js.map +1 -1
- package/dist/alert.js +4 -4
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button.css +1 -1
- package/dist/assets/controls-group.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/assets/index10.css +1 -1
- package/dist/assets/index11.css +1 -1
- package/dist/assets/index12.css +1 -1
- package/dist/assets/index13.css +1 -1
- package/dist/assets/index14.css +1 -1
- package/dist/assets/index15.css +1 -1
- package/dist/assets/index16.css +1 -1
- package/dist/assets/index17.css +1 -1
- package/dist/assets/index18.css +1 -1
- package/dist/assets/index19.css +1 -1
- package/dist/assets/index2.css +1 -1
- package/dist/assets/index20.css +1 -1
- package/dist/assets/index21.css +1 -1
- package/dist/assets/index22.css +1 -1
- package/dist/assets/index23.css +1 -1
- package/dist/assets/index24.css +1 -1
- package/dist/assets/index25.css +1 -1
- package/dist/assets/index26.css +1 -1
- package/dist/assets/index28.css +1 -1
- package/dist/assets/index29.css +1 -1
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index30.css +1 -1
- package/dist/assets/index31.css +1 -1
- package/dist/assets/index32.css +1 -1
- package/dist/assets/index33.css +1 -1
- package/dist/assets/index34.css +1 -1
- package/dist/assets/index35.css +1 -1
- package/dist/assets/index36.css +1 -1
- package/dist/assets/index37.css +1 -1
- package/dist/assets/index38.css +1 -1
- package/dist/assets/index39.css +1 -1
- package/dist/assets/index4.css +1 -1
- package/dist/assets/index40.css +1 -1
- package/dist/assets/index41.css +1 -1
- package/dist/assets/index42.css +1 -1
- package/dist/assets/index43.css +1 -1
- package/dist/assets/index44.css +1 -1
- package/dist/assets/index45.css +1 -0
- package/dist/assets/index5.css +1 -1
- package/dist/assets/index6.css +1 -1
- package/dist/assets/index7.css +1 -1
- package/dist/assets/index8.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/assets/loading-button.css +1 -1
- package/dist/avatar-image.js +1 -1
- package/dist/badge.js +1 -1
- package/dist/button.js +5 -5
- package/dist/card.js +135 -121
- package/dist/card.js.map +1 -1
- package/dist/checkbox.js +24 -25
- package/dist/checkbox.js.map +1 -1
- package/dist/chunks/{base-button.9740f320.js → base-button.90687c75.js} +3 -3
- package/dist/chunks/{base-button.9740f320.js.map → base-button.90687c75.js.map} +1 -1
- package/dist/chunks/{base-modal.be77971f.js → base-modal.c956b084.js} +58 -58
- package/dist/chunks/base-modal.c956b084.js.map +1 -0
- package/dist/chunks/{button.7072457f.js → button.9d72e2d7.js} +3 -3
- package/dist/chunks/{button.7072457f.js.map → button.9d72e2d7.js.map} +1 -1
- package/dist/chunks/{calendar.1e50c7d1.js → calendar.e7db78d0.js} +6 -5
- package/dist/chunks/{calendar.1e50c7d1.js.map → calendar.e7db78d0.js.map} +1 -1
- package/dist/chunks/{checkbox.638bab98.js → checkbox.ecbb4f0c.js} +4 -4
- package/dist/chunks/{checkbox.638bab98.js.map → checkbox.ecbb4f0c.js.map} +1 -1
- package/dist/chunks/{controls-group.efcf4e8d.js → controls-group.34f1f82a.js} +2 -2
- package/dist/chunks/{controls-group.efcf4e8d.js.map → controls-group.34f1f82a.js.map} +1 -1
- package/dist/chunks/{copy.527c3d76.js → copy.aaec57b6.js} +3 -3
- package/dist/chunks/{copy.527c3d76.js.map → copy.aaec57b6.js.map} +1 -1
- package/dist/chunks/date-input.9186a0bf.js.map +1 -1
- package/dist/chunks/{dropdown-default-textbox.a1789dc7.js → dropdown-default-textbox.88a42e9b.js} +3 -3
- package/dist/chunks/{dropdown-default-textbox.a1789dc7.js.map → dropdown-default-textbox.88a42e9b.js.map} +1 -1
- package/dist/chunks/{dropdown.22e51667.js → dropdown.6a484461.js} +182 -177
- package/dist/chunks/dropdown.6a484461.js.map +1 -0
- package/dist/chunks/{error-message.37b6c7aa.js → error-message.11e1fa1f.js} +2 -2
- package/dist/chunks/{error-message.37b6c7aa.js.map → error-message.11e1fa1f.js.map} +1 -1
- package/dist/chunks/{footer-actions.5275203a.js → footer-actions.a65cb2e3.js} +3 -3
- package/dist/chunks/{footer-actions.5275203a.js.map → footer-actions.a65cb2e3.js.map} +1 -1
- package/dist/chunks/{grid-layout.c98e6bc7.js → grid-layout.7c919507.js} +2 -2
- package/dist/chunks/{grid-layout.c98e6bc7.js.map → grid-layout.7c919507.js.map} +1 -1
- package/dist/chunks/{index.c22c4278.js → index.424e2ea4.js} +6 -6
- package/dist/chunks/{index.c22c4278.js.map → index.424e2ea4.js.map} +1 -1
- package/dist/chunks/{index.dd20095f.js → index.655b761f.js} +3 -3
- package/dist/chunks/{index.dd20095f.js.map → index.655b761f.js.map} +1 -1
- package/dist/chunks/{index.c62ea69f.js → index.754349ff.js} +2 -2
- package/dist/chunks/{index.c62ea69f.js.map → index.754349ff.js.map} +1 -1
- package/dist/chunks/{index.a57930ba.js → index.84f6360f.js} +11 -10
- package/dist/chunks/{index.a57930ba.js.map → index.84f6360f.js.map} +1 -1
- package/dist/chunks/{index.32ed68b7.js → index.9fc54b60.js} +2 -2
- package/dist/chunks/{index.32ed68b7.js.map → index.9fc54b60.js.map} +1 -1
- package/dist/chunks/{index.604da8e9.js → index.bc9e0cde.js} +3 -3
- package/dist/chunks/{index.604da8e9.js.map → index.bc9e0cde.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.fa70334e.js → listbox-option-tag.ea9f377f.js} +3 -3
- package/dist/chunks/{listbox-option-tag.fa70334e.js.map → listbox-option-tag.ea9f377f.js.map} +1 -1
- package/dist/chunks/{listbox.4205c0de.js → listbox.a7255ce1.js} +4 -4
- package/dist/chunks/{listbox.4205c0de.js.map → listbox.a7255ce1.js.map} +1 -1
- package/dist/chunks/{loading-button.41c15584.js → loading-button.fb1f20a3.js} +32 -32
- package/dist/chunks/loading-button.fb1f20a3.js.map +1 -0
- package/dist/chunks/on-click-outside.3e0c3e2a.js.map +1 -1
- package/dist/chunks/{tooltip.c8350cd0.js → tooltip.6af06509.js} +64 -63
- package/dist/chunks/tooltip.6af06509.js.map +1 -0
- package/dist/chunks/use-expandable-content-height.62fc84e5.js +17 -0
- package/dist/chunks/use-expandable-content-height.62fc84e5.js.map +1 -0
- package/dist/chunks/use-has-slot.4d98bf29.js +15 -0
- package/dist/chunks/use-has-slot.4d98bf29.js.map +1 -0
- package/dist/code-snippet.js +7 -7
- package/dist/code-snippet.js.map +1 -1
- package/dist/country.js +2 -2
- package/dist/currency.js +1 -1
- package/dist/data-grid.js +944 -888
- package/dist/data-grid.js.map +1 -1
- package/dist/date-picker.js +7 -7
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +1 -1
- package/dist/divider.js +1 -1
- package/dist/dropdown.js +4 -4
- package/dist/empty-state.js +3 -3
- package/dist/filter-bar.js +990 -904
- package/dist/filter-bar.js.map +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +81 -70
- package/dist/form-layout.js.map +1 -1
- package/dist/header.js +92 -87
- package/dist/header.js.map +1 -1
- package/dist/index.js +14 -14
- package/dist/info-icon.js +12 -12
- package/dist/info-icon.js.map +1 -1
- package/dist/input-field.js +115 -110
- package/dist/input-field.js.map +1 -1
- package/dist/internal.js +144 -18
- package/dist/internal.js.map +1 -1
- package/dist/link.js +38 -35
- package/dist/link.js.map +1 -1
- package/dist/loading-indicator.js +1 -1
- package/dist/menu.js +8 -6
- package/dist/menu.js.map +1 -1
- package/dist/modal.js +52 -44
- package/dist/modal.js.map +1 -1
- package/dist/pagination.js +4 -4
- package/dist/payment-method.js +2 -2
- package/dist/popover.js +4 -4
- package/dist/popper-container.js +1 -1
- package/dist/radio-group.js +5 -5
- package/dist/search-bar.js +7 -7
- package/dist/search-bar.js.map +1 -1
- package/dist/segmented-control.js +4 -4
- package/dist/sidepanel.js +19 -19
- package/dist/sidepanel.js.map +1 -1
- package/dist/status.js +2 -2
- package/dist/stepper.js +3 -3
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +5 -5
- package/dist/tabs.js +64 -64
- package/dist/tabs.js.map +1 -1
- package/dist/tag.js +3 -3
- package/dist/textarea.js +188 -229
- package/dist/textarea.js.map +1 -1
- package/dist/timeline.js +37 -37
- package/dist/timeline.js.map +1 -1
- package/dist/toast.js +4 -4
- package/dist/toggle.js +3 -3
- package/dist/typography.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +5 -3
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useCalculateColumnHeadersTopPosition/useCalculateColumnHeadersTopPosition.d.ts +0 -2
- package/dist/chunks/base-modal.be77971f.js.map +0 -1
- package/dist/chunks/dropdown.22e51667.js.map +0 -1
- package/dist/chunks/loading-button.41c15584.js.map +0 -1
- package/dist/chunks/tooltip.c8350cd0.js.map +0 -1
- package/dist/chunks/use-has-slot.3daaffc6.js +0 -17
- package/dist/chunks/use-has-slot.3daaffc6.js.map +0 -1
package/dist/info-icon.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { openBlock as i, createElementBlock as n, mergeProps as f, toDisplayString as h, createCommentVNode as v, createElementVNode as e, pushScopeId as m, popScopeId as g, defineComponent as
|
|
1
|
+
import { openBlock as i, createElementBlock as n, mergeProps as f, toDisplayString as h, createCommentVNode as v, createElementVNode as e, pushScopeId as m, popScopeId as g, defineComponent as b, resolveComponent as $, resolveDirective as I, withDirectives as w, createVNode as y } from "vue";
|
|
2
2
|
import { PopperContainerPosition as s } from "./popper-container.js";
|
|
3
|
-
import { b as S } from "./chunks/tooltip.
|
|
4
|
-
import { _ as
|
|
5
|
-
import "./assets/
|
|
6
|
-
let
|
|
3
|
+
import { b as S } from "./chunks/tooltip.6af06509.js";
|
|
4
|
+
import { _ as c } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
5
|
+
import "./assets/index8.css";
|
|
6
|
+
let r = 0;
|
|
7
7
|
const P = {
|
|
8
8
|
beforeCreate() {
|
|
9
|
-
this.uuid =
|
|
9
|
+
this.uuid = r.toString(), r += 1;
|
|
10
10
|
}
|
|
11
11
|
}, o = (t) => (m("data-v-20ae506d"), t = t(), g(), t), T = { key: 0 }, H = ["clip-path"], V = /* @__PURE__ */ o(() => /* @__PURE__ */ e("path", { d: "M8.58147 5.05557C8.47159 5.22002 8.31541 5.34819 8.13268 5.42388C7.94996 5.49957 7.74889 5.51937 7.55491 5.48079C7.36093 5.4422 7.18275 5.34696 7.04289 5.20711C6.90304 5.06725 6.8078 4.88907 6.76922 4.69509C6.73063 4.50111 6.75043 4.30004 6.82612 4.11732C6.90181 3.93459 7.02998 3.77841 7.19443 3.66853C7.35888 3.55865 7.55222 3.5 7.75 3.5C8.01522 3.5 8.26957 3.60536 8.45711 3.79289C8.64464 3.98043 8.75 4.23478 8.75 4.5C8.75 4.69778 8.69135 4.89112 8.58147 5.05557Z" }, null, -1)), B = /* @__PURE__ */ o(() => /* @__PURE__ */ e("path", { d: "M6.25 7C6.25 6.58579 6.58579 6.25 7 6.25H8C8.41421 6.25 8.75 6.58579 8.75 7V10.25H9C9.41421 10.25 9.75 10.5858 9.75 11C9.75 11.4142 9.41421 11.75 9 11.75H7C6.58579 11.75 6.25 11.4142 6.25 11C6.25 10.5858 6.58579 10.25 7 10.25H7.25V7.75H7C6.58579 7.75 6.25 7.41421 6.25 7Z" }, null, -1)), D = /* @__PURE__ */ o(() => /* @__PURE__ */ e("path", { d: "M9.51195 0.398918C8.0086 0.0998821 6.45033 0.253358 5.0342 0.839937C3.61808 1.42652 2.40769 2.41985 1.55611 3.69433C0.70453 4.96881 0.25 6.4672 0.25 8C0.25 10.0554 1.06652 12.0267 2.51992 13.4801C3.97333 14.9335 5.94457 15.75 8 15.75C9.53281 15.75 11.0312 15.2955 12.3057 14.4439C13.5801 13.5923 14.5735 12.3819 15.1601 10.9658C15.7466 9.54967 15.9001 7.99141 15.6011 6.48805C15.3021 4.9847 14.5639 3.60378 13.4801 2.51993C12.3962 1.43607 11.0153 0.697953 9.51195 0.398918ZM5.60823 2.22576C6.75027 1.75271 8.00693 1.62894 9.21931 1.8701C10.4317 2.11125 11.5453 2.70651 12.4194 3.58059C13.2935 4.45466 13.8888 5.56831 14.1299 6.78069C14.3711 7.99307 14.2473 9.24974 13.7742 10.3918C13.3012 11.5338 12.5001 12.5099 11.4723 13.1967C10.4445 13.8834 9.23613 14.25 8 14.25C6.3424 14.25 4.75268 13.5915 3.58058 12.4194C2.40848 11.2473 1.75 9.65761 1.75 8C1.75 6.76387 2.11656 5.5555 2.80331 4.52769C3.49007 3.49988 4.46619 2.6988 5.60823 2.22576Z" }, null, -1)), M = [
|
|
12
12
|
V,
|
|
@@ -19,7 +19,7 @@ const P = {
|
|
|
19
19
|
}, null, -1)), x = [
|
|
20
20
|
k
|
|
21
21
|
];
|
|
22
|
-
function N(t, l, _,
|
|
22
|
+
function N(t, d, l, _, p, a) {
|
|
23
23
|
return i(), n("svg", f({ role: "img" }, t.$attrs, {
|
|
24
24
|
xmlns: "http://www.w3.org/2000/svg",
|
|
25
25
|
width: "16",
|
|
@@ -40,7 +40,7 @@ function N(t, l, _, d, p, a) {
|
|
|
40
40
|
])
|
|
41
41
|
], 16);
|
|
42
42
|
}
|
|
43
|
-
const E = /* @__PURE__ */
|
|
43
|
+
const E = /* @__PURE__ */ c(P, [["render", N], ["__scopeId", "data-v-20ae506d"]]), O = b({
|
|
44
44
|
name: "bento-info-icon",
|
|
45
45
|
components: { InfoIcon: E },
|
|
46
46
|
directives: { BentoTooltipDirective: S },
|
|
@@ -60,11 +60,11 @@ const E = /* @__PURE__ */ r(P, [["render", N], ["__scopeId", "data-v-20ae506d"]]
|
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
const j = ["aria-label"];
|
|
63
|
-
function q(t, l, _,
|
|
64
|
-
const C =
|
|
63
|
+
function q(t, d, l, _, p, a) {
|
|
64
|
+
const C = $("info-icon", !0), u = I("bento-tooltip-directive");
|
|
65
65
|
return w((i(), n("span", {
|
|
66
|
-
class: "b-info-icon",
|
|
67
66
|
"aria-label": t.tooltipText,
|
|
67
|
+
class: "b-info-icon",
|
|
68
68
|
tabindex: "0"
|
|
69
69
|
}, [
|
|
70
70
|
y(C, {
|
|
@@ -75,7 +75,7 @@ function q(t, l, _, d, p, a) {
|
|
|
75
75
|
[u, t.tooltipText, t.tooltipPosition]
|
|
76
76
|
]);
|
|
77
77
|
}
|
|
78
|
-
const G = /* @__PURE__ */
|
|
78
|
+
const G = /* @__PURE__ */ c(O, [["render", q], ["__scopeId", "data-v-ded345b1"]]);
|
|
79
79
|
export {
|
|
80
80
|
G as BentoInfoIcon
|
|
81
81
|
};
|
package/dist/info-icon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info-icon.js","sources":["../../../node_modules/@adyen/ui-assets-icons-16/dist/vue/info.vue","../../vue2/src/components/info-icon/info-icon.vue"],"sourcesContent":["\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><g fill=\"#00112C\" fill-rule=\"evenodd\" :clip-path=\"'url(#uia-icons-16-info__a' + uuid + ')'\" clip-rule=\"evenodd\"><path d=\"M8.58147 5.05557C8.47159 5.22002 8.31541 5.34819 8.13268 5.42388C7.94996 5.49957 7.74889 5.51937 7.55491 5.48079C7.36093 5.4422 7.18275 5.34696 7.04289 5.20711C6.90304 5.06725 6.8078 4.88907 6.76922 4.69509C6.73063 4.50111 6.75043 4.30004 6.82612 4.11732C6.90181 3.93459 7.02998 3.77841 7.19443 3.66853C7.35888 3.55865 7.55222 3.5 7.75 3.5C8.01522 3.5 8.26957 3.60536 8.45711 3.79289C8.64464 3.98043 8.75 4.23478 8.75 4.5C8.75 4.69778 8.69135 4.89112 8.58147 5.05557Z\"/><path d=\"M6.25 7C6.25 6.58579 6.58579 6.25 7 6.25H8C8.41421 6.25 8.75 6.58579 8.75 7V10.25H9C9.41421 10.25 9.75 10.5858 9.75 11C9.75 11.4142 9.41421 11.75 9 11.75H7C6.58579 11.75 6.25 11.4142 6.25 11C6.25 10.5858 6.58579 10.25 7 10.25H7.25V7.75H7C6.58579 7.75 6.25 7.41421 6.25 7Z\"/><path d=\"M9.51195 0.398918C8.0086 0.0998821 6.45033 0.253358 5.0342 0.839937C3.61808 1.42652 2.40769 2.41985 1.55611 3.69433C0.70453 4.96881 0.25 6.4672 0.25 8C0.25 10.0554 1.06652 12.0267 2.51992 13.4801C3.97333 14.9335 5.94457 15.75 8 15.75C9.53281 15.75 11.0312 15.2955 12.3057 14.4439C13.5801 13.5923 14.5735 12.3819 15.1601 10.9658C15.7466 9.54967 15.9001 7.99141 15.6011 6.48805C15.3021 4.9847 14.5639 3.60378 13.4801 2.51993C12.3962 1.43607 11.0153 0.697953 9.51195 0.398918ZM5.60823 2.22576C6.75027 1.75271 8.00693 1.62894 9.21931 1.8701C10.4317 2.11125 11.5453 2.70651 12.4194 3.58059C13.2935 4.45466 13.8888 5.56831 14.1299 6.78069C14.3711 7.99307 14.2473 9.24974 13.7742 10.3918C13.3012 11.5338 12.5001 12.5099 11.4723 13.1967C10.4445 13.8834 9.23613 14.25 8 14.25C6.3424 14.25 4.75268 13.5915 3.58058 12.4194C2.40848 11.2473 1.75 9.65761 1.75 8C1.75 6.76387 2.11656 5.5555 2.80331 4.52769C3.49007 3.49988 4.46619 2.6988 5.60823 2.22576Z\"/></g><defs><clipPath :id=\"'uia-icons-16-info__a' + uuid\"><rect width=\"16\" height=\"16\" fill=\"#fff\"/></clipPath></defs></svg>\n</template>\n<script>\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n<style scoped lang=\"scss\">\n svg {\n display: inline-flex;\n flex-shrink: 0;\n }\n \n svg,\n svg * {\n fill: currentcolor;\n }\n</style>\n","<template>\n <span\n v-bento-tooltip-directive:[tooltipPosition]=\"tooltipText\"\n
|
|
1
|
+
{"version":3,"file":"info-icon.js","sources":["../../../node_modules/@adyen/ui-assets-icons-16/dist/vue/info.vue","../../vue2/src/components/info-icon/info-icon.vue"],"sourcesContent":["\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><g fill=\"#00112C\" fill-rule=\"evenodd\" :clip-path=\"'url(#uia-icons-16-info__a' + uuid + ')'\" clip-rule=\"evenodd\"><path d=\"M8.58147 5.05557C8.47159 5.22002 8.31541 5.34819 8.13268 5.42388C7.94996 5.49957 7.74889 5.51937 7.55491 5.48079C7.36093 5.4422 7.18275 5.34696 7.04289 5.20711C6.90304 5.06725 6.8078 4.88907 6.76922 4.69509C6.73063 4.50111 6.75043 4.30004 6.82612 4.11732C6.90181 3.93459 7.02998 3.77841 7.19443 3.66853C7.35888 3.55865 7.55222 3.5 7.75 3.5C8.01522 3.5 8.26957 3.60536 8.45711 3.79289C8.64464 3.98043 8.75 4.23478 8.75 4.5C8.75 4.69778 8.69135 4.89112 8.58147 5.05557Z\"/><path d=\"M6.25 7C6.25 6.58579 6.58579 6.25 7 6.25H8C8.41421 6.25 8.75 6.58579 8.75 7V10.25H9C9.41421 10.25 9.75 10.5858 9.75 11C9.75 11.4142 9.41421 11.75 9 11.75H7C6.58579 11.75 6.25 11.4142 6.25 11C6.25 10.5858 6.58579 10.25 7 10.25H7.25V7.75H7C6.58579 7.75 6.25 7.41421 6.25 7Z\"/><path d=\"M9.51195 0.398918C8.0086 0.0998821 6.45033 0.253358 5.0342 0.839937C3.61808 1.42652 2.40769 2.41985 1.55611 3.69433C0.70453 4.96881 0.25 6.4672 0.25 8C0.25 10.0554 1.06652 12.0267 2.51992 13.4801C3.97333 14.9335 5.94457 15.75 8 15.75C9.53281 15.75 11.0312 15.2955 12.3057 14.4439C13.5801 13.5923 14.5735 12.3819 15.1601 10.9658C15.7466 9.54967 15.9001 7.99141 15.6011 6.48805C15.3021 4.9847 14.5639 3.60378 13.4801 2.51993C12.3962 1.43607 11.0153 0.697953 9.51195 0.398918ZM5.60823 2.22576C6.75027 1.75271 8.00693 1.62894 9.21931 1.8701C10.4317 2.11125 11.5453 2.70651 12.4194 3.58059C13.2935 4.45466 13.8888 5.56831 14.1299 6.78069C14.3711 7.99307 14.2473 9.24974 13.7742 10.3918C13.3012 11.5338 12.5001 12.5099 11.4723 13.1967C10.4445 13.8834 9.23613 14.25 8 14.25C6.3424 14.25 4.75268 13.5915 3.58058 12.4194C2.40848 11.2473 1.75 9.65761 1.75 8C1.75 6.76387 2.11656 5.5555 2.80331 4.52769C3.49007 3.49988 4.46619 2.6988 5.60823 2.22576Z\"/></g><defs><clipPath :id=\"'uia-icons-16-info__a' + uuid\"><rect width=\"16\" height=\"16\" fill=\"#fff\"/></clipPath></defs></svg>\n</template>\n<script>\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n<style scoped lang=\"scss\">\n svg {\n display: inline-flex;\n flex-shrink: 0;\n }\n \n svg,\n svg * {\n fill: currentcolor;\n }\n</style>\n","<template>\n <span\n v-bento-tooltip-directive:[tooltipPosition]=\"tooltipText\"\n :aria-label=\"tooltipText\"\n class=\"b-info-icon\"\n tabindex=\"0\"\n >\n <info-icon :svg-title=\"tooltipText\" class=\"b-info-icon__svg\" />\n </span>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import { PopperContainerPosition } from '@/components/popper-container';\n import { BentoTooltipDirective } from '@/directives';\n import InfoIcon from '@adyen/ui-assets-icons-16/vue/info';\n\n /**\n * @example\n * import { BentoInfoIcon } from '@adyen/adl-vue-components';\n *\n * export default {\n * components: { BentoInfoIcon },\n * template: `\n * <bento-info-icon tooltip-text=\"Text on hover\" />\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-info-icon',\n components: { InfoIcon },\n directives: { BentoTooltipDirective },\n props: {\n /**\n * Text showed in the info-icon tooltip on hover\n */\n tooltipText: { type: String, required: true },\n\n /**\n * Position the tooltip should take if space is available. Defaults to 'auto'\n */\n tooltipPosition: {\n type: String as PropType<PopperContainerPosition | `${PopperContainerPosition}`>,\n default: PopperContainerPosition.AUTO,\n validator: (value: PopperContainerPosition) => Object.values(PopperContainerPosition).includes(value),\n },\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./info-icon.scss\" />\n"],"names":["uuid","openBlock","createElementBlock","mergeProps","_ctx","_hoisted_1$1","toDisplayString","_sfc_main","defineComponent","InfoIcon","BentoTooltipDirective","PopperContainerPosition","value"],"mappings":";;;;;AAKI,IAAAA,IAAA;;EAGI,eAAA;8BAEIA,KAAA;AAAA;;;;;;EARggE,OAAA;AAAA,EAAW,QAAA;AAAA,EAAY,MAAA;;;;;AAA/hE,SAAAC,EAAA,GAAAC,EAAA,OAAAC,EAAA,EAAA,MAAA,MAAA,GAAAC,EAAA,QAAA;AAAA,IAAgC,OAAA;AAAA,IAAmC,OAAA;AAAA,IAAW,QAAA;AAAA,IAAY,MAAA;AAAA;6BAAYH,EAAA,GAAAC,EAAA,SAAAG,GAAAC,EAAAF,EAAA,OAAA,WAAA,CAAA,GAAA,CAAA;;MAAsE,MAAA;AAAA,MAAe,aAAA;AAAA,MAAqB,aAAA,8BAAAA,EAAA,OAAA;AAAA,MAAqD,aAAA;AAAA;;;QAA0tD,IAAA,yBAAAA,EAAA;AAAA;;;;mFC0B/9DG,IAAAC,EAAA;AAAA,EAA+B,MAAA;AAAA,EACrB,YAAA,EAAA,UAAAC,EAAA;AAAA,EACiB,YAAA,EAAA,uBAAAC,EAAA;AAAA,EACa,OAAA;AAAA;AAAA;AAAA;AAAA,IAC7B,aAAA,EAAA,MAAA,QAAA,UAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAIyC,iBAAA;AAAA,MAK3B,MAAA;AAAA,MACP,SAAAC,EAAA;AAAA,MAC2B,WAAA,CAAAC,MAAA,OAAA,OAAAD,CAAA,EAAA,SAAAC,CAAA;AAAA,IACmE;AAAA,EACxG;AAER,CAAA;;;;;IA3CuB,cAAAR,EAAA;AAAA,IACP,OAAA;AAAA,IAEZ,UAAA;AAAA,EAAA,GAAA;AAAA;MAA4D,aAAAA,EAAA;AAAA;;;;;;;","x_google_ignoreList":[0]}
|
package/dist/input-field.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { defineComponent as re, useAttrs as
|
|
2
|
-
import { d as
|
|
3
|
-
import { u as
|
|
4
|
-
import { u as
|
|
5
|
-
import { g as
|
|
6
|
-
import { u as
|
|
7
|
-
import { B as
|
|
8
|
-
import { g as
|
|
9
|
-
import { u as
|
|
10
|
-
import { E as _e } from "./chunks/error-message.
|
|
11
|
-
import { _ as
|
|
12
|
-
import "./assets/
|
|
13
|
-
var v = /* @__PURE__ */ ((e) => (e.DEFAULT = "default", e.PAYMENT_METHOD = "payment-method", e.STATIC_VALUE = "static-value", e.DROPDOWN = "dropdown", e))(v || {}), l = /* @__PURE__ */ ((e) => (e.START = "start", e.END = "end", e))(l || {}), m = /* @__PURE__ */ ((e) => (e.CONDENSED = "condensed", e.DISABLED = "disabled", e.READONLY = "readonly", e.ERROR = "error", e.SMALL_PADDING_LEFT = "small-padding-left", e.SMALL_PADDING_RIGHT = "small-padding-right", e))(m || {}),
|
|
14
|
-
const
|
|
1
|
+
import { defineComponent as re, useAttrs as ne, useSlots as le, ref as I, toRef as se, computed as n, toRefs as ue, openBlock as d, createBlock as u, unref as t, normalizeClass as pe, withCtx as c, createElementBlock as f, createVNode as B, renderSlot as b, createTextVNode as q, toDisplayString as G, createCommentVNode as o, createElementVNode as x, withModifiers as z, mergeProps as N, withKeys as ce } from "vue";
|
|
2
|
+
import { d as fe, B as y } from "./chunks/index.9fc54b60.js";
|
|
3
|
+
import { u as be } from "./chunks/use-has-slot.4d98bf29.js";
|
|
4
|
+
import { u as ye } from "./chunks/use-form-layout-loading.d03e5d48.js";
|
|
5
|
+
import { g as A } from "./chunks/unique-id.a2a2b458.js";
|
|
6
|
+
import { u as ve } from "./chunks/i18n.6c402773.js";
|
|
7
|
+
import { B as j, a as W } from "./chunks/dropdown.6a484461.js";
|
|
8
|
+
import { g as me } from "./chunks/get-slot-text.bead058f.js";
|
|
9
|
+
import { u as De } from "./chunks/aria-label.ac9651a5.js";
|
|
10
|
+
import { E as _e } from "./chunks/error-message.11e1fa1f.js";
|
|
11
|
+
import { _ as we } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
12
|
+
import "./assets/index44.css";
|
|
13
|
+
var v = /* @__PURE__ */ ((e) => (e.DEFAULT = "default", e.PAYMENT_METHOD = "payment-method", e.STATIC_VALUE = "static-value", e.DROPDOWN = "dropdown", e))(v || {}), l = /* @__PURE__ */ ((e) => (e.START = "start", e.END = "end", e))(l || {}), m = /* @__PURE__ */ ((e) => (e.CONDENSED = "condensed", e.DISABLED = "disabled", e.READONLY = "readonly", e.ERROR = "error", e.SMALL_PADDING_LEFT = "small-padding-left", e.SMALL_PADDING_RIGHT = "small-padding-right", e))(m || {}), R = /* @__PURE__ */ ((e) => (e.SEARCH = "search", e.TEXT = "text", e.NUMBER = "number", e))(R || {}), Ae = /* @__PURE__ */ ((e) => (e.INPUT = "input", e.ESCAPE_PRESSED = "escape-pressed", e.UPDATE_DROPDOWN = "update:dropdown", e.DROPDOWN_INPUT = "dropdown-input", e.FOCUS = "focus", e.CHANGE = "change", e.BLUR = "blur", e.KEYDOWN = "keydown", e))(Ae || {});
|
|
14
|
+
const Y = {
|
|
15
15
|
"en-US": {
|
|
16
16
|
optional: "optional",
|
|
17
17
|
required: "required",
|
|
18
18
|
ariaLabelFallback: "Input field"
|
|
19
19
|
}
|
|
20
|
-
},
|
|
21
|
-
i18n: { messages:
|
|
22
|
-
},
|
|
23
|
-
...
|
|
20
|
+
}, Se = ["for"], ge = ["aria-disabled"], he = ["aria-hidden"], Ee = ["aria-hidden"], Le = ["id"], Te = ["id", "aria-label", "aria-describedby", "aria-owns", "aria-invalid", "placeholder", "type", "value", "disabled", "readonly"], ke = ["aria-hidden"], Ne = ["id"], Re = ["id"], Oe = {
|
|
21
|
+
i18n: { messages: Y }
|
|
22
|
+
}, Me = /* @__PURE__ */ re({
|
|
23
|
+
...Oe,
|
|
24
24
|
__name: "input-field",
|
|
25
25
|
props: {
|
|
26
26
|
/**
|
|
@@ -102,8 +102,8 @@ const x = {
|
|
|
102
102
|
*/
|
|
103
103
|
type: {
|
|
104
104
|
type: String,
|
|
105
|
-
default:
|
|
106
|
-
validator: (e) => Object.values(
|
|
105
|
+
default: R.TEXT,
|
|
106
|
+
validator: (e) => Object.values(R).includes(e)
|
|
107
107
|
},
|
|
108
108
|
/**
|
|
109
109
|
* Text displayed as the value of the input-field
|
|
@@ -119,50 +119,50 @@ const x = {
|
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
121
|
emits: ["update:dropdown", "blur", "change", "dropdown-input", "escape-pressed", "focus", "keydown", "input"],
|
|
122
|
-
setup(e, { expose:
|
|
123
|
-
const a = e,
|
|
124
|
-
() => a.variant === v.STATIC_VALUE && !!
|
|
125
|
-
),
|
|
122
|
+
setup(e, { expose: K, emit: s }) {
|
|
123
|
+
const a = e, O = ne(), T = le(), { t: k } = ve({ messages: Y }), p = be(T), M = I(null), $ = A("input"), _ = A("input-dropdown"), S = A("input-static-value"), P = A("input-description"), C = A("input-error"), { isReadOnly: D } = ye(se(a, "readonly")), g = n(
|
|
124
|
+
() => a.variant === v.STATIC_VALUE && !!T.staticValue
|
|
125
|
+
), F = n(() => a.variant === v.DEFAULT), X = n(() => a.variant === v.PAYMENT_METHOD), J = n(
|
|
126
126
|
() => g.value && a.staticValuePosition === l.START
|
|
127
|
-
),
|
|
127
|
+
), Q = n(
|
|
128
128
|
() => g.value && a.staticValuePosition === l.END
|
|
129
|
-
), h =
|
|
129
|
+
), h = n(() => a.variant === v.DROPDOWN && !!a.dropdown), V = n(
|
|
130
130
|
() => h.value && a.dropdownPosition === l.START
|
|
131
|
-
),
|
|
131
|
+
), U = n(
|
|
132
132
|
() => h.value && a.dropdownPosition === l.END
|
|
133
|
-
), E =
|
|
134
|
-
() => !a.disabled && !
|
|
135
|
-
),
|
|
136
|
-
ariaLabel:
|
|
133
|
+
), E = n(
|
|
134
|
+
() => !a.disabled && !D.value && (!!a.errorMessage || a.error)
|
|
135
|
+
), Z = n(() => h.value === !0 && g.value === !0 ? `${S} ${_}` : h.value === !0 ? `${_}` : g.value === !0 ? `${S}` : null), ee = I(O["aria-label"]), { ariaLabel: te } = ue(a), ae = De({
|
|
136
|
+
ariaLabel: ee.value,
|
|
137
137
|
// TODO: take this line away when the aria-label props is removed
|
|
138
|
-
label:
|
|
139
|
-
defaultFallback: p("default") ?
|
|
140
|
-
}),
|
|
141
|
-
() => `${p("description") ?
|
|
142
|
-
),
|
|
138
|
+
label: te,
|
|
139
|
+
defaultFallback: p("default") ? me(T)("default") : k("ariaLabelFallback")
|
|
140
|
+
}), de = n(
|
|
141
|
+
() => `${p("description") ? P : ""} ${E.value && a.errorMessage ? C : ""}`
|
|
142
|
+
), ie = n(() => ({
|
|
143
143
|
[`b-input-field--${m.CONDENSED}`]: a.condensed,
|
|
144
144
|
[`b-input-field--${m.DISABLED}`]: a.disabled,
|
|
145
|
-
[`b-input-field--${m.READONLY}`]:
|
|
145
|
+
[`b-input-field--${m.READONLY}`]: D.value,
|
|
146
146
|
[`b-input-field--${m.ERROR}`]: E.value,
|
|
147
|
-
[`b-input-field--${m.SMALL_PADDING_LEFT}`]:
|
|
148
|
-
[`b-input-field--${m.SMALL_PADDING_RIGHT}`]:
|
|
149
|
-
})),
|
|
150
|
-
!a.disabled && !
|
|
151
|
-
},
|
|
147
|
+
[`b-input-field--${m.SMALL_PADDING_LEFT}`]: V.value,
|
|
148
|
+
[`b-input-field--${m.SMALL_PADDING_RIGHT}`]: U.value
|
|
149
|
+
})), oe = (r) => {
|
|
150
|
+
!a.disabled && !D.value && s("input", r.target.value);
|
|
151
|
+
}, H = (r) => {
|
|
152
152
|
s("dropdown-input", r), s("update:dropdown", { ...a == null ? void 0 : a.dropdown, value: r });
|
|
153
|
-
},
|
|
154
|
-
|
|
153
|
+
}, L = () => {
|
|
154
|
+
M.value.focus();
|
|
155
155
|
};
|
|
156
|
-
return
|
|
157
|
-
focusInput:
|
|
158
|
-
}), a.error &&
|
|
156
|
+
return K({
|
|
157
|
+
focusInput: L
|
|
158
|
+
}), a.error && fe(
|
|
159
159
|
'BentoInputField "error" property',
|
|
160
160
|
`Use the BentoInputField "errorMessage" property instead to indicate that there is a modifier error.
|
|
161
161
|
Having the field as "undefined" will hide/remove the error.
|
|
162
162
|
<bento-dropdown errorMessage="Error message text" />`,
|
|
163
163
|
"2.0.0"
|
|
164
|
-
), (r,
|
|
165
|
-
class:
|
|
164
|
+
), (r, i) => (d(), u(t(y), {
|
|
165
|
+
class: pe(["b-input-field", t(ie)]),
|
|
166
166
|
"data-testid": "input-text-container",
|
|
167
167
|
el: "div",
|
|
168
168
|
variant: "body"
|
|
@@ -170,12 +170,12 @@ const x = {
|
|
|
170
170
|
default: c(() => [
|
|
171
171
|
t(p)("default") ? (d(), f("label", {
|
|
172
172
|
key: 0,
|
|
173
|
-
for: t(
|
|
173
|
+
for: t($),
|
|
174
174
|
class: "b-input-field__label",
|
|
175
175
|
"data-testid": "input-field-label",
|
|
176
|
-
onClick:
|
|
176
|
+
onClick: L
|
|
177
177
|
}, [
|
|
178
|
-
|
|
178
|
+
B(t(y), {
|
|
179
179
|
el: "span",
|
|
180
180
|
variant: "body",
|
|
181
181
|
stronger: ""
|
|
@@ -191,52 +191,56 @@ const x = {
|
|
|
191
191
|
el: "span"
|
|
192
192
|
}, {
|
|
193
193
|
default: c(() => [
|
|
194
|
-
|
|
194
|
+
q(" (" + G(t(k)("optional")) + ") ", 1)
|
|
195
195
|
]),
|
|
196
196
|
_: 1
|
|
197
|
-
})) :
|
|
197
|
+
})) : o("", !0),
|
|
198
198
|
e.required ? (d(), u(t(y), {
|
|
199
199
|
key: 1,
|
|
200
200
|
class: "b-input-field__label-requirement",
|
|
201
201
|
el: "span"
|
|
202
202
|
}, {
|
|
203
203
|
default: c(() => [
|
|
204
|
-
|
|
204
|
+
q(" (" + G(t(k)("required")) + ") ", 1)
|
|
205
205
|
]),
|
|
206
206
|
_: 1
|
|
207
|
-
})) :
|
|
208
|
-
], 8,
|
|
209
|
-
|
|
207
|
+
})) : o("", !0)
|
|
208
|
+
], 8, Se)) : o("", !0),
|
|
209
|
+
x("div", {
|
|
210
210
|
class: "b-input-field__input-box",
|
|
211
|
-
"
|
|
211
|
+
"data-testid": "input-box",
|
|
212
|
+
"aria-disabled": e.disabled,
|
|
213
|
+
onClick: L
|
|
212
214
|
}, [
|
|
213
|
-
t(
|
|
215
|
+
t(F) && t(p)("defaultIconBefore") ? (d(), f("span", {
|
|
214
216
|
key: 0,
|
|
215
217
|
"aria-hidden": e.ariaHidden ? "true" : void 0,
|
|
216
218
|
class: "b-input-field__default-icon-before"
|
|
217
219
|
}, [
|
|
218
220
|
b(r.$slots, "defaultIconBefore", {}, void 0, !0)
|
|
219
|
-
], 8,
|
|
220
|
-
t(
|
|
221
|
+
], 8, he)) : o("", !0),
|
|
222
|
+
t(X) && t(p)("paymentMethod") ? (d(), f("span", {
|
|
221
223
|
key: 1,
|
|
222
224
|
"aria-hidden": e.ariaHidden ? "true" : void 0,
|
|
223
225
|
class: "b-input-field__payment-method"
|
|
224
226
|
}, [
|
|
225
227
|
b(r.$slots, "paymentMethod", {}, void 0, !0)
|
|
226
|
-
], 8,
|
|
227
|
-
t(
|
|
228
|
+
], 8, Ee)) : o("", !0),
|
|
229
|
+
t(V) ? (d(), f("div", {
|
|
228
230
|
key: 2,
|
|
229
|
-
id: t(
|
|
230
|
-
class: "b-input-field__dropdown b-input-field__dropdown--start"
|
|
231
|
+
id: t(_),
|
|
232
|
+
class: "b-input-field__dropdown b-input-field__dropdown--start",
|
|
233
|
+
onClick: i[0] || (i[0] = z(() => {
|
|
234
|
+
}, ["stop"]))
|
|
231
235
|
}, [
|
|
232
|
-
e.dropdown ? (d(), u(t(
|
|
233
|
-
size: t(
|
|
236
|
+
e.dropdown ? (d(), u(t(j), N({ key: 0 }, e.dropdown, {
|
|
237
|
+
size: t(W).SMALL,
|
|
234
238
|
disabled: e.disabled,
|
|
235
|
-
readonly: t(
|
|
236
|
-
onInput:
|
|
237
|
-
}), null, 16, ["size", "disabled", "readonly"])) :
|
|
238
|
-
], 8,
|
|
239
|
-
t(
|
|
239
|
+
readonly: t(D),
|
|
240
|
+
onInput: H
|
|
241
|
+
}), null, 16, ["size", "disabled", "readonly"])) : o("", !0)
|
|
242
|
+
], 8, Le)) : o("", !0),
|
|
243
|
+
t(J) ? (d(), u(t(y), {
|
|
240
244
|
key: 3,
|
|
241
245
|
id: t(S),
|
|
242
246
|
class: "b-input-field__static-value b-input-field__static-value--start",
|
|
@@ -247,30 +251,29 @@ const x = {
|
|
|
247
251
|
b(r.$slots, "staticValue", {}, void 0, !0)
|
|
248
252
|
]),
|
|
249
253
|
_: 3
|
|
250
|
-
}, 8, ["id"])) :
|
|
251
|
-
|
|
252
|
-
id: t(O),
|
|
254
|
+
}, 8, ["id"])) : o("", !0),
|
|
255
|
+
x("input", N({ id: t($) }, t(O), {
|
|
253
256
|
ref_key: "inputFieldElement",
|
|
254
|
-
ref:
|
|
257
|
+
ref: M,
|
|
255
258
|
class: "b-input-field__input",
|
|
256
|
-
"aria-label": t(
|
|
257
|
-
"aria-describedby": t(
|
|
258
|
-
"aria-owns": t(
|
|
259
|
+
"aria-label": t(ae),
|
|
260
|
+
"aria-describedby": t(de),
|
|
261
|
+
"aria-owns": t(Z),
|
|
259
262
|
"aria-invalid": t(E),
|
|
260
263
|
placeholder: e.placeholder,
|
|
261
264
|
type: e.type,
|
|
262
265
|
value: e.value,
|
|
263
266
|
disabled: e.disabled,
|
|
264
|
-
readonly: t(
|
|
265
|
-
onInput:
|
|
266
|
-
onChange:
|
|
267
|
-
onFocus:
|
|
268
|
-
onBlur:
|
|
267
|
+
readonly: t(D),
|
|
268
|
+
onInput: oe,
|
|
269
|
+
onChange: i[1] || (i[1] = (w) => s("change")),
|
|
270
|
+
onFocus: i[2] || (i[2] = (w) => s("focus")),
|
|
271
|
+
onBlur: i[3] || (i[3] = (w) => s("blur")),
|
|
269
272
|
onKeydown: [
|
|
270
|
-
|
|
271
|
-
|
|
273
|
+
i[4] || (i[4] = (w) => s("keydown", w)),
|
|
274
|
+
i[5] || (i[5] = ce((w) => s("escape-pressed"), ["esc"]))
|
|
272
275
|
]
|
|
273
|
-
}, null,
|
|
276
|
+
}), null, 16, Te),
|
|
274
277
|
t(p)("iconAfter") ? (d(), f("span", {
|
|
275
278
|
key: 4,
|
|
276
279
|
"aria-hidden": e.ariaHidden ? "true" : void 0,
|
|
@@ -278,8 +281,8 @@ const x = {
|
|
|
278
281
|
"data-testid": "input-text__icon-after"
|
|
279
282
|
}, [
|
|
280
283
|
b(r.$slots, "iconAfter", {}, void 0, !0)
|
|
281
|
-
], 8,
|
|
282
|
-
t(
|
|
284
|
+
], 8, ke)) : o("", !0),
|
|
285
|
+
t(Q) ? (d(), u(t(y), {
|
|
283
286
|
key: 5,
|
|
284
287
|
id: t(S),
|
|
285
288
|
class: "b-input-field__static-value b-input-field__static-value--end",
|
|
@@ -290,36 +293,38 @@ const x = {
|
|
|
290
293
|
b(r.$slots, "staticValue", {}, void 0, !0)
|
|
291
294
|
]),
|
|
292
295
|
_: 3
|
|
293
|
-
}, 8, ["id"])) :
|
|
294
|
-
t(
|
|
296
|
+
}, 8, ["id"])) : o("", !0),
|
|
297
|
+
t(U) ? (d(), f("div", {
|
|
295
298
|
key: 6,
|
|
296
|
-
id: t(
|
|
297
|
-
class: "b-input-field__dropdown b-input-field__dropdown--end"
|
|
299
|
+
id: t(_),
|
|
300
|
+
class: "b-input-field__dropdown b-input-field__dropdown--end",
|
|
301
|
+
onClick: i[6] || (i[6] = z(() => {
|
|
302
|
+
}, ["stop"]))
|
|
298
303
|
}, [
|
|
299
|
-
e.dropdown ? (d(), u(t(
|
|
304
|
+
e.dropdown ? (d(), u(t(j), N({
|
|
300
305
|
key: 0,
|
|
301
|
-
id: t(
|
|
306
|
+
id: t(_)
|
|
302
307
|
}, e.dropdown, {
|
|
303
|
-
size: t(
|
|
308
|
+
size: t(W).SMALL,
|
|
304
309
|
disabled: e.disabled,
|
|
305
|
-
readonly: t(
|
|
306
|
-
onInput:
|
|
307
|
-
}), null, 16, ["id", "size", "disabled", "readonly"])) :
|
|
308
|
-
], 8, Ne)) :
|
|
309
|
-
], 8,
|
|
310
|
+
readonly: t(D),
|
|
311
|
+
onInput: H
|
|
312
|
+
}), null, 16, ["id", "size", "disabled", "readonly"])) : o("", !0)
|
|
313
|
+
], 8, Ne)) : o("", !0)
|
|
314
|
+
], 8, ge),
|
|
310
315
|
t(E) && e.errorMessage ? (d(), u(t(_e), {
|
|
311
316
|
key: 1,
|
|
312
|
-
id: t(
|
|
317
|
+
id: t(C),
|
|
313
318
|
"error-message": e.errorMessage,
|
|
314
319
|
class: "b-input-field__error-message"
|
|
315
|
-
}, null, 8, ["id", "error-message"])) :
|
|
320
|
+
}, null, 8, ["id", "error-message"])) : o("", !0),
|
|
316
321
|
t(p)("description") ? (d(), f("span", {
|
|
317
322
|
key: 2,
|
|
318
|
-
id: t(
|
|
323
|
+
id: t(P),
|
|
319
324
|
class: "b-input-field__description",
|
|
320
|
-
onClick:
|
|
325
|
+
onClick: L
|
|
321
326
|
}, [
|
|
322
|
-
|
|
327
|
+
B(t(y), {
|
|
323
328
|
el: "span",
|
|
324
329
|
variant: "body"
|
|
325
330
|
}, {
|
|
@@ -328,19 +333,19 @@ const x = {
|
|
|
328
333
|
]),
|
|
329
334
|
_: 3
|
|
330
335
|
})
|
|
331
|
-
], 8,
|
|
336
|
+
], 8, Re)) : o("", !0)
|
|
332
337
|
]),
|
|
333
338
|
_: 3
|
|
334
339
|
}, 8, ["class"]));
|
|
335
340
|
}
|
|
336
341
|
});
|
|
337
|
-
const ze = /* @__PURE__ */
|
|
342
|
+
const ze = /* @__PURE__ */ we(Me, [["__scopeId", "data-v-a3278800"]]);
|
|
338
343
|
export {
|
|
339
344
|
ze as BentoInputField,
|
|
340
345
|
l as BentoInputFieldElementPosition,
|
|
341
346
|
Ae as BentoInputFieldEvent,
|
|
342
347
|
m as BentoInputFieldStateClass,
|
|
343
|
-
|
|
348
|
+
R as BentoInputFieldType,
|
|
344
349
|
v as BentoInputFieldVariant
|
|
345
350
|
};
|
|
346
351
|
//# sourceMappingURL=input-field.js.map
|
package/dist/input-field.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-field.js","sources":["../../vue2/src/components/input-field/input-field.types.ts","../../vue2/src/components/input-field/input-field.vue"],"sourcesContent":["import { BentoDropdown } from '@/components/dropdown/';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldVariant {\n DEFAULT = 'default',\n PAYMENT_METHOD = 'payment-method',\n STATIC_VALUE = 'static-value',\n DROPDOWN = 'dropdown',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldElementPosition {\n START = 'start',\n END = 'end',\n}\n\nexport enum BentoInputFieldStateClass {\n CONDENSED = 'condensed',\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n SMALL_PADDING_LEFT = 'small-padding-left',\n SMALL_PADDING_RIGHT = 'small-padding-right',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldType {\n SEARCH = 'search',\n TEXT = 'text',\n NUMBER = 'number',\n}\n\nexport type BentoInputFieldValue = string | number;\n\ntype DropdownProps = InstanceType<typeof BentoDropdown>['$props'];\nexport type BentoInputDropdownProps = {\n items: DropdownProps['items'];\n value: DropdownProps['value'];\n};\n\n/**\n * @deprecated The use of these enums is no longer supported.\n * Use `v-on:` or `@` to listen to the events being emitted.\n * This enum will be removed in 2.0.\n */\nexport enum BentoInputFieldEvent {\n INPUT = 'input',\n ESCAPE_PRESSED = 'escape-pressed',\n UPDATE_DROPDOWN = 'update:dropdown',\n DROPDOWN_INPUT = 'dropdown-input',\n FOCUS = 'focus',\n CHANGE = 'change',\n BLUR = 'blur',\n KEYDOWN = 'keydown',\n}\n","<template>\n <bento-typography\n class=\"b-input-field\"\n data-testid=\"input-text-container\"\n :class=\"inputFieldConditionalClasses\"\n el=\"div\"\n variant=\"body\"\n >\n <!-- Label -->\n <label\n v-if=\"hasSlot('default')\"\n :for=\"inputFieldId\"\n class=\"b-input-field__label\"\n data-testid=\"input-field-label\"\n @click=\"focusInput\"\n >\n <bento-typography el=\"span\" variant=\"body\" stronger>\n <slot></slot>\n </bento-typography>\n <bento-typography v-if=\"optional\" class=\"b-input-field__label-requirement\" el=\"span\">\n ({{ t('optional') }})\n </bento-typography>\n <bento-typography v-if=\"required\" class=\"b-input-field__label-requirement\" el=\"span\">\n ({{ t('required') }})\n </bento-typography>\n </label>\n\n <div class=\"b-input-field__input-box\" :aria-disabled=\"disabled\">\n <!-- Optional Icon for Default text variant -->\n <span\n v-if=\"isDefaultVariant && hasSlot('defaultIconBefore')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__default-icon-before\"\n >\n <slot name=\"defaultIconBefore\" />\n </span>\n\n <!-- Mandatory Icon for Payment Method variant -->\n <span\n v-if=\"isPaymentMethodVariant && hasSlot('paymentMethod')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__payment-method\"\n >\n <slot name=\"paymentMethod\" />\n </span>\n\n <!-- Dropdown at start -->\n <div\n v-if=\"shouldDisplayDropdownAtStart\"\n :id=\"dropdownId\"\n class=\"b-input-field__dropdown b-input-field__dropdown--start\"\n >\n <bento-dropdown\n v-if=\"dropdown\"\n v-bind=\"dropdown\"\n :size=\"BentoDropdownSize.SMALL\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n\n <!-- Static Value at start -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtStart\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--start\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n\n <input\n :id=\"inputFieldId\"\n ref=\"inputFieldElement\"\n class=\"b-input-field__input\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"computedAriaDescribedBy\"\n :aria-owns=\"computedAriaOwns\"\n :aria-invalid=\"shouldShowError\"\n :placeholder=\"placeholder\"\n :type=\"type\"\n :value=\"value\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onInput\"\n @change=\"emit('change')\"\n @focus=\"emit('focus')\"\n @blur=\"emit('blur')\"\n @keydown=\"emit('keydown', $event)\"\n @keydown.esc=\"emit('escape-pressed')\"\n />\n <span\n v-if=\"hasSlot('iconAfter')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-after\"\n data-testid=\"input-text__icon-after\"\n >\n <slot name=\"iconAfter\" />\n </span>\n\n <!-- Static Value at the end -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtEnd\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--end\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n\n <!-- Dropdown at end -->\n <div\n v-if=\"shouldDisplayDropdownAtEnd\"\n :id=\"dropdownId\"\n class=\"b-input-field__dropdown b-input-field__dropdown--end\"\n >\n <bento-dropdown\n v-if=\"dropdown\"\n :id=\"dropdownId\"\n v-bind=\"dropdown\"\n :size=\"BentoDropdownSize.SMALL\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n </div>\n\n <error-message\n v-if=\"shouldShowError && !!errorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-input-field__error-message\"\n />\n\n <span v-if=\"hasSlot('description')\" :id=\"descriptionId\" class=\"b-input-field__description\" @click=\"focusInput\">\n <bento-typography el=\"span\" variant=\"body\">\n <slot id=\"description\" name=\"description\" />\n </bento-typography>\n </span>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, ref, toRef, toRefs, useAttrs, useSlots } from 'vue';\n import {\n BentoInputDropdownProps,\n BentoInputFieldElementPosition,\n BentoInputFieldStateClass,\n BentoInputFieldType,\n BentoInputFieldValue,\n BentoInputFieldVariant,\n } from './input-field.types';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage } from '@/components/internal/error-message';\n import { useFormLayoutFieldLoading, useHasSlot } from '@/composables';\n import { generateUid } from '@/utils/ts/unique-id';\n import { useI18n } from '@/utils/ts/i18n';\n import { BentoDropdownSize } from '../dropdown/dropdown.types';\n import { BentoDropdown } from '@/components/dropdown';\n import { BentoListboxSelectedValue } from '@/types';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { deprecate } from '@/utils/ts/deprecate';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n const slots = useSlots();\n\n const props = defineProps({\n /**\n * Indicates whether the element is exposed to an accessibility API.\n */\n ariaHidden: { type: Boolean, default: true },\n\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Text that labels an the input element\n */\n ariaLabel: { type: String, default: undefined },\n\n /**\n * Reduces height of the input\n */\n condensed: { type: Boolean, default: false },\n\n /**\n * Disables the possibility of changing value in the input-field\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Dropdown props for the small selectable dropdown menu.\n * @see BentoDropdown\n */\n dropdown: {\n type: Object as PropType<BentoInputDropdownProps>,\n default: undefined,\n },\n\n /**\n * Position of the dropdown before or after input value\n */\n dropdownPosition: {\n type: String as PropType<BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`>,\n default: BentoInputFieldElementPosition.START,\n validator: (value: BentoInputFieldElementPosition) =>\n Object.values(BentoInputFieldElementPosition).includes(value),\n },\n\n /**\n * Adds error validation class for outlining input-field.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n error: { type: Boolean, default: false },\n\n /**\n * Renders input-field with an error state and the error message beneath the input box\n */\n errorMessage: { type: String, default: null },\n\n /**\n * Highlights the dropdown is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Text displayed as the placeholder of the input-field\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Highlights the dropdown is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Setting this property to true will set the input field to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Static text that displayed before or after input value\n * Applicable to the Static Value variant\n */\n staticValue: { type: String, default: '' },\n\n /**\n * Position of Static Value before or after input value\n */\n staticValuePosition: {\n type: String as PropType<BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`>,\n default: BentoInputFieldElementPosition.START,\n validator: (value: BentoInputFieldElementPosition) =>\n Object.values(BentoInputFieldElementPosition).includes(value),\n },\n\n /**\n * A string specifying the type of control to render.\n */\n type: {\n type: String as PropType<BentoInputFieldType | `${BentoInputFieldType}`>,\n default: BentoInputFieldType.TEXT,\n validator: (value: BentoInputFieldType) => Object.values(BentoInputFieldType).includes(value),\n },\n\n /**\n * Text displayed as the value of the input-field\n */\n value: { type: [String, Number] as PropType<BentoInputFieldValue>, default: undefined },\n\n /**\n * Describes the different variants for the input element\n */\n variant: {\n type: String as PropType<BentoInputFieldVariant | `${BentoInputFieldVariant}`>,\n default: BentoInputFieldVariant.DEFAULT,\n validator: (value: BentoInputFieldVariant) => Object.values(BentoInputFieldVariant).includes(value),\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the Input Field's internal dropdown changes it's value. Contains every dropdown prop passed with the updated selected value as 'value'\n */\n (e: 'update:dropdown', updatedDropdownProps: BentoInputDropdownProps): void;\n\n /**\n * Emitted when the element has lost focus\n */\n (e: 'blur'): void;\n\n /**\n * Emitted when the user modifies the element's value. Unlike the 'input' event, the change event is not necessarily fired for each alteration to an element's value\n */\n (e: 'change'): void;\n\n /**\n * Emitted when the Input Field's internal dropdown changes it's value\n */\n (e: 'dropdown-input', selectedValue: BentoListboxSelectedValue): void;\n\n /**\n * Emitted when the \"ESC\" key is pressed\n */\n (e: 'escape-pressed'): void;\n\n /**\n * Emitted when the element has received focus\n */\n (e: 'focus'): void;\n\n /**\n * Emitted when a key is pressed\n */\n (e: 'keydown', event: KeyboardEvent): void;\n\n /**\n * Emitted when the component's model changes\n */\n (e: 'input', inputValue: string): void;\n }>();\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const hasSlot = useHasSlot(slots);\n const inputFieldElement = ref(null);\n const inputFieldId = generateUid('input');\n const dropdownId = generateUid('input-dropdown');\n const staticValueId = generateUid('input-static-value');\n const descriptionId = generateUid('input-description');\n const errorId = generateUid('input-error');\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const shouldShowStaticValue = computed(\n () => props.variant === BentoInputFieldVariant.STATIC_VALUE && !!slots.staticValue\n );\n\n const isDefaultVariant = computed(() => props.variant === BentoInputFieldVariant.DEFAULT);\n\n const isPaymentMethodVariant = computed(() => props.variant === BentoInputFieldVariant.PAYMENT_METHOD);\n\n const shouldDisplayStaticValueAtStart = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayStaticValueAtEnd = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowDropdown = computed(() => props.variant === BentoInputFieldVariant.DROPDOWN && !!props.dropdown);\n const shouldDisplayDropdownAtStart = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayDropdownAtEnd = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.error)\n );\n\n const computedAriaOwns = computed(() => {\n if (shouldShowDropdown.value === true && shouldShowStaticValue.value === true) {\n return `${staticValueId} ${dropdownId}`;\n }\n if (shouldShowDropdown.value === true) {\n return `${dropdownId}`;\n }\n if (shouldShowStaticValue.value === true) {\n return `${staticValueId}`;\n }\n return null;\n });\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: hasSlot('default') ? (getSlotText(slots)('default') as string) : t('ariaLabelFallback'),\n });\n\n const computedAriaDescribedBy = computed(\n () =>\n `${hasSlot('description') ? descriptionId : ''} ${\n shouldShowError.value && !!props.errorMessage ? errorId : ''\n }`\n );\n\n const inputFieldConditionalClasses = computed(() => ({\n [`b-input-field--${BentoInputFieldStateClass.CONDENSED}`]: props.condensed,\n [`b-input-field--${BentoInputFieldStateClass.DISABLED}`]: props.disabled,\n [`b-input-field--${BentoInputFieldStateClass.READONLY}`]: isReadOnly.value,\n [`b-input-field--${BentoInputFieldStateClass.ERROR}`]: shouldShowError.value,\n [`b-input-field--${BentoInputFieldStateClass.SMALL_PADDING_LEFT}`]: shouldDisplayDropdownAtStart.value,\n [`b-input-field--${BentoInputFieldStateClass.SMALL_PADDING_RIGHT}`]: shouldDisplayDropdownAtEnd.value,\n }));\n\n const onInput = (event: Event) => {\n if (!props.disabled && !isReadOnly.value) {\n emit('input', (event.target as HTMLInputElement).value);\n }\n };\n\n const onDropdownInput = (selectedValue: BentoListboxSelectedValue) => {\n emit('dropdown-input', selectedValue);\n emit('update:dropdown', { ...props?.dropdown, value: selectedValue });\n };\n\n const focusInput = () => {\n inputFieldElement.value.focus();\n };\n\n // Expose method so that other components can focus on it in Vue3\n defineExpose({\n focusInput,\n });\n\n if (props.error) {\n deprecate(\n 'BentoInputField \"error\" property',\n `Use the BentoInputField \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-dropdown errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Input field component is used to create interactive controls for web-based\n * forms in order to accept data from the user.\n *\n * @example\n * import { BentoInputField } from '@adyen/bento-vue2'\n *\n * const inputValue = ref('');\n *\n * export default {\n * components: { BentoInputField },\n * tempate: `\n * <bento-input-field\n * :value=\"inputValue\"\n * :input=\"newValue => inputValue.value = newValue\"\n * >\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-field.scss\" />\n"],"names":["BentoInputFieldVariant","BentoInputFieldVariant2","BentoInputFieldElementPosition","BentoInputFieldElementPosition2","BentoInputFieldStateClass","BentoInputFieldStateClass2","BentoInputFieldType","BentoInputFieldType2","BentoInputFieldEvent","BentoInputFieldEvent2","__default__","messages","attrs","useAttrs","slots","useSlots","t","useI18n","hasSlot","useHasSlot","inputFieldElement","ref","inputFieldId","generateUid","dropdownId","staticValueId","descriptionId","errorId","isReadOnly","useFormLayoutFieldLoading","toRef","props","shouldShowStaticValue","computed","isDefaultVariant","isPaymentMethodVariant","shouldDisplayStaticValueAtStart","shouldDisplayStaticValueAtEnd","shouldShowDropdown","shouldDisplayDropdownAtStart","shouldDisplayDropdownAtEnd","shouldShowError","computedAriaOwns","ariaLabelAttribute","ariaLabel","toRefs","computedAriaLabel","useAriaLabel","getSlotText","computedAriaDescribedBy","inputFieldConditionalClasses","onInput","event","emit","onDropdownInput","selectedValue","focusInput","expose","deprecate"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"input-field.js","sources":["../../vue2/src/components/input-field/input-field.types.ts","../../vue2/src/components/input-field/input-field.vue"],"sourcesContent":["import { BentoDropdown } from '@/components/dropdown/';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldVariant {\n DEFAULT = 'default',\n PAYMENT_METHOD = 'payment-method',\n STATIC_VALUE = 'static-value',\n DROPDOWN = 'dropdown',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldElementPosition {\n START = 'start',\n END = 'end',\n}\n\nexport enum BentoInputFieldStateClass {\n CONDENSED = 'condensed',\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n SMALL_PADDING_LEFT = 'small-padding-left',\n SMALL_PADDING_RIGHT = 'small-padding-right',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldType {\n SEARCH = 'search',\n TEXT = 'text',\n NUMBER = 'number',\n}\n\nexport type BentoInputFieldValue = string | number;\n\ntype DropdownProps = InstanceType<typeof BentoDropdown>['$props'];\nexport type BentoInputDropdownProps = {\n items: DropdownProps['items'];\n value: DropdownProps['value'];\n};\n\n/**\n * @deprecated The use of these enums is no longer supported.\n * Use `v-on:` or `@` to listen to the events being emitted.\n * This enum will be removed in 2.0.\n */\nexport enum BentoInputFieldEvent {\n INPUT = 'input',\n ESCAPE_PRESSED = 'escape-pressed',\n UPDATE_DROPDOWN = 'update:dropdown',\n DROPDOWN_INPUT = 'dropdown-input',\n FOCUS = 'focus',\n CHANGE = 'change',\n BLUR = 'blur',\n KEYDOWN = 'keydown',\n}\n","<template>\n <bento-typography\n class=\"b-input-field\"\n data-testid=\"input-text-container\"\n :class=\"inputFieldConditionalClasses\"\n el=\"div\"\n variant=\"body\"\n >\n <!-- Label -->\n <label\n v-if=\"hasSlot('default')\"\n :for=\"inputFieldId\"\n class=\"b-input-field__label\"\n data-testid=\"input-field-label\"\n @click=\"focusInput\"\n >\n <bento-typography el=\"span\" variant=\"body\" stronger>\n <slot></slot>\n </bento-typography>\n <bento-typography v-if=\"optional\" class=\"b-input-field__label-requirement\" el=\"span\">\n ({{ t('optional') }})\n </bento-typography>\n <bento-typography v-if=\"required\" class=\"b-input-field__label-requirement\" el=\"span\">\n ({{ t('required') }})\n </bento-typography>\n </label>\n\n <div class=\"b-input-field__input-box\" data-testid=\"input-box\" :aria-disabled=\"disabled\" @click=\"focusInput\">\n <!-- Optional Icon for Default text variant -->\n <span\n v-if=\"isDefaultVariant && hasSlot('defaultIconBefore')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__default-icon-before\"\n >\n <slot name=\"defaultIconBefore\" />\n </span>\n\n <!-- Mandatory Icon for Payment Method variant -->\n <span\n v-if=\"isPaymentMethodVariant && hasSlot('paymentMethod')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__payment-method\"\n >\n <slot name=\"paymentMethod\" />\n </span>\n\n <!-- Dropdown at start -->\n <div\n v-if=\"shouldDisplayDropdownAtStart\"\n :id=\"dropdownId\"\n class=\"b-input-field__dropdown b-input-field__dropdown--start\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n v-bind=\"dropdown\"\n :size=\"BentoDropdownSize.SMALL\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n\n <!-- Static Value at start -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtStart\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--start\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n\n <input\n :id=\"inputFieldId\"\n v-bind=\"attrs\"\n ref=\"inputFieldElement\"\n class=\"b-input-field__input\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"computedAriaDescribedBy\"\n :aria-owns=\"computedAriaOwns\"\n :aria-invalid=\"shouldShowError\"\n :placeholder=\"placeholder\"\n :type=\"type\"\n :value=\"value\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onInput\"\n @change=\"emit('change')\"\n @focus=\"emit('focus')\"\n @blur=\"emit('blur')\"\n @keydown=\"emit('keydown', $event)\"\n @keydown.esc=\"emit('escape-pressed')\"\n />\n <span\n v-if=\"hasSlot('iconAfter')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-after\"\n data-testid=\"input-text__icon-after\"\n >\n <slot name=\"iconAfter\" />\n </span>\n\n <!-- Static Value at the end -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtEnd\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--end\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n\n <!-- Dropdown at end -->\n <div\n v-if=\"shouldDisplayDropdownAtEnd\"\n :id=\"dropdownId\"\n class=\"b-input-field__dropdown b-input-field__dropdown--end\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n :id=\"dropdownId\"\n v-bind=\"dropdown\"\n :size=\"BentoDropdownSize.SMALL\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n </div>\n\n <error-message\n v-if=\"shouldShowError && !!errorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-input-field__error-message\"\n />\n\n <span v-if=\"hasSlot('description')\" :id=\"descriptionId\" class=\"b-input-field__description\" @click=\"focusInput\">\n <bento-typography el=\"span\" variant=\"body\">\n <slot id=\"description\" name=\"description\" />\n </bento-typography>\n </span>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, ref, toRef, toRefs, useAttrs, useSlots } from 'vue';\n import {\n BentoInputDropdownProps,\n BentoInputFieldElementPosition,\n BentoInputFieldStateClass,\n BentoInputFieldType,\n BentoInputFieldValue,\n BentoInputFieldVariant,\n } from './input-field.types';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage } from '@/components/internal/error-message';\n import { useFormLayoutFieldLoading, useHasSlot } from '@/composables';\n import { generateUid } from '@/utils/ts/unique-id';\n import { useI18n } from '@/utils/ts/i18n';\n import { BentoDropdownSize } from '../dropdown/dropdown.types';\n import { BentoDropdown } from '@/components/dropdown';\n import { BentoListboxSelectedValue } from '@/types';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { deprecate } from '@/utils/ts/deprecate';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n const slots = useSlots();\n\n const props = defineProps({\n /**\n * Indicates whether the element is exposed to an accessibility API.\n */\n ariaHidden: { type: Boolean, default: true },\n\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Text that labels an the input element\n */\n ariaLabel: { type: String, default: undefined },\n\n /**\n * Reduces height of the input\n */\n condensed: { type: Boolean, default: false },\n\n /**\n * Disables the possibility of changing value in the input-field\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Dropdown props for the small selectable dropdown menu.\n * @see BentoDropdown\n */\n dropdown: {\n type: Object as PropType<BentoInputDropdownProps>,\n default: undefined,\n },\n\n /**\n * Position of the dropdown before or after input value\n */\n dropdownPosition: {\n type: String as PropType<BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`>,\n default: BentoInputFieldElementPosition.START,\n validator: (value: BentoInputFieldElementPosition) =>\n Object.values(BentoInputFieldElementPosition).includes(value),\n },\n\n /**\n * Adds error validation class for outlining input-field.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n error: { type: Boolean, default: false },\n\n /**\n * Renders input-field with an error state and the error message beneath the input box\n */\n errorMessage: { type: String, default: null },\n\n /**\n * Highlights the dropdown is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Text displayed as the placeholder of the input-field\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Highlights the dropdown is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Setting this property to true will set the input field to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Static text that displayed before or after input value\n * Applicable to the Static Value variant\n */\n staticValue: { type: String, default: '' },\n\n /**\n * Position of Static Value before or after input value\n */\n staticValuePosition: {\n type: String as PropType<BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`>,\n default: BentoInputFieldElementPosition.START,\n validator: (value: BentoInputFieldElementPosition) =>\n Object.values(BentoInputFieldElementPosition).includes(value),\n },\n\n /**\n * A string specifying the type of control to render.\n */\n type: {\n type: String as PropType<BentoInputFieldType | `${BentoInputFieldType}`>,\n default: BentoInputFieldType.TEXT,\n validator: (value: BentoInputFieldType) => Object.values(BentoInputFieldType).includes(value),\n },\n\n /**\n * Text displayed as the value of the input-field\n */\n value: { type: [String, Number] as PropType<BentoInputFieldValue>, default: undefined },\n\n /**\n * Describes the different variants for the input element\n */\n variant: {\n type: String as PropType<BentoInputFieldVariant | `${BentoInputFieldVariant}`>,\n default: BentoInputFieldVariant.DEFAULT,\n validator: (value: BentoInputFieldVariant) => Object.values(BentoInputFieldVariant).includes(value),\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the Input Field's internal dropdown changes it's value. Contains every dropdown prop passed with the updated selected value as 'value'\n */\n (e: 'update:dropdown', updatedDropdownProps: BentoInputDropdownProps): void;\n\n /**\n * Emitted when the element has lost focus\n */\n (e: 'blur'): void;\n\n /**\n * Emitted when the user modifies the element's value. Unlike the 'input' event, the change event is not necessarily fired for each alteration to an element's value\n */\n (e: 'change'): void;\n\n /**\n * Emitted when the Input Field's internal dropdown changes it's value\n */\n (e: 'dropdown-input', selectedValue: BentoListboxSelectedValue): void;\n\n /**\n * Emitted when the \"ESC\" key is pressed\n */\n (e: 'escape-pressed'): void;\n\n /**\n * Emitted when the element has received focus\n */\n (e: 'focus'): void;\n\n /**\n * Emitted when a key is pressed\n */\n (e: 'keydown', event: KeyboardEvent): void;\n\n /**\n * Emitted when the component's model changes\n */\n (e: 'input', inputValue: string): void;\n }>();\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const hasSlot = useHasSlot(slots);\n const inputFieldElement = ref(null);\n const inputFieldId = generateUid('input');\n const dropdownId = generateUid('input-dropdown');\n const staticValueId = generateUid('input-static-value');\n const descriptionId = generateUid('input-description');\n const errorId = generateUid('input-error');\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const shouldShowStaticValue = computed(\n () => props.variant === BentoInputFieldVariant.STATIC_VALUE && !!slots.staticValue\n );\n\n const isDefaultVariant = computed(() => props.variant === BentoInputFieldVariant.DEFAULT);\n\n const isPaymentMethodVariant = computed(() => props.variant === BentoInputFieldVariant.PAYMENT_METHOD);\n\n const shouldDisplayStaticValueAtStart = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayStaticValueAtEnd = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowDropdown = computed(() => props.variant === BentoInputFieldVariant.DROPDOWN && !!props.dropdown);\n const shouldDisplayDropdownAtStart = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayDropdownAtEnd = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.error)\n );\n\n const computedAriaOwns = computed(() => {\n if (shouldShowDropdown.value === true && shouldShowStaticValue.value === true) {\n return `${staticValueId} ${dropdownId}`;\n }\n if (shouldShowDropdown.value === true) {\n return `${dropdownId}`;\n }\n if (shouldShowStaticValue.value === true) {\n return `${staticValueId}`;\n }\n return null;\n });\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: hasSlot('default') ? (getSlotText(slots)('default') as string) : t('ariaLabelFallback'),\n });\n\n const computedAriaDescribedBy = computed(\n () =>\n `${hasSlot('description') ? descriptionId : ''} ${\n shouldShowError.value && !!props.errorMessage ? errorId : ''\n }`\n );\n\n const inputFieldConditionalClasses = computed(() => ({\n [`b-input-field--${BentoInputFieldStateClass.CONDENSED}`]: props.condensed,\n [`b-input-field--${BentoInputFieldStateClass.DISABLED}`]: props.disabled,\n [`b-input-field--${BentoInputFieldStateClass.READONLY}`]: isReadOnly.value,\n [`b-input-field--${BentoInputFieldStateClass.ERROR}`]: shouldShowError.value,\n [`b-input-field--${BentoInputFieldStateClass.SMALL_PADDING_LEFT}`]: shouldDisplayDropdownAtStart.value,\n [`b-input-field--${BentoInputFieldStateClass.SMALL_PADDING_RIGHT}`]: shouldDisplayDropdownAtEnd.value,\n }));\n\n const onInput = (event: Event) => {\n if (!props.disabled && !isReadOnly.value) {\n emit('input', (event.target as HTMLInputElement).value);\n }\n };\n\n const onDropdownInput = (selectedValue: BentoListboxSelectedValue) => {\n emit('dropdown-input', selectedValue);\n emit('update:dropdown', { ...props?.dropdown, value: selectedValue });\n };\n\n const focusInput = () => {\n inputFieldElement.value.focus();\n };\n\n // Expose method so that other components can focus on it in Vue3\n defineExpose({\n focusInput,\n });\n\n if (props.error) {\n deprecate(\n 'BentoInputField \"error\" property',\n `Use the BentoInputField \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-dropdown errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Input field component is used to create interactive controls for web-based\n * forms in order to accept data from the user.\n *\n * @example\n * import { BentoInputField } from '@adyen/bento-vue2'\n *\n * const inputValue = ref('');\n *\n * export default {\n * components: { BentoInputField },\n * tempate: `\n * <bento-input-field\n * :value=\"inputValue\"\n * :input=\"newValue => inputValue.value = newValue\"\n * >\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-field.scss\" />\n"],"names":["BentoInputFieldVariant","BentoInputFieldVariant2","BentoInputFieldElementPosition","BentoInputFieldElementPosition2","BentoInputFieldStateClass","BentoInputFieldStateClass2","BentoInputFieldType","BentoInputFieldType2","BentoInputFieldEvent","BentoInputFieldEvent2","__default__","messages","attrs","useAttrs","slots","useSlots","t","useI18n","hasSlot","useHasSlot","inputFieldElement","ref","inputFieldId","generateUid","dropdownId","staticValueId","descriptionId","errorId","isReadOnly","useFormLayoutFieldLoading","toRef","props","shouldShowStaticValue","computed","isDefaultVariant","isPaymentMethodVariant","shouldDisplayStaticValueAtStart","shouldDisplayStaticValueAtEnd","shouldShowDropdown","shouldDisplayDropdownAtStart","shouldDisplayDropdownAtEnd","shouldShowError","computedAriaOwns","ariaLabelAttribute","ariaLabel","toRefs","computedAriaLabel","useAriaLabel","getSlotText","computedAriaDescribedBy","inputFieldConditionalClasses","onInput","event","emit","onDropdownInput","selectedValue","focusInput","expose","deprecate"],"mappings":"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"}
|