@adyen/bento-vue2 1.18.0 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/components.d.ts +4 -0
- package/dist/@types/packages/vue2/src/components/button/components/toggle-button/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/button/components/toggle-button/toggle-button.vue.d.ts +65 -0
- package/dist/@types/packages/vue2/src/components/button/components/toggle-button/toggle.types.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/button/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/checkbox/checkbox.types.d.ts +3 -8
- package/dist/@types/packages/vue2/src/components/checkbox/checkbox.vue.d.ts +3 -6
- package/dist/@types/packages/vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-cell/data-grid-cell.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/date-range-picker/components/date-range-picker-calendar/date-range-picker-calendar.vue.d.ts +7 -5
- package/dist/@types/packages/vue2/src/components/{internal/calendar → date-range-picker}/composables/use-granularity-memory.types.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.types.d.ts +5 -5
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue.d.ts +5 -5
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-default-textbox/dropdown-default-textbox.vue.d.ts +18 -19
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-small-textbox/dropdown-small-textbox.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/internal/calendar/calendar.types.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/internal/calendar/composables/use-granularity-adjustments.types.d.ts +7 -7
- package/dist/@types/packages/vue2/src/components/internal/checkbox-input/checkbox-input.types.d.ts +20 -0
- package/dist/@types/packages/vue2/src/components/internal/checkbox-input/checkbox-input.vue.d.ts +90 -0
- package/dist/@types/packages/vue2/src/components/internal/checkbox-input/index.d.ts +3 -0
- package/dist/@types/packages/vue2/src/components/internal/dialog-page/dialog-page.keys.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/internal/dialog-page/dialog-page.types.d.ts +16 -0
- package/dist/@types/packages/vue2/src/components/internal/dialog-page/dialog-page.vue.d.ts +54 -0
- package/dist/@types/packages/vue2/src/components/internal/dialog-page/index.d.ts +3 -0
- package/dist/@types/packages/vue2/src/components/internal/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/internal/listbox/composables/use-cached-selected-values/use-cached-selected-values.d.ts +14 -0
- package/dist/@types/packages/vue2/src/components/internal/listbox/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/internal/radio-input/index.d.ts +3 -0
- package/dist/@types/packages/vue2/src/components/internal/radio-input/radio-input.types.d.ts +6 -0
- package/dist/@types/packages/vue2/src/components/internal/radio-input/radio-input.vue.d.ts +80 -0
- package/dist/@types/packages/vue2/src/components/modal-fullscreen/components/modal-fullscreen-page.vue.d.ts +60 -0
- package/dist/@types/packages/vue2/src/components/modal-fullscreen/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/modal-fullscreen/modal-fullscreen.vue.d.ts +12 -1
- package/dist/@types/packages/vue2/src/components/radio-group/components/radio-button/radio-button.types.d.ts +3 -6
- package/dist/@types/packages/vue2/src/components/radio-group/components/radio-button/radio-button.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/radio-group/radio-group.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/sidepanel/components/sidepanel-page.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/sidepanel/sidepanel.keys.d.ts +0 -2
- package/dist/@types/packages/vue2/src/components/sidepanel/sidepanel.types.d.ts +0 -19
- package/dist/@types/packages/vue2/src/components/sidepanel/sidepanel.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/composables/use-form-validate/use-form.d.ts +1 -1
- package/dist/accordion.js +2 -2
- package/dist/action-bar.js +6 -6
- package/dist/alert.js +3 -3
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -0
- package/dist/assets/button.css +1 -1
- package/dist/assets/calendar.css +1 -1
- package/dist/assets/checkbox.css +1 -1
- package/dist/assets/dialog-page.css +1 -0
- package/dist/assets/dropdown-default-textbox.css +1 -1
- package/dist/assets/dropdown.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/index20.css +1 -1
- package/dist/assets/index21.css +1 -1
- package/dist/assets/index22.css +1 -1
- package/dist/assets/index23.css +1 -1
- package/dist/assets/index24.css +1 -1
- package/dist/assets/index25.css +1 -1
- package/dist/assets/index26.css +1 -1
- package/dist/assets/index27.css +1 -1
- package/dist/assets/index28.css +1 -1
- package/dist/assets/index29.css +1 -1
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index30.css +1 -1
- package/dist/assets/index31.css +1 -1
- package/dist/assets/index32.css +1 -1
- package/dist/assets/index33.css +1 -1
- package/dist/assets/index34.css +1 -1
- package/dist/assets/index35.css +1 -1
- package/dist/assets/index36.css +1 -1
- package/dist/assets/index37.css +1 -1
- package/dist/assets/index38.css +1 -1
- package/dist/assets/index39.css +1 -1
- package/dist/assets/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 -1
- package/dist/assets/index46.css +1 -1
- package/dist/assets/index47.css +1 -1
- package/dist/assets/index48.css +1 -1
- package/dist/assets/index5.css +1 -1
- package/dist/assets/index6.css +1 -1
- package/dist/assets/index7.css +1 -1
- package/dist/assets/index8.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/assets/teleport.css +1 -1
- package/dist/avatar-image.js +1 -1
- package/dist/button.js +71 -93
- package/dist/button.js.map +1 -1
- package/dist/card.js +3 -3
- package/dist/checkbox.js +6 -6
- package/dist/chunks/{base-button.bf0c938c.js → base-button.3c3d473d.js} +2 -2
- package/dist/chunks/{base-button.bf0c938c.js.map → base-button.3c3d473d.js.map} +1 -1
- package/dist/chunks/{base-modal.1dc6cf96.js → base-modal.27c6f2db.js} +5 -5
- package/dist/chunks/{base-modal.1dc6cf96.js.map → base-modal.27c6f2db.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.4ecf3d93.js → button-actions-with-menu.a38327c2.js} +4 -4
- package/dist/chunks/{button-actions-with-menu.4ecf3d93.js.map → button-actions-with-menu.a38327c2.js.map} +1 -1
- package/dist/chunks/button-actions.1dc90a19.js +111 -0
- package/dist/chunks/button-actions.1dc90a19.js.map +1 -0
- package/dist/chunks/{button.f5739261.js → button.0b6cda85.js} +3 -3
- package/dist/chunks/{button.f5739261.js.map → button.0b6cda85.js.map} +1 -1
- package/dist/chunks/calendar.263cfc88.js +913 -0
- package/dist/chunks/calendar.263cfc88.js.map +1 -0
- package/dist/chunks/checkbox.c7a74005.js +275 -0
- package/dist/chunks/checkbox.c7a74005.js.map +1 -0
- package/dist/chunks/{controls-group.2b645d54.js → controls-group.8abe0bd1.js} +3 -3
- package/dist/chunks/{controls-group.2b645d54.js.map → controls-group.8abe0bd1.js.map} +1 -1
- package/dist/chunks/{copy.e01532cf.js → copy.647aae54.js} +4 -4
- package/dist/chunks/{copy.e01532cf.js.map → copy.647aae54.js.map} +1 -1
- package/dist/chunks/dialog-page.f787969c.js +113 -0
- package/dist/chunks/dialog-page.f787969c.js.map +1 -0
- package/dist/chunks/{dropdown-default-textbox.d45138fa.js → dropdown-default-textbox.59803edd.js} +97 -111
- package/dist/chunks/dropdown-default-textbox.59803edd.js.map +1 -0
- package/dist/chunks/{dropdown.0a9acf8b.js → dropdown.0574f613.js} +62 -61
- package/dist/chunks/dropdown.0574f613.js.map +1 -0
- package/dist/chunks/{error-message.317dd85f.js → error-message.75666843.js} +2 -2
- package/dist/chunks/{error-message.317dd85f.js.map → error-message.75666843.js.map} +1 -1
- package/dist/chunks/{fixed-scroller.afe02620.js → fixed-scroller.06574a66.js} +2 -2
- package/dist/chunks/{fixed-scroller.afe02620.js.map → fixed-scroller.06574a66.js.map} +1 -1
- package/dist/chunks/{footer-actions.e0b866b1.js → footer-actions.0268a57b.js} +4 -4
- package/dist/chunks/{footer-actions.e0b866b1.js.map → footer-actions.0268a57b.js.map} +1 -1
- package/dist/chunks/{index.7aa428c2.js → index.026ae47b.js} +2 -2
- package/dist/chunks/{index.7aa428c2.js.map → index.026ae47b.js.map} +1 -1
- package/dist/chunks/{index.898a95bc.js → index.0bb773a7.js} +6 -6
- package/dist/chunks/{index.898a95bc.js.map → index.0bb773a7.js.map} +1 -1
- package/dist/chunks/{index.651dac2d.js → index.10b9618d.js} +3 -3
- package/dist/chunks/{index.651dac2d.js.map → index.10b9618d.js.map} +1 -1
- package/dist/chunks/{index.6c299479.js → index.302e9cf2.js} +2 -2
- package/dist/chunks/{index.6c299479.js.map → index.302e9cf2.js.map} +1 -1
- package/dist/chunks/index.408e1419.js +712 -0
- package/dist/chunks/index.408e1419.js.map +1 -0
- package/dist/chunks/{index.88ac1dab.js → index.45cd2344.js} +31 -31
- package/dist/chunks/index.45cd2344.js.map +1 -0
- package/dist/chunks/{index.6c017121.js → index.5b47c56b.js} +7 -7
- package/dist/chunks/{index.6c017121.js.map → index.5b47c56b.js.map} +1 -1
- package/dist/chunks/{index.2e70720a.js → index.5bfc67d1.js} +2 -2
- package/dist/chunks/{index.2e70720a.js.map → index.5bfc67d1.js.map} +1 -1
- package/dist/chunks/{index.e6aa2c36.js → index.932c230b.js} +6 -6
- package/dist/chunks/{index.e6aa2c36.js.map → index.932c230b.js.map} +1 -1
- package/dist/chunks/{index.81443e01.js → index.a52b98d1.js} +8 -8
- package/dist/chunks/{index.81443e01.js.map → index.a52b98d1.js.map} +1 -1
- package/dist/chunks/{index.290bbc9e.js → index.dc985e76.js} +3 -3
- package/dist/chunks/{index.290bbc9e.js.map → index.dc985e76.js.map} +1 -1
- package/dist/chunks/{index.546b27ae.js → index.de687404.js} +3 -2
- package/dist/chunks/{index.546b27ae.js.map → index.de687404.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.720eabb5.js → listbox-option-tag.89846151.js} +3 -3
- package/dist/chunks/{listbox-option-tag.720eabb5.js.map → listbox-option-tag.89846151.js.map} +1 -1
- package/dist/chunks/{listbox.dc3d986e.js → listbox.a8180c4a.js} +5 -5
- package/dist/chunks/{listbox.dc3d986e.js.map → listbox.a8180c4a.js.map} +1 -1
- package/dist/chunks/{loading-button.390228ff.js → loading-button.50dddf2f.js} +2 -2
- package/dist/chunks/{loading-button.390228ff.js.map → loading-button.50dddf2f.js.map} +1 -1
- package/dist/chunks/modal-fullscreen.keys.b9f31632.js +5 -0
- package/dist/chunks/modal-fullscreen.keys.b9f31632.js.map +1 -0
- package/dist/chunks/sidepanel.keys.1ed8a57c.js +5 -0
- package/dist/chunks/sidepanel.keys.1ed8a57c.js.map +1 -0
- package/dist/chunks/{teleport.d52e5254.js → teleport.84b0f20b.js} +14 -13
- package/dist/chunks/teleport.84b0f20b.js.map +1 -0
- package/dist/chunks/{tooltip.d452f6c4.js → tooltip.6748027a.js} +3 -3
- package/dist/chunks/{tooltip.d452f6c4.js.map → tooltip.6748027a.js.map} +1 -1
- 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 +1 -1
- package/dist/date-picker.js +18 -18
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +1 -1
- package/dist/divider.js +1 -1
- package/dist/dropdown.js +6 -6
- package/dist/empty-state.js +3 -3
- package/dist/filter-bar.js +19 -19
- package/dist/filter-bar.js.map +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +2 -2
- package/dist/header.js +4 -4
- package/dist/index.js +299 -2935
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +3 -3
- package/dist/input-field.js +4 -4
- package/dist/internal.js +78 -25
- package/dist/internal.js.map +1 -1
- package/dist/link.js +1 -1
- package/dist/loading-indicator.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +144 -44
- package/dist/modal-fullscreen.js.map +1 -1
- package/dist/modal.js +6 -6
- package/dist/pagination.js +4 -4
- package/dist/payment-method.js +2 -2
- package/dist/popover.js +1 -1
- package/dist/popper-container.js +1 -1
- package/dist/radio-group.js +147 -78
- package/dist/radio-group.js.map +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +2 -2
- package/dist/segmented-control.js +3 -3
- package/dist/sidepanel.js +78 -111
- 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 +3 -3
- package/dist/tabs.js +3 -3
- package/dist/tag.js +3 -3
- package/dist/textarea.js +4 -4
- package/dist/timeline.js +12 -12
- package/dist/toast.js +3 -3
- package/dist/toggle.js +2 -2
- package/dist/tutorial.js +6 -6
- package/dist/typography.js +1 -1
- package/dist/web-types.json +431 -5
- package/package.json +3 -3
- package/dist/chunks/calendar.7a2d1894.js +0 -960
- package/dist/chunks/calendar.7a2d1894.js.map +0 -1
- package/dist/chunks/checkbox.1345941b.js +0 -195
- package/dist/chunks/checkbox.1345941b.js.map +0 -1
- package/dist/chunks/dropdown-default-textbox.d45138fa.js.map +0 -1
- package/dist/chunks/dropdown.0a9acf8b.js.map +0 -1
- package/dist/chunks/index.84c2cef6.js +0 -637
- package/dist/chunks/index.84c2cef6.js.map +0 -1
- package/dist/chunks/index.88ac1dab.js.map +0 -1
- package/dist/chunks/sidepanel.keys.3f8d69c1.js +0 -7
- package/dist/chunks/sidepanel.keys.3f8d69c1.js.map +0 -1
- package/dist/chunks/teleport.d52e5254.js.map +0 -1
- /package/dist/@types/packages/vue2/src/components/{internal/calendar → date-range-picker}/composables/use-granularity-memory.d.ts +0 -0
package/dist/chunks/{dropdown-default-textbox.d45138fa.js → dropdown-default-textbox.59803edd.js}
RENAMED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { g as
|
|
1
|
+
import { defineComponent as y, useAttrs as D, useSlots as v, ref as k, computed as i, watch as O, nextTick as N } from "vue";
|
|
2
|
+
import { g as B } from "./unique-id.a2a2b458.js";
|
|
3
3
|
import { u as A } from "./use-has-slot.fbeb19ec.js";
|
|
4
|
-
import { B as
|
|
5
|
-
import { d as
|
|
6
|
-
import { C as
|
|
7
|
-
import { n as
|
|
8
|
-
import { s as
|
|
9
|
-
import { C as
|
|
4
|
+
import { B as L } from "./index.de687404.js";
|
|
5
|
+
import { d as P } from "./debounce.b5ef6acf.js";
|
|
6
|
+
import { C as V } from "./cross-circle-fill.27580c4b.js";
|
|
7
|
+
import { n as g } from "./_plugin-vue2_normalizer.71e2aa87.js";
|
|
8
|
+
import { s as m } from "./events.58c00e6d.js";
|
|
9
|
+
import { C as F, a as R } from "./chevron-up.81185563.js";
|
|
10
10
|
import "../assets/dropdown-default-textbox.css";
|
|
11
|
-
var
|
|
12
|
-
const T =
|
|
11
|
+
var u = /* @__PURE__ */ ((n) => (n.DISABLED = "disabled", n.READONLY = "readonly", n.HAS_ITEMS = "has-items", n.OPENED = "opened", n.ERROR = "error", n))(u || {}), s = /* @__PURE__ */ ((n) => (n.OPEN = "dropdown-base-open", n.KEYDOWN = "dropdown-base-keydown", n.CLOSE = "dropdown-base-close", n.INPUT = "dropdown-base-input", n.CLEAR = "dropdown-base-clear", n))(s || {});
|
|
12
|
+
const T = y({
|
|
13
13
|
name: "dropdown-base-textbox",
|
|
14
14
|
inheritAttrs: !1
|
|
15
|
-
}), U = /* @__PURE__ */
|
|
15
|
+
}), U = /* @__PURE__ */ y({
|
|
16
16
|
...T,
|
|
17
17
|
props: {
|
|
18
18
|
/**
|
|
@@ -94,20 +94,20 @@ const T = m({
|
|
|
94
94
|
*/
|
|
95
95
|
showSlotContentInMultiple: { type: Boolean, default: !1 }
|
|
96
96
|
},
|
|
97
|
-
setup(
|
|
98
|
-
const t =
|
|
99
|
-
[`b-dropdown-base-textbox--${
|
|
100
|
-
[`b-dropdown-base-textbox--${
|
|
101
|
-
[`b-dropdown-base-textbox--${
|
|
102
|
-
})), f =
|
|
97
|
+
setup(n, { emit: e }) {
|
|
98
|
+
const t = n, o = D(), a = v(), p = A(a), r = k(null), c = B("textbox"), b = i(() => ({
|
|
99
|
+
[`b-dropdown-base-textbox--${u.DISABLED}`]: t.disabled,
|
|
100
|
+
[`b-dropdown-base-textbox--${u.READONLY}`]: t.readonly,
|
|
101
|
+
[`b-dropdown-base-textbox--${u.HAS_ITEMS}`]: !!t.additionalItemsSelected
|
|
102
|
+
})), f = i(() => ({
|
|
103
103
|
["b-dropdown-base-textbox__input--dynamic-filtering"]: t.dynamicFiltering
|
|
104
|
-
})),
|
|
104
|
+
})), _ = i(() => t.dynamicFiltering && !!t.value && t.open), x = i(
|
|
105
105
|
() => {
|
|
106
|
-
var
|
|
106
|
+
var d;
|
|
107
107
|
return {
|
|
108
108
|
"aria-haspopup": "listbox",
|
|
109
109
|
"aria-controls": t.ariaControls,
|
|
110
|
-
"aria-describedby": (
|
|
110
|
+
"aria-describedby": (d = o["aria-describedby"]) == null ? void 0 : d.toString(),
|
|
111
111
|
"aria-expanded": t.ariaExpanded ? "true" : "false",
|
|
112
112
|
"aria-labelledby": t.ariaLabelledby,
|
|
113
113
|
"aria-label": t.ariaLabelledby ? null : t.ariaLabel,
|
|
@@ -115,71 +115,65 @@ const T = m({
|
|
|
115
115
|
"aria-disabled": t.disabled ? !0 : null
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
|
-
),
|
|
119
|
-
|
|
120
|
-
() =>
|
|
118
|
+
), l = i(() => t.dynamicFiltering && (t.open || t.alwaysComboboxIsInput));
|
|
119
|
+
O(
|
|
120
|
+
() => l.value,
|
|
121
121
|
() => {
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
l.value && !t.alwaysComboboxIsInput && N(() => {
|
|
123
|
+
r.value.focus();
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
126
|
);
|
|
127
|
-
const
|
|
128
|
-
!t.disabled && !t.readonly && (
|
|
129
|
-
},
|
|
130
|
-
t.open && (
|
|
131
|
-
},
|
|
132
|
-
e(
|
|
133
|
-
},
|
|
134
|
-
!t.readonly && !t.disabled ? e(
|
|
135
|
-
}, t.debounceTime), E =
|
|
127
|
+
const w = () => {
|
|
128
|
+
!t.disabled && !t.readonly && (r.value.focus(), e(s.OPEN));
|
|
129
|
+
}, C = () => {
|
|
130
|
+
t.open && (r.value.focus(), e(s.CLOSE));
|
|
131
|
+
}, I = (d) => t.open && d.target.tagName === "INPUT" ? null : t.open ? C() : w(), S = () => {
|
|
132
|
+
e(s.CLEAR), e(s.INPUT, ""), r.value.focus();
|
|
133
|
+
}, h = P((d) => {
|
|
134
|
+
!t.readonly && !t.disabled ? e(s.INPUT, d.target.value) : (d.preventDefault(), d.stopPropagation());
|
|
135
|
+
}, t.debounceTime), E = i(
|
|
136
136
|
() => t.multiple ? t.selectedValueItem : []
|
|
137
137
|
);
|
|
138
|
-
return { __sfc: !0, attrs:
|
|
138
|
+
return { __sfc: !0, attrs: o, slots: a, hasSlot: p, props: t, emit: e, textbox: r, textboxId: c, conditionalClasses: b, comboboxConditionalClasses: f, isFiltering: _, ariaAttributes: x, shouldShowInput: l, onOpenDropdown: w, onCloseDropdown: C, onToggleDropdown: I, onClearSearch: S, onInputEvent: h, selectedValueItems: E, BentoTypography: L, DropdownBaseTextboxEvent: s, CrossCircleFillIcon: V };
|
|
139
139
|
}
|
|
140
140
|
});
|
|
141
|
-
var
|
|
142
|
-
var e = this, t = e._self._c,
|
|
143
|
-
return t("div", { class: e.$attrs.class, attrs: { "data-testid": "textbox-wrapper" }, on: { click:
|
|
144
|
-
return !a.type.indexOf("key") && e._k(a.keyCode, "escape", void 0, a.key, void 0) ? null :
|
|
145
|
-
} } }, [t(
|
|
146
|
-
return e.$emit(
|
|
141
|
+
var $ = function() {
|
|
142
|
+
var e = this, t = e._self._c, o = e._self._setupProxy;
|
|
143
|
+
return t("div", { class: e.$attrs.class, attrs: { "data-testid": "textbox-wrapper" }, on: { click: o.onToggleDropdown, keydown: function(a) {
|
|
144
|
+
return !a.type.indexOf("key") && e._k(a.keyCode, "escape", void 0, a.key, void 0) ? null : o.onCloseDropdown.apply(null, arguments);
|
|
145
|
+
} } }, [t(o.BentoTypography, { staticClass: "b-dropdown-base-textbox", class: o.conditionalClasses, attrs: { el: "div", "data-testid": "base-textbox" } }, [o.shouldShowInput ? t("input", e._b({ ref: "textbox", staticClass: "b-dropdown-base-textbox__input", attrs: { id: o.textboxId, role: "combobox", type: "text", "aria-autocomplete": "list", disabled: e.disabled ? !0 : null, readonly: e.readonly }, domProps: { value: e.open ? e.value : e.displayValue }, on: { keydown: [function(a) {
|
|
146
|
+
return e.$emit(o.DropdownBaseTextboxEvent.KEYDOWN, a);
|
|
147
147
|
}, function(a) {
|
|
148
|
-
return !a.type.indexOf("key") && e._k(a.keyCode, "enter", 13, a.key, "Enter") ? null :
|
|
149
|
-
}], input:
|
|
148
|
+
return !a.type.indexOf("key") && e._k(a.keyCode, "enter", 13, a.key, "Enter") ? null : o.onToggleDropdown.apply(null, arguments);
|
|
149
|
+
}], input: o.onInputEvent } }, "input", o.ariaAttributes, !1)) : t("div", e._b({ ref: "textbox", staticClass: "b-dropdown-base-textbox__input", class: o.comboboxConditionalClasses, attrs: { id: o.textboxId, role: "combobox", tabindex: 0 } }, "div", o.ariaAttributes, !1), [e.selectedValueItem && !e.multiple ? e._t("default", function() {
|
|
150
150
|
return [e._v(" " + e._s(e.displayValue) + " ")];
|
|
151
|
-
}, null, e.selectedValueItem) : e.selectedValueItem && e.showSlotContentInMultiple ? [t("div", { staticClass: "b-dropdown-base-textbox__input-multiple-selected" }, e._l(
|
|
151
|
+
}, null, e.selectedValueItem) : e.selectedValueItem && e.showSlotContentInMultiple ? [t("div", { staticClass: "b-dropdown-base-textbox__input-multiple-selected" }, e._l(o.selectedValueItems, function(a) {
|
|
152
152
|
return t("div", { key: a.value }, [t("div", { staticClass: "b-dropdown-base-textbox__input-selected-element" }, [e._t("default", function() {
|
|
153
153
|
return [e._v(" " + e._s(e.displayValue) + " ")];
|
|
154
154
|
}, null, a)], 2)]);
|
|
155
|
-
}), 0)] : [e._v(e._s(e.displayValue))]], 2), e.additionalItemsSelected ? t("span", { staticClass: "b-dropdown-base-textbox__additional-items" }, [e._v(" " + e._s(e.additionalItemsSelected) + " ")]) : e._e(),
|
|
156
|
-
return a.stopPropagation(),
|
|
155
|
+
}), 0)] : [e._v(e._s(e.displayValue))]], 2), e.additionalItemsSelected ? t("span", { staticClass: "b-dropdown-base-textbox__additional-items" }, [e._v(" " + e._s(e.additionalItemsSelected) + " ")]) : e._e(), o.hasSlot("icon") && !o.isFiltering ? t("span", { staticClass: "b-dropdown-base-textbox__icon", attrs: { "aria-hidden": "true" } }, [e._t("icon")], 2) : e._e(), o.isFiltering ? t("span", { staticClass: "b-dropdown-base-textbox__clear-search", attrs: { tabindex: "0", "data-testid": "clear-search-button" }, on: { click: function(a) {
|
|
156
|
+
return a.stopPropagation(), o.onClearSearch.apply(null, arguments);
|
|
157
157
|
}, keydown: function(a) {
|
|
158
|
-
return !a.type.indexOf("key") && e._k(a.keyCode, "enter", 13, a.key, "Enter") ? null : (a.stopPropagation(),
|
|
158
|
+
return !a.type.indexOf("key") && e._k(a.keyCode, "enter", 13, a.key, "Enter") ? null : (a.stopPropagation(), o.onClearSearch.apply(null, arguments));
|
|
159
159
|
}, keyup: function(a) {
|
|
160
|
-
return !a.type.indexOf("key") && e._k(a.keyCode, "space", 32, a.key, [" ", "Spacebar"]) ? null :
|
|
161
|
-
} } }, [t(
|
|
162
|
-
},
|
|
160
|
+
return !a.type.indexOf("key") && e._k(a.keyCode, "space", 32, a.key, [" ", "Spacebar"]) ? null : o.onClearSearch.apply(null, arguments);
|
|
161
|
+
} } }, [t(o.CrossCircleFillIcon, { attrs: { "svg-title": "clearSearch" } })], 1) : e._e()])], 1);
|
|
162
|
+
}, Y = [], M = /* @__PURE__ */ g(
|
|
163
163
|
U,
|
|
164
|
+
$,
|
|
164
165
|
Y,
|
|
165
|
-
K,
|
|
166
166
|
!1,
|
|
167
167
|
null,
|
|
168
168
|
"dbc6aa66",
|
|
169
169
|
null,
|
|
170
170
|
null
|
|
171
171
|
);
|
|
172
|
-
const
|
|
172
|
+
const q = M.exports, K = y({
|
|
173
173
|
name: "dropdown-default-textbox",
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
l.OPEN,
|
|
178
|
-
l.CLOSE,
|
|
179
|
-
l.INPUT,
|
|
180
|
-
l.CLEAR,
|
|
181
|
-
l.KEYDOWN
|
|
182
|
-
],
|
|
174
|
+
inheritAttrs: !1
|
|
175
|
+
}), H = /* @__PURE__ */ y({
|
|
176
|
+
...K,
|
|
183
177
|
props: {
|
|
184
178
|
/**
|
|
185
179
|
* The number of additional items that have been selected in the dropdown.
|
|
@@ -269,66 +263,58 @@ const M = $.exports, W = m({
|
|
|
269
263
|
*/
|
|
270
264
|
multiple: { type: Boolean, default: !1 }
|
|
271
265
|
},
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
[`b-dropdown-default-textbox--${
|
|
276
|
-
[`b-dropdown-default-textbox--${
|
|
277
|
-
[`b-dropdown-default-textbox--${
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
[
|
|
292
|
-
[
|
|
293
|
-
[
|
|
294
|
-
[
|
|
295
|
-
|
|
296
|
-
return {
|
|
297
|
-
// Enums
|
|
298
|
-
DropdownBaseTextboxEvent: l,
|
|
299
|
-
// Values
|
|
300
|
-
conditionalClasses: n,
|
|
301
|
-
isDropdownOpen: a,
|
|
302
|
-
slots: e,
|
|
303
|
-
// Events
|
|
304
|
-
listeners: y
|
|
266
|
+
emits: ["clear", "close", "input", "keydown", "open"],
|
|
267
|
+
setup(n, { emit: e }) {
|
|
268
|
+
const t = n, o = v(), a = i(() => ({
|
|
269
|
+
[`b-dropdown-default-textbox--${u.ERROR}`]: !t.disabled && !t.readonly && t.isInvalid,
|
|
270
|
+
[`b-dropdown-default-textbox--${u.DISABLED}`]: t.disabled,
|
|
271
|
+
[`b-dropdown-default-textbox--${u.READONLY}`]: t.readonly,
|
|
272
|
+
[`b-dropdown-default-textbox--${u.OPENED}`]: t.open,
|
|
273
|
+
"b-dropdown-default-textbox--condensed": t.condensed
|
|
274
|
+
})), p = i(() => t.open && !t.disabled && !t.readonly), r = (l) => {
|
|
275
|
+
e("input", l);
|
|
276
|
+
}, c = (l) => {
|
|
277
|
+
e("keydown", l);
|
|
278
|
+
}, b = (l) => {
|
|
279
|
+
m(l), e("open");
|
|
280
|
+
}, f = (l) => {
|
|
281
|
+
m(l), e("close");
|
|
282
|
+
}, _ = (l) => {
|
|
283
|
+
m(l), e("clear");
|
|
284
|
+
}, x = {
|
|
285
|
+
[s.INPUT]: r,
|
|
286
|
+
[s.OPEN]: b,
|
|
287
|
+
[s.CLOSE]: f,
|
|
288
|
+
[s.CLEAR]: _,
|
|
289
|
+
[s.KEYDOWN]: c
|
|
305
290
|
};
|
|
291
|
+
return { __sfc: !0, emit: e, slots: o, props: t, conditionalClasses: a, isDropdownOpen: p, onInput: r, onKeyDown: c, openDropdown: b, closeDropdown: f, clearValue: _, listeners: x, DropdownBaseTextbox: q, ChevronDownIcon: F, ChevronUpIcon: R };
|
|
306
292
|
}
|
|
307
293
|
});
|
|
308
|
-
var
|
|
309
|
-
var e = this, t = e._self._c;
|
|
310
|
-
return
|
|
311
|
-
return { key:
|
|
312
|
-
return [e._t(
|
|
294
|
+
var W = function() {
|
|
295
|
+
var e = this, t = e._self._c, o = e._self._setupProxy;
|
|
296
|
+
return t("div", { staticClass: "b-dropdown-default-textbox", class: o.conditionalClasses, attrs: { "data-testid": "default-textbox" } }, [t(o.DropdownBaseTextbox, e._g(e._b({ staticClass: "b-dropdown-default-textbox__textbox", attrs: { value: e.value }, scopedSlots: e._u([e._l(o.slots, function(a, p) {
|
|
297
|
+
return { key: p, fn: function(r) {
|
|
298
|
+
return [e._t(p, null, null, r)];
|
|
313
299
|
} };
|
|
314
300
|
}), { key: "icon", fn: function() {
|
|
315
|
-
return [t("div", { staticClass: "b-dropdown-default-textbox__chevron" }, [t(
|
|
316
|
-
}, proxy: !0 }], null, !0) }, "dropdown-base-textbox", { ...e.$attrs, ...e.$props }, !1),
|
|
317
|
-
},
|
|
318
|
-
W,
|
|
319
|
-
q,
|
|
301
|
+
return [t("div", { staticClass: "b-dropdown-default-textbox__chevron" }, [t(o.ChevronUpIcon, { directives: [{ name: "show", rawName: "v-show", value: o.isDropdownOpen, expression: "isDropdownOpen" }], attrs: { "svg-title": "opened" } }), t(o.ChevronDownIcon, { directives: [{ name: "show", rawName: "v-show", value: !o.isDropdownOpen, expression: "!isDropdownOpen" }], attrs: { "svg-title": "closed" } })], 1)];
|
|
302
|
+
}, proxy: !0 }], null, !0) }, "dropdown-base-textbox", { ...e.$attrs, ...e.$props }, !1), o.listeners))], 1);
|
|
303
|
+
}, j = [], z = /* @__PURE__ */ g(
|
|
320
304
|
H,
|
|
305
|
+
W,
|
|
306
|
+
j,
|
|
321
307
|
!1,
|
|
322
308
|
null,
|
|
323
|
-
"
|
|
309
|
+
"f2d8d922",
|
|
324
310
|
null,
|
|
325
311
|
null
|
|
326
312
|
);
|
|
327
|
-
const
|
|
313
|
+
const le = z.exports;
|
|
328
314
|
export {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
315
|
+
u as D,
|
|
316
|
+
s as a,
|
|
317
|
+
q as b,
|
|
318
|
+
le as c
|
|
333
319
|
};
|
|
334
|
-
//# sourceMappingURL=dropdown-default-textbox.
|
|
320
|
+
//# sourceMappingURL=dropdown-default-textbox.59803edd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-default-textbox.59803edd.js","sources":["../../src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.types.ts","../../src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue","../../src/components/dropdown/components/dropdown-default-textbox/dropdown-default-textbox.vue"],"sourcesContent":["import { PropType } from 'vue';\nimport { Booleanish } from '@/types';\n\n// TODO: Change this to script setup + Typescript interface\nexport const DropdownBaseTextboxProps = {\n /**\n * The number of additional items that have been selected in the dropdown.\n */\n additionalItemsSelected: { type: [Number, String] as PropType<number | string>, default: 0 },\n\n /**\n * Sets the possibility to type into the textbox\n */\n dynamicFiltering: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the aria-controls attribute on the textbox. This should correspond to the popover's id that the textbox triggers.\n */\n ariaControls: {\n type: String,\n required: true,\n },\n\n /**\n * Indicates whether the content the textbox triggers is visible or not. Needs to be set accordingly when the textbox is used and changed every time the popover is shown/hidden.\n */\n ariaExpanded: {\n type: [String, Boolean] as PropType<Booleanish>,\n required: true,\n },\n\n /**\n * Corresponds to the label's id that labels the textbox element.\n */\n ariaLabelledby: {\n type: String,\n default: null,\n },\n\n /**\n * Disables any textbox functionality\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Marks the textbox as invalid, rendering an error state\n */\n isInvalid: { type: Boolean, default: false },\n\n /**\n * Selected option's label\n */\n displayValue: { type: String, default: null },\n\n /**\n * Indicates if the dropdown is open so that\n * the respective event can be emitted\n */\n open: { type: Boolean, default: false },\n\n /**\n * The input value\n */\n value: { type: String, default: '' },\n\n /**\n * Custom debounce time. Default: 300\n */\n debounceTime: { type: Number, default: 300 },\n};\n\nexport enum DropdownBaseTextboxState {\n DISABLED = 'disabled',\n READONLY = 'readonly',\n HAS_ITEMS = 'has-items',\n OPENED = 'opened',\n ERROR = 'error',\n}\n\nexport enum DropdownBaseTextboxEvent {\n OPEN = 'dropdown-base-open',\n KEYDOWN = 'dropdown-base-keydown',\n CLOSE = 'dropdown-base-close',\n INPUT = 'dropdown-base-input',\n CLEAR = 'dropdown-base-clear',\n}\n\nexport default DropdownBaseTextboxProps;\n","<template>\n <div\n :class=\"$attrs.class\"\n data-testid=\"textbox-wrapper\"\n @click=\"onToggleDropdown\"\n @keydown.escape=\"onCloseDropdown\"\n >\n <bento-typography\n class=\"b-dropdown-base-textbox\"\n :class=\"conditionalClasses\"\n el=\"div\"\n data-testid=\"base-textbox\"\n >\n <input\n v-if=\"shouldShowInput\"\n v-bind=\"ariaAttributes\"\n :id=\"textboxId\"\n ref=\"textbox\"\n class=\"b-dropdown-base-textbox__input\"\n role=\"combobox\"\n type=\"text\"\n aria-autocomplete=\"list\"\n :value=\"open ? value : displayValue\"\n :disabled=\"disabled ? true : null\"\n :readonly=\"readonly\"\n @keydown=\"$emit(DropdownBaseTextboxEvent.KEYDOWN, $event)\"\n @keydown.enter=\"onToggleDropdown\"\n @input=\"onInputEvent\"\n />\n <div\n v-else\n :id=\"textboxId\"\n v-bind=\"ariaAttributes\"\n ref=\"textbox\"\n class=\"b-dropdown-base-textbox__input\"\n :class=\"comboboxConditionalClasses\"\n role=\"combobox\"\n :tabindex=\"0\"\n >\n <!-- <span :aria-hidden=\"!displayValue ? true : null\"> -->\n <slot v-if=\"selectedValueItem && !multiple\" v-bind=\"selectedValueItem\">\n {{ displayValue }}\n </slot>\n <template v-else-if=\"selectedValueItem && showSlotContentInMultiple\">\n <div class=\"b-dropdown-base-textbox__input-multiple-selected\">\n <div v-for=\"singleItem of selectedValueItems\" :key=\"singleItem.value\">\n <div class=\"b-dropdown-base-textbox__input-selected-element\">\n <slot v-bind=\"singleItem\">\n {{ displayValue }}\n </slot>\n </div>\n </div>\n </div>\n </template>\n <template v-else>{{ displayValue }}</template>\n <!-- </span> -->\n </div>\n <span v-if=\"additionalItemsSelected\" class=\"b-dropdown-base-textbox__additional-items\">\n {{ additionalItemsSelected }}\n </span>\n <span v-if=\"hasSlot('icon') && !isFiltering\" class=\"b-dropdown-base-textbox__icon\" aria-hidden=\"true\">\n <slot name=\"icon\"></slot>\n </span>\n <span\n v-if=\"isFiltering\"\n class=\"b-dropdown-base-textbox__clear-search\"\n tabindex=\"0\"\n data-testid=\"clear-search-button\"\n @click.stop=\"onClearSearch\"\n @keydown.enter.stop=\"onClearSearch\"\n @keyup.space=\"onClearSearch\"\n >\n <cross-circle-fill-icon :svg-title=\"'clearSearch'\" />\n </span>\n </bento-typography>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, nextTick, PropType, ref, useAttrs, useSlots, watch } from 'vue';\n import { generateUid } from '@/utils/ts/unique-id';\n import { useHasSlot } from '@/composables';\n import { BentoTypography } from '@/components/typography';\n import { debounce } from '@/utils/ts/debounce';\n import { BentoListboxOptionItem, Booleanish } from '@/types';\n import type { HTMLAttributes } from 'vue/types/jsx';\n import { DropdownBaseTextboxEvent, DropdownBaseTextboxState } from './dropdown-base-textbox.types';\n import CrossCircleFillIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill';\n\n const attrs = useAttrs();\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const props = defineProps({\n /**\n * The number of additional items that have been selected in the dropdown.\n */\n additionalItemsSelected: { type: [Number, String] as PropType<number | string>, default: 0 },\n\n /**\n * If the combobox DOM element should be an `input` element.\n */\n alwaysComboboxIsInput: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the aria-controls attribute on the textbox. This should correspond to the popover's id that the textbox triggers.\n */\n ariaControls: { type: String, required: true },\n\n /**\n * Indicates whether the content the textbox triggers is visible or not. Needs to be set accordingly when the textbox is used and changed every time the popover is shown/hidden.\n */\n ariaExpanded: {\n type: [String, Boolean] as PropType<Booleanish>,\n required: true,\n },\n\n /**\n * If no label element is used then the aria-label is be set should be set.\n */\n ariaLabel: { type: String, default: null },\n\n /**\n * Corresponds to the label's id that labels the textbox element.\n */\n ariaLabelledby: { type: String, default: null },\n\n /**\n * Custom debounce time for the user type event.\n */\n debounceTime: { type: Number, default: 300 },\n\n /**\n * Disables any textbox functionality\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Selected option's label\n */\n displayValue: { type: String, default: null },\n\n /**\n * Sets the possibility to type into the textbox.\n */\n dynamicFiltering: { type: Boolean, default: false },\n\n /**\n * Marks the textbox as invalid, rendering an error state\n */\n isInvalid: { type: Boolean, default: false },\n\n /*\n * If enabled, the user will be able to select multiple items.\n */\n multiple: { type: Boolean, default: false },\n\n /**\n * Indicates if the dropdown is open so that\n * the respective event can be emitted\n */\n open: { type: Boolean, default: false },\n\n /**\n * Sets the dropdown to readonly state\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * The input value\n */\n value: { type: String, default: '' },\n\n /**\n * The selected value's list box item.\n */\n selectedValueItem: {\n type: [Object, Array] as PropType<BentoListboxOptionItem | BentoListboxOptionItem[]>,\n default: undefined,\n },\n\n /**\n * Toggles whether to use the slot content select items shown in the textbox in multiple mode.\n */\n showSlotContentInMultiple: { type: Boolean, default: false },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the \"clear\" button is clicked\n */\n (e: DropdownBaseTextboxEvent.CLEAR);\n\n /**\n * Emitted on click, space, enter and esc user events. It will close the dropdown.\n */\n (e: DropdownBaseTextboxEvent.CLOSE);\n\n /**\n * Emitted when `dynamicFiltering` is enabled and a search input is entered\n */\n (e: DropdownBaseTextboxEvent.INPUT, searchValue: string);\n\n /**\n * Emitted when any key is pressed and the focus is on the input field\n */\n (e: DropdownBaseTextboxEvent.KEYDOWN, event: KeyboardEvent);\n\n /**\n * Emitted on click, space and enter user events. It will open the dropdown.\n */\n (e: DropdownBaseTextboxEvent.OPEN);\n }>();\n\n const textbox = ref(null);\n const textboxId = generateUid('textbox');\n\n const conditionalClasses = computed(() => ({\n [`b-dropdown-base-textbox--${DropdownBaseTextboxState.DISABLED}`]: props.disabled,\n [`b-dropdown-base-textbox--${DropdownBaseTextboxState.READONLY}`]: props.readonly,\n [`b-dropdown-base-textbox--${DropdownBaseTextboxState.HAS_ITEMS}`]: !!props.additionalItemsSelected,\n }));\n\n const comboboxConditionalClasses = computed(() => ({\n [`b-dropdown-base-textbox__input--dynamic-filtering`]: props.dynamicFiltering,\n }));\n\n const isFiltering = computed(() => props.dynamicFiltering && !!props.value && props.open);\n\n const ariaAttributes = computed(\n () =>\n ({\n 'aria-haspopup': 'listbox',\n 'aria-controls': props.ariaControls,\n 'aria-describedby': attrs['aria-describedby']?.toString() as string,\n 'aria-expanded': props.ariaExpanded ? 'true' : 'false',\n 'aria-labelledby': props.ariaLabelledby,\n 'aria-label': props.ariaLabelledby ? null : props.ariaLabel,\n 'aria-invalid': props.isInvalid,\n 'aria-disabled': props.disabled ? true : null,\n } as HTMLAttributes)\n );\n\n const shouldShowInput = computed(() => props.dynamicFiltering && (props.open || props.alwaysComboboxIsInput));\n watch(\n () => shouldShowInput.value,\n () => {\n if (shouldShowInput.value && !props.alwaysComboboxIsInput) {\n nextTick(() => {\n textbox.value.focus();\n });\n }\n }\n );\n\n const onOpenDropdown = () => {\n if (!props.disabled && !props.readonly) {\n textbox.value.focus();\n emit(DropdownBaseTextboxEvent.OPEN);\n }\n };\n\n const onCloseDropdown = () => {\n if (props.open) {\n textbox.value.focus();\n emit(DropdownBaseTextboxEvent.CLOSE);\n }\n };\n\n const onToggleDropdown = (event: Event) => {\n const isDynamicFilteringInputClickEvent = props.open && (event.target as HTMLDivElement).tagName === 'INPUT';\n if (isDynamicFilteringInputClickEvent) {\n /**\n * When there's a click even on the input during filtering\n * and the popover is open, do not toggle the popover.\n * Allow for click events inside the input field\n */\n return null;\n }\n\n return props.open ? onCloseDropdown() : onOpenDropdown();\n };\n\n const onClearSearch = () => {\n emit(DropdownBaseTextboxEvent.CLEAR);\n emit(DropdownBaseTextboxEvent.INPUT, '');\n textbox.value.focus();\n };\n const onInputEvent = debounce<(event: Event) => void>((event: Event) => {\n if (!props.readonly && !props.disabled) {\n emit(DropdownBaseTextboxEvent.INPUT, (event.target as HTMLInputElement).value);\n } else {\n event.preventDefault();\n event.stopPropagation();\n }\n }, props.debounceTime);\n\n // Cast selectedValueItem if it is an array of selected items\n const selectedValueItems = computed(() =>\n props.multiple ? (props.selectedValueItem as BentoListboxOptionItem[]) : []\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * Only for internal use, implements the logic of the textbox element to be implemented in the combobox.\n */\n export default defineComponent({\n name: 'dropdown-base-textbox',\n inheritAttrs: false,\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./dropdown-base-textbox.scss\" />\n","<template>\n <div class=\"b-dropdown-default-textbox\" :class=\"conditionalClasses\" data-testid=\"default-textbox\">\n <dropdown-base-textbox\n v-bind=\"{ ...$attrs, ...$props }\"\n class=\"b-dropdown-default-textbox__textbox\"\n :value=\"value\"\n v-on=\"listeners\"\n >\n <template v-for=\"(_, innerSlot) of slots\" #[innerSlot]=\"scope\">\n <slot :name=\"innerSlot\" v-bind=\"scope\" />\n </template>\n <template #icon>\n <div class=\"b-dropdown-default-textbox__chevron\">\n <chevron-up-icon v-show=\"isDropdownOpen\" svg-title=\"opened\" />\n <chevron-down-icon v-show=\"!isDropdownOpen\" svg-title=\"closed\" />\n </div>\n </template>\n </dropdown-base-textbox>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\n import { computed, defineComponent, PropType, useSlots } from 'vue';\n import DropdownBaseTextbox from '@/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue';\n import { BentoListboxOptionItem, Booleanish } from '@/types';\n import { stopEventPropagation } from '@/utils/ts/events';\n import {\n DropdownBaseTextboxEvent,\n DropdownBaseTextboxState,\n } from '../dropdown-base-textbox/dropdown-base-textbox.types';\n import ChevronDownIcon from '@adyen/ui-assets-icons-16/vue/chevron-down';\n import ChevronUpIcon from '@adyen/ui-assets-icons-16/vue/chevron-up';\n\n const emit = defineEmits<{\n /**\n * Emitted on clearing the input.\n */\n (e: 'clear');\n\n /**\n * Emitted on click, space and enter user events. It will open the dropdown.\n */\n (e: 'close');\n\n /**\n * Emitted on input event.\n */\n (e: 'input', newInput: string);\n\n /**\n * Emitted on keydown event.\n */\n (e: 'keydown', keydownEvent: KeyboardEvent);\n\n /**\n * Emitted on click, space, enter and esc user events. It will close the dropdown.\n */\n (e: 'open');\n }>();\n\n const slots = useSlots();\n\n const props = defineProps({\n /**\n * The number of additional items that have been selected in the dropdown.\n */\n additionalItemsSelected: { type: [Number, String] as PropType<number | string>, default: 0 },\n\n /**\n * Sets the aria-controls attribute on the textbox. This should correspond to the popover's id that the textbox triggers.\n */\n ariaControls: {\n type: String,\n required: true,\n },\n\n /**\n * Indicates whether the content the textbox triggers is visible or not. Needs to be set accordingly when the textbox is used and changed every time the popover is shown/hidden.\n */\n ariaExpanded: {\n type: [String, Boolean] as PropType<Booleanish>,\n required: true,\n },\n\n /**\n * If no label element is used then the aria-label is be set should be set.\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Corresponds to the label's id that labels the textbox element.\n */\n ariaLabelledby: {\n type: String,\n default: null,\n },\n\n /**\n * Renders the dropdown with a condensed style.\n */\n condensed: { type: Boolean, default: false },\n\n /**\n * Custom debounce time. Default: 300\n */\n debounceTime: { type: Number, default: 300 },\n\n /**\n * Disables any textbox functionality\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Selected option's label\n */\n displayValue: { type: String, default: null },\n\n /**\n * Sets the possibility to type into the textbox\n */\n dynamicFiltering: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Marks the textbox as invalid, rendering an error state\n */\n isInvalid: { type: Boolean, default: false },\n\n /**\n * Indicates if the dropdown is open so that\n * the respective event can be emitted\n */\n open: { type: Boolean, default: false },\n\n /**\n * Sets the dropdown to readonly state\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * The selected value's list box item.\n */\n selectedValueItem: {\n type: [Object, Array] as PropType<BentoListboxOptionItem | BentoListboxOptionItem[]>,\n default: undefined,\n },\n\n /**\n * Toggles whether to use the slot content select items shown in the textbox in multiple mode.\n */\n showSlotContentInMultiple: { type: Boolean, default: false },\n\n /**\n * The input value\n */\n value: { type: String, default: '' },\n\n /*\n * If enabled, the user will be able to select multiple items.\n */\n multiple: { type: Boolean, default: false },\n });\n\n const conditionalClasses = computed(() => ({\n [`b-dropdown-default-textbox--${DropdownBaseTextboxState.ERROR}`]:\n !props.disabled && !props.readonly && props.isInvalid,\n [`b-dropdown-default-textbox--${DropdownBaseTextboxState.DISABLED}`]: props.disabled,\n [`b-dropdown-default-textbox--${DropdownBaseTextboxState.READONLY}`]: props.readonly,\n [`b-dropdown-default-textbox--${DropdownBaseTextboxState.OPENED}`]: props.open,\n 'b-dropdown-default-textbox--condensed': props.condensed,\n }));\n\n const isDropdownOpen = computed(() => props.open && !props.disabled && !props.readonly);\n\n const onInput = (newInput: string) => {\n emit('input', newInput);\n };\n const onKeyDown = (e: KeyboardEvent) => {\n emit('keydown', e);\n };\n const openDropdown = (e: Event) => {\n stopEventPropagation(e);\n emit('open');\n };\n const closeDropdown = (e: Event) => {\n stopEventPropagation(e);\n emit('close');\n };\n const clearValue = (e: Event) => {\n stopEventPropagation(e);\n emit('clear');\n };\n\n const listeners = {\n [DropdownBaseTextboxEvent.INPUT]: onInput,\n [DropdownBaseTextboxEvent.OPEN]: openDropdown,\n [DropdownBaseTextboxEvent.CLOSE]: closeDropdown,\n [DropdownBaseTextboxEvent.CLEAR]: clearValue,\n [DropdownBaseTextboxEvent.KEYDOWN]: onKeyDown,\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * For internal use only, textbox component used in the dropdown component.\n */\n export default defineComponent({\n name: 'dropdown-default-textbox',\n inheritAttrs: false,\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./dropdown-default-textbox.scss\" />\n"],"names":["DropdownBaseTextboxState","DropdownBaseTextboxState2","DropdownBaseTextboxEvent","DropdownBaseTextboxEvent2","__default__$1","defineComponent","attrs","useAttrs","slots","useSlots","hasSlot","useHasSlot","textbox","ref","textboxId","generateUid","conditionalClasses","computed","props","comboboxConditionalClasses","isFiltering","ariaAttributes","_a","shouldShowInput","watch","nextTick","onOpenDropdown","emit","onCloseDropdown","onToggleDropdown","event","onClearSearch","onInputEvent","debounce","selectedValueItems","__default__","isDropdownOpen","onInput","newInput","onKeyDown","e","openDropdown","stopEventPropagation","closeDropdown","clearValue","listeners"],"mappings":"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"}
|