@adyen/bento-vue2 1.11.1 → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/components.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.vue.d.ts +10 -22
- package/dist/@types/packages/vue2/src/components/code-snippet/code-snippet.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns.vue.d.ts +34 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-scroller/use-scroller.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.types.d.ts +3 -1
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/date/date.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue.d.ts +38 -29
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue.d.ts +43 -1306
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-small-textbox/dropdown-small-textbox.vue.d.ts +5 -11
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-avatar/dropdown-avatar.vue.d.ts +43 -48
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-avatar/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/dropdown-country.vue.d.ts +43 -44
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-currency/dropdown-currency.vue.d.ts +43 -43
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-payment-method/dropdown-payment-method.vue.d.ts +43 -43
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-payment-method/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-tag/dropdown-tag.vue.d.ts +43 -48
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-tag/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/dropdown/composables/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/dropdown/composables/use-display-value.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/dropdown/composables/use-display-value.types.d.ts +28 -0
- package/dist/@types/packages/vue2/src/components/dropdown/composables/{useKeyboardNavigation.d.ts → use-keyboard-navigation.d.ts} +3 -13
- package/dist/@types/packages/vue2/src/components/dropdown/composables/use-keyboard-navigation.types.d.ts +15 -0
- package/dist/@types/packages/vue2/src/components/dropdown/dropdown.vue.d.ts +48 -1674
- package/dist/@types/packages/vue2/src/components/dropdown/index.d.ts +5 -4
- package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +532 -12
- package/dist/@types/packages/vue2/src/components/filter-bar/components/base-filter/base-filter.vue.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/filter-bar/filter-bar.types.d.ts +4 -1
- package/dist/@types/packages/vue2/src/components/input-field/input-field.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-chips/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-chips/listbox-multi-select-chips.vue.d.ts +28 -0
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/listbox-multi-select.vue.d.ts +3 -4
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-single-select/listbox-single-select.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/internal/listbox/composables/useListboxKeyboardNavigation.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/internal/listbox/listbox.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/link/link.vue.d.ts +20 -13
- package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.keys.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.vue.d.ts +16 -60
- package/dist/@types/packages/vue2/src/components/modal/components/modal-default/modal-default.vue.d.ts +59 -49
- package/dist/@types/packages/vue2/src/components/modal/components/modal-dialog/modal-dialog.vue.d.ts +39 -291
- package/dist/@types/packages/vue2/src/components/modal/modal.vue.d.ts +76 -83
- package/dist/@types/packages/vue2/src/components/pagination/pagination.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/popper-container/popper-container.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/radio-group/components/radio-button/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/radio-group/components/radio-button/radio-button.types.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/radio-group/components/radio-button/radio-button.vue.d.ts +22 -26
- package/dist/@types/packages/vue2/src/components/radio-group/index.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/search-bar/search-bar.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/sidepanel/sidepanel.keys.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item/summary-grid-item.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/textarea/textarea.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/tooltip/tooltip.vue.d.ts +3 -3
- 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 +10 -0
- package/dist/@types/packages/vue2/src/templates/data-grid-template/index.d.ts +1 -0
- package/dist/accordion.js +2 -2
- package/dist/action-bar.js +5 -5
- package/dist/alert.js +17 -16
- package/dist/alert.js.map +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button.css +1 -1
- package/dist/assets/checkbox.css +1 -1
- package/dist/assets/controls-group.css +1 -1
- package/dist/assets/dropdown-default-textbox.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/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/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/listbox.css +1 -1
- package/dist/avatar-image.js +1 -1
- package/dist/badge.js +1 -1
- package/dist/button.js +45 -52
- package/dist/button.js.map +1 -1
- package/dist/card.js +15 -15
- package/dist/card.js.map +1 -1
- package/dist/checkbox.js +6 -6
- package/dist/chunks/arrow-left.2db60716.js.map +1 -1
- package/dist/chunks/{base-button.f58ffaaa.js → base-button.f9080a52.js} +2 -2
- package/dist/chunks/{base-button.f58ffaaa.js.map → base-button.f9080a52.js.map} +1 -1
- package/dist/chunks/base-modal.a580438d.js +202 -0
- package/dist/chunks/base-modal.a580438d.js.map +1 -0
- package/dist/chunks/{button-actions-with-menu.3849a35c.js → button-actions-with-menu.a9087340.js} +3 -3
- package/dist/chunks/{button-actions-with-menu.3849a35c.js.map → button-actions-with-menu.a9087340.js.map} +1 -1
- package/dist/chunks/{button.3ce10493.js → button.bb0d7584.js} +7 -7
- package/dist/chunks/{button.3ce10493.js.map → button.bb0d7584.js.map} +1 -1
- package/dist/chunks/{calendar.3e9c35d0.js → calendar.17ab99de.js} +69 -68
- package/dist/chunks/{calendar.3e9c35d0.js.map → calendar.17ab99de.js.map} +1 -1
- package/dist/chunks/{checkbox.68cc1f84.js → checkbox.51cdb397.js} +3 -3
- package/dist/chunks/checkbox.51cdb397.js.map +1 -0
- package/dist/chunks/checkmark-circle-fill.345311d2.js.map +1 -1
- package/dist/chunks/checkmark-small.520f01b1.js.map +1 -1
- package/dist/chunks/checkmark.a6ed8f47.js.map +1 -1
- package/dist/chunks/chevron-left.5edf02ac.js.map +1 -1
- package/dist/chunks/chevron-up.81185563.js.map +1 -1
- package/dist/chunks/{controls-group.9e878137.js → controls-group.3716f4b4.js} +4 -4
- package/dist/chunks/{controls-group.9e878137.js.map → controls-group.3716f4b4.js.map} +1 -1
- package/dist/chunks/{copy.14578696.js → copy.54cc3ab4.js} +4 -4
- package/dist/chunks/copy.54cc3ab4.js.map +1 -0
- package/dist/chunks/cross-circle-fill.27580c4b.js.map +1 -1
- package/dist/chunks/cross-small.e851e0de.js +26 -0
- package/dist/chunks/cross-small.e851e0de.js.map +1 -0
- package/dist/chunks/cross.04678d81.js.map +1 -1
- package/dist/chunks/{dropdown-default-textbox.4b227b24.js → dropdown-default-textbox.13b5054e.js} +129 -148
- package/dist/chunks/dropdown-default-textbox.13b5054e.js.map +1 -0
- package/dist/chunks/dropdown.4d800c61.js +797 -0
- package/dist/chunks/dropdown.4d800c61.js.map +1 -0
- package/dist/chunks/{field-label.3019a2f3.js → field-label.7328b82b.js} +2 -2
- package/dist/chunks/{field-label.3019a2f3.js.map → field-label.7328b82b.js.map} +1 -1
- package/dist/chunks/{fixed-scroller.cd3e1f8d.js → fixed-scroller.d6c11166.js} +2 -2
- package/dist/chunks/{fixed-scroller.cd3e1f8d.js.map → fixed-scroller.d6c11166.js.map} +1 -1
- package/dist/chunks/{footer-actions.da12aa54.js → footer-actions.bc0cb7e0.js} +3 -3
- package/dist/chunks/{footer-actions.da12aa54.js.map → footer-actions.bc0cb7e0.js.map} +1 -1
- package/dist/chunks/{index.eede8742.js → index.170ac16b.js} +3 -3
- package/dist/chunks/{index.eede8742.js.map → index.170ac16b.js.map} +1 -1
- package/dist/chunks/index.339f15c4.js +637 -0
- package/dist/chunks/index.339f15c4.js.map +1 -0
- package/dist/chunks/{index.026ae47b.js → index.541cce1c.js} +2 -2
- package/dist/chunks/{index.026ae47b.js.map → index.541cce1c.js.map} +1 -1
- package/dist/chunks/{index.c032aa32.js → index.5742fba4.js} +7 -7
- package/dist/chunks/index.5742fba4.js.map +1 -0
- package/dist/chunks/{index.32095db1.js → index.6ac01113.js} +2 -2
- package/dist/chunks/{index.32095db1.js.map → index.6ac01113.js.map} +1 -1
- package/dist/chunks/{index.618cc4cb.js → index.772a5595.js} +13 -12
- package/dist/chunks/{index.618cc4cb.js.map → index.772a5595.js.map} +1 -1
- package/dist/chunks/{index.8f1e4d8d.js → index.82ff40be.js} +3 -3
- package/dist/chunks/{index.8f1e4d8d.js.map → index.82ff40be.js.map} +1 -1
- package/dist/chunks/{index.13ede682.js → index.a4a820fd.js} +6 -6
- package/dist/chunks/{index.13ede682.js.map → index.a4a820fd.js.map} +1 -1
- package/dist/chunks/{index.02859365.js → index.af238ed6.js} +2 -2
- package/dist/chunks/{index.02859365.js.map → index.af238ed6.js.map} +1 -1
- package/dist/chunks/index.d1f65246.js +80 -0
- package/dist/chunks/index.d1f65246.js.map +1 -0
- package/dist/chunks/{index.6a417137.js → index.ec0743da.js} +5 -5
- package/dist/chunks/{index.6a417137.js.map → index.ec0743da.js.map} +1 -1
- package/dist/chunks/{info-filled.27bd4bfb.js → info-filled.c37e091d.js} +12 -33
- package/dist/chunks/{info-filled.27bd4bfb.js.map → info-filled.c37e091d.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.2efd15e0.js → listbox-option-tag.6f3e922c.js} +3 -3
- package/dist/chunks/{listbox-option-tag.2efd15e0.js.map → listbox-option-tag.6f3e922c.js.map} +1 -1
- package/dist/chunks/{listbox.371743bc.js → listbox.e5d70b9b.js} +472 -423
- package/dist/chunks/listbox.e5d70b9b.js.map +1 -0
- package/dist/chunks/{loading-button.2e197f34.js → loading-button.7301cc2e.js} +2 -2
- package/dist/chunks/{loading-button.2e197f34.js.map → loading-button.7301cc2e.js.map} +1 -1
- package/dist/chunks/refresh.71a03998.js.map +1 -1
- package/dist/chunks/search.471270fe.js.map +1 -1
- package/dist/chunks/sidepanel.keys.3f8d69c1.js +7 -0
- package/dist/chunks/sidepanel.keys.3f8d69c1.js.map +1 -0
- package/dist/chunks/{tooltip.1ec3479c.js → tooltip.46858ae6.js} +3 -3
- package/dist/chunks/{tooltip.1ec3479c.js.map → tooltip.46858ae6.js.map} +1 -1
- package/dist/chunks/{useCountryItems.6b7985bf.js → use-country-items.6b7985bf.js} +1 -1
- package/dist/chunks/use-country-items.6b7985bf.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 +674 -656
- package/dist/data-grid.js.map +1 -1
- package/dist/date-picker.js +30 -30
- package/dist/date-picker.js.map +1 -1
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +1 -1
- package/dist/divider.js +1 -1
- package/dist/dropdown.js +102 -132
- package/dist/dropdown.js.map +1 -1
- package/dist/empty-state.js +3 -3
- package/dist/filter-bar.js +487 -480
- 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 +3 -3
- package/dist/index.js +207 -201
- package/dist/info-icon.js +3 -3
- package/dist/info-icon.js.map +1 -1
- package/dist/input-field.js +4 -4
- package/dist/internal.js +7 -7
- package/dist/link.js +3 -46
- package/dist/link.js.map +1 -1
- package/dist/loading-indicator.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal.js +209 -302
- package/dist/modal.js.map +1 -1
- package/dist/pagination.js +88 -88
- package/dist/pagination.js.map +1 -1
- 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 +84 -101
- 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 +73 -71
- package/dist/sidepanel.js.map +1 -1
- package/dist/status.js +2 -2
- package/dist/stepper.js +3 -3
- package/dist/stepper.js.map +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +3 -3
- package/dist/tabs.js +4 -4
- package/dist/tabs.js.map +1 -1
- package/dist/tag.js +3 -3
- package/dist/textarea.js +91 -87
- package/dist/textarea.js.map +1 -1
- package/dist/timeline.js +6 -6
- package/dist/timeline.js.map +1 -1
- package/dist/toast.js +8 -7
- package/dist/toast.js.map +1 -1
- package/dist/toggle.js +2 -2
- package/dist/tutorial.js +5 -5
- package/dist/tutorial.js.map +1 -1
- package/dist/typography.js +1 -1
- package/dist/web-types.json +3708 -3474
- package/package.json +2 -2
- package/dist/@types/packages/vue2/src/components/dropdown/composables/useDisplayValue.d.ts +0 -2
- package/dist/@types/packages/vue2/src/components/dropdown/composables/useDisplayValue.types.d.ts +0 -12
- package/dist/@types/packages/vue2/src/components/dropdown/composables/useDropdownSearchFilter.d.ts +0 -3
- package/dist/chunks/base-modal.435bdd62.js +0 -222
- package/dist/chunks/base-modal.435bdd62.js.map +0 -1
- package/dist/chunks/checkbox.68cc1f84.js.map +0 -1
- package/dist/chunks/copy.14578696.js.map +0 -1
- package/dist/chunks/dropdown-default-textbox.4b227b24.js.map +0 -1
- package/dist/chunks/dropdown.7749c2d7.js +0 -887
- package/dist/chunks/dropdown.7749c2d7.js.map +0 -1
- package/dist/chunks/index.9398acc6.js +0 -635
- package/dist/chunks/index.9398acc6.js.map +0 -1
- package/dist/chunks/index.c032aa32.js.map +0 -1
- package/dist/chunks/listbox.371743bc.js.map +0 -1
- package/dist/chunks/useCountryItems.6b7985bf.js.map +0 -1
- /package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/composables/{useDropdownOptionsListbox.d.ts → use-dropdown-options-listbox.d.ts} +0 -0
- /package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/composables/{useCountryItems.d.ts → use-country-items.d.ts} +0 -0
package/dist/date-picker.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { ref as f, computed as D, defineComponent as Y, toRef as E, watch as W, nextTick as T } from "vue";
|
|
2
|
-
import { a as q } from "./chunks/index.
|
|
3
|
-
import { B as K } from "./chunks/index.
|
|
4
|
-
import { c as j } from "./chunks/dropdown-default-textbox.
|
|
2
|
+
import { a as q } from "./chunks/index.ec0743da.js";
|
|
3
|
+
import { B as K } from "./chunks/index.6ac01113.js";
|
|
4
|
+
import { c as j } from "./chunks/dropdown-default-textbox.13b5054e.js";
|
|
5
5
|
import { d as z } from "./chunks/debounce.b5ef6acf.js";
|
|
6
6
|
import { D as O, v as $, f as G } from "./chunks/date-input.9186a0bf.js";
|
|
7
7
|
import { g as u } from "./chunks/unique-id.a2a2b458.js";
|
|
8
8
|
import { u as B } from "./chunks/i18n.eb5b985b.js";
|
|
9
|
-
import { f as S } from "./chunks/index.
|
|
9
|
+
import { f as S } from "./chunks/index.772a5595.js";
|
|
10
10
|
import { e as I, d as H, f as J } from "./chunks/index.f55fdc32.js";
|
|
11
11
|
import { u as Q } from "./chunks/use-form-layout-loading.d03e5d48.js";
|
|
12
12
|
import "./chunks/index.4c062058.js";
|
|
13
|
-
import { C as p } from "./chunks/calendar.
|
|
14
|
-
import { b as
|
|
15
|
-
import { E as X, F as Z } from "./chunks/field-label.
|
|
13
|
+
import { C as p } from "./chunks/calendar.17ab99de.js";
|
|
14
|
+
import { b as Re } from "./chunks/calendar.17ab99de.js";
|
|
15
|
+
import { E as X, F as Z } from "./chunks/field-label.7328b82b.js";
|
|
16
16
|
import { B as ee } from "./chunks/directive.0408e565.js";
|
|
17
17
|
import { n as ae } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
|
|
18
|
-
import "./assets/
|
|
18
|
+
import "./assets/index.css";
|
|
19
19
|
const te = ({ datePickerValue: a, isDateIncorrect: e }) => {
|
|
20
20
|
var v;
|
|
21
21
|
const { locale: r, t: n } = B(), m = { de: H, enUS: I, fr: J }, s = f((v = a.value) == null ? void 0 : v.toDateString());
|
|
@@ -33,7 +33,7 @@ const te = ({ datePickerValue: a, isDateIncorrect: e }) => {
|
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
|
-
var
|
|
36
|
+
var i = /* @__PURE__ */ ((a) => (a.INPUT = "input", a))(i || {});
|
|
37
37
|
const re = {
|
|
38
38
|
"en-US": {
|
|
39
39
|
provideDateInAFormat: "Provide date in a YYYY-MM-DD format",
|
|
@@ -108,48 +108,48 @@ const re = {
|
|
|
108
108
|
*/
|
|
109
109
|
value: { type: [Date, Object], default: null }
|
|
110
110
|
},
|
|
111
|
-
emits: [
|
|
111
|
+
emits: [i.INPUT],
|
|
112
112
|
setup(a, { emit: e }) {
|
|
113
|
-
const { t: r } = B(), n = u("bento-date-picker-container"), m = u("bento-date-picker-label"), s = u("bento-date-picker-description"), b = u("bento-date-picker-error"), y = u("bento-date-picker-date-error"), v = D(() => a.label || r("datePicker", { name: n })), c = f(null),
|
|
113
|
+
const { t: r } = B(), n = u("bento-date-picker-container"), m = u("bento-date-picker-label"), s = u("bento-date-picker-description"), b = u("bento-date-picker-error"), y = u("bento-date-picker-date-error"), v = D(() => a.label || r("datePicker", { name: n })), c = f(null), w = f(null), l = f(!1), o = f(!1), { isReadOnly: R } = Q(E(a, "readonly"));
|
|
114
114
|
W(
|
|
115
115
|
() => a.disabled,
|
|
116
116
|
(t) => {
|
|
117
|
-
t &&
|
|
117
|
+
t && o.value && (o.value = !1);
|
|
118
118
|
}
|
|
119
119
|
);
|
|
120
120
|
const { dateDisplayValue: U, textInputValue: d, formatTextInputDisplayValue: g } = te({
|
|
121
121
|
datePickerValue: E(a, "value"),
|
|
122
122
|
isDateIncorrect: l
|
|
123
|
-
}), k = D(() => a.isDateDisabled && a.isDateDisabled(new Date(d.value)) && !
|
|
123
|
+
}), k = D(() => a.isDateDisabled && a.isDateDisabled(new Date(d.value)) && !o.value ? r("selectedDateIsNotAvailable") : l.value ? r("provideDateInAFormat") : null), V = D(() => ({
|
|
124
124
|
"b-date-picker__description--error": a.errorMessage || k.value
|
|
125
125
|
})), N = D(
|
|
126
126
|
() => `${a.description ? s : ""} ${a.errorMessage ? b : ""} ${k.value ? y : ""}`.trim() || null
|
|
127
127
|
), M = (t) => a.min && t <= a.min || a.max && t >= a.max ? !1 : a.isDateDisabled ? !a.isDateDisabled(t) : !0, x = () => {
|
|
128
|
-
|
|
128
|
+
o.value = !1;
|
|
129
129
|
}, C = () => {
|
|
130
|
-
|
|
130
|
+
o.value = !0, g();
|
|
131
131
|
}, F = (t) => {
|
|
132
|
-
l.value = !1, x(), e(
|
|
132
|
+
l.value = !1, x(), e(i.INPUT, t);
|
|
133
133
|
}, h = async () => {
|
|
134
|
-
l.value && (l.value = !1, d.value = null), e(
|
|
134
|
+
l.value && (l.value = !1, d.value = null), e(i.INPUT, null);
|
|
135
135
|
}, A = (t) => {
|
|
136
136
|
$(t);
|
|
137
137
|
}, P = (t) => {
|
|
138
138
|
if (t.length < 10)
|
|
139
139
|
return;
|
|
140
|
-
/^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/.test(t) && M(new Date(t)) ? (l.value = !1, e(
|
|
140
|
+
/^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/.test(t) && M(new Date(t)) ? (l.value = !1, e(i.INPUT, new Date(t))) : t && (l.value = !0, e(i.INPUT, null));
|
|
141
141
|
}, L = z(P, ne);
|
|
142
142
|
return {
|
|
143
143
|
// Refs
|
|
144
|
-
inputContainerRef:
|
|
144
|
+
inputContainerRef: w,
|
|
145
145
|
calendarContainerRef: c,
|
|
146
146
|
// Values,
|
|
147
147
|
dateDisplayValue: U,
|
|
148
148
|
datePickerContainerId: n,
|
|
149
149
|
descriptionConditionalClasses: V,
|
|
150
150
|
isDateIncorrect: l,
|
|
151
|
-
isDatePickerOpen:
|
|
152
|
-
isReadOnly:
|
|
151
|
+
isDatePickerOpen: o,
|
|
152
|
+
isReadOnly: R,
|
|
153
153
|
dateErrorText: k,
|
|
154
154
|
labelId: m,
|
|
155
155
|
descriptionId: s,
|
|
@@ -165,37 +165,37 @@ const re = {
|
|
|
165
165
|
openDatePicker: C,
|
|
166
166
|
onDateKeyDown: A,
|
|
167
167
|
onDateInputChange: (t) => {
|
|
168
|
-
d.value = G(t),
|
|
168
|
+
d.value = G(t), o.value ? L(d.value) : P(d.value);
|
|
169
169
|
},
|
|
170
170
|
// Keyboard navigation
|
|
171
171
|
onSpaceBarOrEnter: async (t) => {
|
|
172
172
|
var _;
|
|
173
|
-
|
|
173
|
+
o.value || (t.preventDefault(), C(), await T(), a.value || (g(/* @__PURE__ */ new Date()), e(i.INPUT, /* @__PURE__ */ new Date()), await T()), (_ = c.value) == null || _.$refs.calendarRef[0].focusOnDate(a.value));
|
|
174
174
|
}
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
177
|
});
|
|
178
|
-
var
|
|
178
|
+
var oe = function() {
|
|
179
179
|
var e = this, r = e._self._c;
|
|
180
180
|
return e._self._setupProxy, r("div", { directives: [{ name: "bento-click-outside-directive", rawName: "v-bento-click-outside-directive", value: e.closeDatePicker, expression: "closeDatePicker" }], staticClass: "b-date-picker", on: { "!keydown": [function(n) {
|
|
181
181
|
return !n.type.indexOf("key") && e._k(n.keyCode, "space", 32, n.key, [" ", "Spacebar"]) ? null : e.onSpaceBarOrEnter.apply(null, arguments);
|
|
182
182
|
}, function(n) {
|
|
183
183
|
return !n.type.indexOf("key") && e._k(n.keyCode, "enter", 13, n.key, "Enter") ? null : e.onSpaceBarOrEnter.apply(null, arguments);
|
|
184
|
-
}] } }, [e.label ? r("field-label", { attrs: { id: e.labelId, label: e.label, "tooltip-text": e.tooltipText, optional: e.optional, required: e.required } }) : e._e(), r("div", [r("dropdown-input-default", { ref: "inputContainerRef", attrs: { ariaControls: e.datePickerContainerId, ariaExpanded: e.isDatePickerOpen, "aria-labelledby": e.label ? e.labelId : null, "aria-describedby": e.ariaDescribedBy, disabled: e.disabled, "dynamic-filtering": "", "is-invalid": !!e.errorMessage || !!e.dateErrorText, open: e.isDatePickerOpen, value: e.textInputValue, "display-value": e.dateDisplayValue, "debounce-time": 0, readonly: e.isReadOnly }, on: { input: e.onDateInputChange, open: e.openDatePicker, keydown: e.onDateKeyDown, clear: e.clearDatePickerValue, close: e.closeDatePicker } })], 1), e.dateErrorText ? r("error-message", { staticClass: "b-date-picker__error-message", attrs: { id: e.dateErrorId, "error-message": e.dateErrorText } }) : e._e(), e.errorMessage ? r("error-message", { staticClass: "b-date-picker__error-message", attrs: { id: e.errorId, "error-message": e.errorMessage } }) : e._e(), e.description ? r("bento-typography", { staticClass: "b-date-picker__description", class: e.descriptionConditionalClasses, attrs: { el: "span" } }, [e._v(" " + e._s(e.description) + " ")]) : e._e(), e.inputContainerRef ? r("bento-popover", { staticClass: "b-date-picker__container", attrs: { id: e.datePickerContainerId, role: "dialog", open: e.isDatePickerOpen, "target-element": e.inputContainerRef, "disable-focus-trap": !0, "aria-label": e.popoverAriaLabel, "aria-modal": !0, position: "bottom-start", "fit-content": "" } }, [r("calendar", { ref: "calendarContainerRef", attrs: { "first-day-of-week": e.firstDayOfWeek, "is-date-disabled": e.isDateDisabled, "number-of-months": 1, value: e.value, min: e.min, max: e.max }, on: { input: e.onDateSelected } })], 1) : e._e()], 1);
|
|
185
|
-
},
|
|
184
|
+
}] } }, [e.label ? r("field-label", { attrs: { id: e.labelId, label: e.label, "tooltip-text": e.tooltipText, optional: e.optional, required: e.required } }) : e._e(), r("div", [r("dropdown-input-default", { ref: "inputContainerRef", attrs: { "always-combobox-is-input": "", ariaControls: e.datePickerContainerId, ariaExpanded: e.isDatePickerOpen, "aria-labelledby": e.label ? e.labelId : null, "aria-describedby": e.ariaDescribedBy, disabled: e.disabled, "dynamic-filtering": "", "is-invalid": !!e.errorMessage || !!e.dateErrorText, open: e.isDatePickerOpen, value: e.textInputValue, "display-value": e.dateDisplayValue, "debounce-time": 0, readonly: e.isReadOnly }, on: { input: e.onDateInputChange, open: e.openDatePicker, keydown: e.onDateKeyDown, clear: e.clearDatePickerValue, close: e.closeDatePicker } })], 1), e.dateErrorText ? r("error-message", { staticClass: "b-date-picker__error-message", attrs: { id: e.dateErrorId, "error-message": e.dateErrorText } }) : e._e(), e.errorMessage ? r("error-message", { staticClass: "b-date-picker__error-message", attrs: { id: e.errorId, "error-message": e.errorMessage } }) : e._e(), e.description ? r("bento-typography", { staticClass: "b-date-picker__description", class: e.descriptionConditionalClasses, attrs: { el: "span" } }, [e._v(" " + e._s(e.description) + " ")]) : e._e(), e.inputContainerRef ? r("bento-popover", { staticClass: "b-date-picker__container", attrs: { id: e.datePickerContainerId, role: "dialog", open: e.isDatePickerOpen, "target-element": e.inputContainerRef, "disable-focus-trap": !0, "aria-label": e.popoverAriaLabel, "aria-modal": !0, position: "bottom-start", "fit-content": "" } }, [r("calendar", { ref: "calendarContainerRef", attrs: { "first-day-of-week": e.firstDayOfWeek, "is-date-disabled": e.isDateDisabled, "number-of-months": 1, value: e.value, min: e.min, max: e.max }, on: { input: e.onDateSelected } })], 1) : e._e()], 1);
|
|
185
|
+
}, ie = [], se = /* @__PURE__ */ ae(
|
|
186
186
|
le,
|
|
187
|
-
ie,
|
|
188
187
|
oe,
|
|
188
|
+
ie,
|
|
189
189
|
!1,
|
|
190
190
|
null,
|
|
191
|
-
"
|
|
191
|
+
"408106fe",
|
|
192
192
|
null,
|
|
193
193
|
null
|
|
194
194
|
);
|
|
195
195
|
const Oe = se.exports;
|
|
196
196
|
export {
|
|
197
197
|
Oe as BentoDatePicker,
|
|
198
|
-
|
|
199
|
-
|
|
198
|
+
i as BentoDatePickerEvent,
|
|
199
|
+
Re as BentoDatePickerFirstDayOfWeek
|
|
200
200
|
};
|
|
201
201
|
//# sourceMappingURL=date-picker.js.map
|
package/dist/date-picker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.js","sources":["../src/components/date-picker/composables/use-date-picker-single-calendar-text.ts","../src/components/date-picker/date-picker.types.ts","../src/components/date-picker/date-picker.vue"],"sourcesContent":["import { computed, ref } from 'vue';\nimport { de, enUS, fr } from 'date-fns/locale';\nimport { useI18n } from '@/utils/ts/i18n';\nimport { UseDateDisplayText } from './use-date-picker-single-calendar-text.types';\nimport { DateFormat } from '@/types';\nimport format from 'date-fns/format';\n\n/**\n * Composable that sets and formats the date to be displayed in the input box of a Single Date Picker\n * @param {Ref<Date>} option.datePickerValue Ref to the datePickerValue set in the DatePicker component\n * @param {Ref<boolean>} option.isDateIncorrect Indicates if the date is correct or not\n */\nexport const useDatePickerSingleCalendarText: UseDateDisplayText<Date> = ({ datePickerValue, isDateIncorrect }) => {\n const { locale, t } = useI18n();\n const locales = { de, enUS, fr };\n\n const textInputValue = ref(datePickerValue.value?.toDateString());\n\n const dateDisplayValue = computed(() => {\n // Display incorrect date when there's an error with the input\n if (isDateIncorrect.value) {\n return textInputValue.value;\n }\n\n // Display \"Select a date\" when there's no date selected or input\n if (!datePickerValue.value) {\n return t('selectDate') as string;\n }\n\n // Display the date in format \"dd MMM, yyyy (25 Jun, 2023)\" if there's a valid date selected\n return format(datePickerValue.value as Date, DateFormat.FULL_DATE, {\n locale: locales[locale.value.substring(0, 2)] || enUS,\n });\n });\n\n /**\n * Formats the \"dateToFormat\" date value with the yyyy-MM-dd format and sets it as \"formatTextInputDisplayValue\" value\n * @param {DATE} dateToFormat - Date to be assigned and formatted\n */\n const formatTextInputDisplayValue = (dateToFormat: Date = datePickerValue.value) => {\n // If date is incorrect, leave the textInputValue intact\n if (isDateIncorrect.value) {\n return;\n }\n\n textInputValue.value = dateToFormat\n ? format(dateToFormat, DateFormat.NUMERIC_DATE_YEAR_FIRST, {\n locale: locales[locale.value.substring(0, 2)] || enUS,\n })\n : null;\n };\n\n return {\n // Values\n dateDisplayValue,\n textInputValue,\n\n // Methods\n formatTextInputDisplayValue,\n };\n};\n","export { CalendarFirstDayOfWeek as BentoDatePickerFirstDayOfWeek } from '@/internal';\nexport type {\n CalendarIsDateDisabled as BentoDatePickerIsDateDisabled,\n CalendarSingleDateValue as BentoDatePickerValue,\n} from '@/internal';\n\nexport enum BentoDatePickerEvent {\n INPUT = 'input',\n}\n","<!-- TODO: Remove aria props as these are part of JSX elements /vue/types/jsx.d.ts -->\n<!-- eslint-disable vue/attribute-hyphenation -->\n<template>\n <div\n v-bento-click-outside-directive=\"closeDatePicker\"\n class=\"b-date-picker\"\n @keydown.space.capture=\"onSpaceBarOrEnter\"\n @keydown.enter.capture=\"onSpaceBarOrEnter\"\n >\n <!-- Label -->\n <field-label\n v-if=\"label\"\n :id=\"labelId\"\n :label=\"label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n />\n\n <!-- Input -->\n <div>\n <dropdown-input-default\n ref=\"inputContainerRef\"\n :ariaControls=\"datePickerContainerId\"\n :ariaExpanded=\"isDatePickerOpen\"\n :aria-labelledby=\"label ? labelId : null\"\n :aria-describedby=\"ariaDescribedBy\"\n :disabled=\"disabled\"\n dynamic-filtering\n :is-invalid=\"!!errorMessage || !!dateErrorText\"\n :open=\"isDatePickerOpen\"\n :value=\"textInputValue\"\n :display-value=\"dateDisplayValue\"\n :debounce-time=\"0\"\n :readonly=\"isReadOnly\"\n @input=\"onDateInputChange\"\n @open=\"openDatePicker\"\n @keydown=\"onDateKeyDown\"\n @clear=\"clearDatePickerValue\"\n @close=\"closeDatePicker\"\n />\n </div>\n\n <!-- Error Messages -->\n <error-message\n v-if=\"dateErrorText\"\n :id=\"dateErrorId\"\n :error-message=\"dateErrorText\"\n class=\"b-date-picker__error-message\"\n />\n <error-message\n v-if=\"errorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-date-picker__error-message\"\n />\n\n <!-- Description -->\n <bento-typography\n v-if=\"description\"\n class=\"b-date-picker__description\"\n :class=\"descriptionConditionalClasses\"\n el=\"span\"\n >\n {{ description }}\n </bento-typography>\n\n <!-- Calendar container -->\n <bento-popover\n v-if=\"inputContainerRef\"\n :id=\"datePickerContainerId\"\n class=\"b-date-picker__container\"\n role=\"dialog\"\n :open=\"isDatePickerOpen\"\n :target-element=\"inputContainerRef\"\n :disable-focus-trap=\"true\"\n :aria-label=\"popoverAriaLabel\"\n :aria-modal=\"true\"\n position=\"bottom-start\"\n fit-content\n >\n <calendar\n ref=\"calendarContainerRef\"\n :first-day-of-week=\"firstDayOfWeek\"\n :is-date-disabled=\"isDateDisabled\"\n :number-of-months=\"1\"\n :value=\"value\"\n :min=\"min\"\n :max=\"max\"\n @input=\"onDateSelected\"\n />\n </bento-popover>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, nextTick, PropType, Ref, ref, toRef, watch } from 'vue';\n\n // Components\n import { BentoPopover } from '@/components/popover';\n import { BentoTypography } from '../typography';\n import { Calendar, ErrorMessage, FieldLabel } from '@/internal';\n import { DropdownInputDefault } from '@/components/dropdown/components';\n\n // Utils\n import { debounce } from '@/utils/ts/debounce';\n import { formatDateInputValue, validateDateInput } from '@/utils/ts/date-input';\n import { generateUid } from '@/utils/ts/unique-id';\n import { useI18n } from '@/utils/ts/i18n';\n\n // Composables\n import { useDatePickerSingleCalendarText } from './composables/use-date-picker-single-calendar-text';\n import { useFormLayoutFieldLoading } from '@/composables';\n\n // Directive\n import { BentoClickOutsideDirective } from '@/directives';\n\n // Types\n import { BentoDatePickerEvent, BentoDatePickerValue } from './date-picker.types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n const DEBOUNCE_TIME = 1000;\n\n /**\n * Date picker selector.\n *\n * @example\n * import { BentoDatePicker } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDatePicker },\n * template: `\n * <bento-date-picker\n * label=\"Label\"\n * description=\"Supporting text\"\n * required\n * optional\n * disabled\n * @input=\"onDateChanged\"\n * v-model=\"selectedDate\"\n * />\n * `,\n * setup() {\n * const selectedDate = ref(new Date()); // reactive({ startDate: new Date(), endDate: new Date() })\n * return {\n * selectedDate,\n * }\n * }\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-date-picker',\n components: {\n BentoTypography,\n BentoPopover,\n Calendar,\n ErrorMessage,\n DropdownInputDefault,\n FieldLabel,\n },\n directives: { BentoClickOutsideDirective },\n props: {\n /**\n * Descriptive supporting text visbile underneath the dropdown.\n */\n description: { type: String, default: undefined },\n\n /**\n * Disables dropdown functionality.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Displays component in an error state with an error message\n */\n errorMessage: { type: String, default: null },\n\n /**\n * Allows you to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday\n */\n firstDayOfWeek: Calendar.props.firstDayOfWeek,\n\n /**\n * Indicate if a date should be disabled or not\n */\n isDateDisabled: Calendar.props.isDateDisabled,\n\n /**\n * Sets a minimum limit for selectable dates - dates before `min` will not be selectable\n */\n min: Calendar.props.min,\n\n /**\n * Sets a maximum limit for selectable dates - dates after `max` will not be selectable\n */\n max: Calendar.props.max,\n\n /**\n * Text that is displayed as a label above the element.\n */\n label: { type: String, default: undefined },\n\n /**\n * Highlights the dropdown is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * The Boolean readonly property, when present, makes the element not mutable, meaning the user can not edit the date picker.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Highlights the dropdown is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Adds a info icon next to the label to display the passed tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * Selected date\n */\n value: { type: [Date, Object] as PropType<BentoDatePickerValue>, default: null },\n },\n emits: [BentoDatePickerEvent.INPUT],\n setup(props, { emit }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const datePickerContainerId = generateUid('bento-date-picker-container');\n const labelId = generateUid('bento-date-picker-label');\n const descriptionId = generateUid('bento-date-picker-description');\n const errorId = generateUid('bento-date-picker-error');\n const dateErrorId = generateUid('bento-date-picker-date-error');\n const popoverAriaLabel = computed(() => props.label || t('datePicker', { name: datePickerContainerId }));\n\n // Refs\n const calendarContainerRef = ref(null);\n const inputContainerRef = ref(null);\n\n // Values\n const isDateIncorrect = ref(false);\n const isDatePickerOpen = ref(false);\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n watch(\n () => props.disabled,\n disabled => {\n // Close date picker popover if it's opened when it's disabled\n if (disabled && isDatePickerOpen.value) {\n isDatePickerOpen.value = false;\n }\n }\n );\n\n const { dateDisplayValue, textInputValue, formatTextInputDisplayValue } = useDatePickerSingleCalendarText({\n datePickerValue: toRef(props, 'value') as Ref<Date>,\n isDateIncorrect,\n });\n\n const dateErrorText = computed(() => {\n if (\n props.isDateDisabled &&\n props.isDateDisabled(new Date(textInputValue.value)) &&\n !isDatePickerOpen.value\n ) {\n return t('selectedDateIsNotAvailable');\n }\n\n return isDateIncorrect.value ? t('provideDateInAFormat') : null;\n });\n\n const descriptionConditionalClasses = computed(() => ({\n 'b-date-picker__description--error': props.errorMessage || dateErrorText.value,\n }));\n\n const ariaDescribedBy = computed(\n () =>\n `${props.description ? descriptionId : ''} ${props.errorMessage ? errorId : ''} ${\n dateErrorText.value ? dateErrorId : ''\n }`.trim() || null\n );\n\n const isDateEnabled = (date: Date) => {\n // Check if date is between min/max bounds, if there are any\n if ((props.min && date <= props.min) || (props.max && date >= props.max)) {\n return false;\n }\n\n // Check if function is set, otherwise all dates are enabled\n if (props.isDateDisabled) {\n return !props.isDateDisabled(date);\n }\n\n return true;\n };\n\n const closeDatePicker = () => {\n isDatePickerOpen.value = false;\n };\n\n const openDatePicker = () => {\n isDatePickerOpen.value = true;\n\n formatTextInputDisplayValue();\n };\n\n const onDateSelected = (selectedDate: Date) => {\n // Reset the error state when a valid date is selected\n isDateIncorrect.value = false;\n\n closeDatePicker();\n emit(BentoDatePickerEvent.INPUT, selectedDate);\n };\n\n const clearDatePickerValue = async () => {\n if (isDateIncorrect.value) {\n isDateIncorrect.value = false;\n textInputValue.value = null;\n }\n emit(BentoDatePickerEvent.INPUT, null);\n };\n\n const onDateKeyDown = (event: KeyboardEvent) => {\n validateDateInput(event);\n };\n\n const validateDate = (stringDate: string) => {\n // Validate only if the date is complete\n if (stringDate.length < 10) {\n return;\n }\n\n // Checks for YYYY-MM-DD format\n const dateRegex = /^\\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/;\n const isValidDate = dateRegex.test(stringDate) && isDateEnabled(new Date(stringDate));\n if (isValidDate) {\n isDateIncorrect.value = false;\n emit(BentoDatePickerEvent.INPUT, new Date(stringDate));\n } else if (stringDate) {\n // Only set to true if the value exists (not null/undefined)\n isDateIncorrect.value = true;\n emit(BentoDatePickerEvent.INPUT, null);\n }\n };\n\n const validateDateDebounced = debounce(validateDate, DEBOUNCE_TIME);\n\n const onDateInputChange = (stringDate: string) => {\n textInputValue.value = formatDateInputValue(stringDate);\n // If we are closing the date picker, we should validate (and emit date inputs) immediately so the user doesn't have to wait for the debounce time.\n if (isDatePickerOpen.value) {\n validateDateDebounced(textInputValue.value);\n } else {\n validateDate(textInputValue.value);\n }\n };\n\n /**\n * Space bar and Enter keyDown event handler.\n *\n * * Opens the date picker dialog on the first keydown.\n * * Move focus to selected date, i.e., the date displayed in the date input text field. If no date has been selected, places focus on the current date.\n * @param {KeyboardEvent} event Event being triggered\n */\n const onSpaceBarOrEnter = async (event: KeyboardEvent) => {\n if (isDatePickerOpen.value) {\n return;\n }\n event.preventDefault();\n\n openDatePicker();\n\n // Wait for the date picker dialog to open\n await nextTick();\n\n // Set current date (today) if no date is selected\n if (!props.value) {\n // Format the opened date picker date to YYYY-MM-DD\n formatTextInputDisplayValue(new Date());\n emit(BentoDatePickerEvent.INPUT, new Date());\n\n // Wait for new value to be set with the emit\n await nextTick();\n }\n\n // Focus on date\n calendarContainerRef.value?.$refs.calendarRef[0].focusOnDate(props.value);\n };\n\n return {\n // Refs\n inputContainerRef,\n calendarContainerRef,\n\n // Values,\n dateDisplayValue,\n datePickerContainerId,\n descriptionConditionalClasses,\n isDateIncorrect,\n isDatePickerOpen,\n isReadOnly,\n dateErrorText,\n labelId,\n descriptionId,\n errorId,\n dateErrorId,\n popoverAriaLabel,\n ariaDescribedBy,\n textInputValue,\n\n // Events\n closeDatePicker,\n clearDatePickerValue,\n onDateSelected,\n openDatePicker,\n onDateKeyDown,\n onDateInputChange,\n\n // Keyboard navigation\n onSpaceBarOrEnter,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./date-picker.scss\" />\n"],"names":["useDatePickerSingleCalendarText","datePickerValue","isDateIncorrect","locale","t","useI18n","locales","de","enUS","fr","textInputValue","ref","_a","computed","format","DateFormat","dateToFormat","BentoDatePickerEvent","BentoDatePickerEvent2","DEBOUNCE_TIME","_sfc_main","defineComponent","messages","BentoTypography","BentoPopover","Calendar","ErrorMessage","DropdownInputDefault","FieldLabel","BentoClickOutsideDirective","props","emit","datePickerContainerId","generateUid","labelId","descriptionId","errorId","dateErrorId","popoverAriaLabel","calendarContainerRef","inputContainerRef","isDatePickerOpen","isReadOnly","useFormLayoutFieldLoading","toRef","watch","disabled","dateDisplayValue","formatTextInputDisplayValue","dateErrorText","descriptionConditionalClasses","ariaDescribedBy","isDateEnabled","date","closeDatePicker","openDatePicker","onDateSelected","selectedDate","clearDatePickerValue","onDateKeyDown","event","validateDateInput","validateDate","stringDate","validateDateDebounced","debounce","formatDateInputValue","nextTick"],"mappings":";;;;;;;;;;;;;;;;;;AAYO,MAAAA,KAAA,CAAA,EAAA,iBAAAC,GAAA,iBAAAC,EAAA,MAAA;;AACH,QAAA,EAAA,QAAAC,GAAA,GAAAC,EAAA,IAAAC,EAAA,GACAC,IAAA,EAAA,IAAAC,GAAA,MAAAC,GAAA,IAAAC,EAAA,GAEAC,IAAAC,GAAAC,IAAAX,EAAA,UAAA,gBAAAW,EAAA,cAAA;AAoCA,SAAA;AAAA;AAAA,IAAO,kBAlCPC,EAAA,MAEIX,EAAA,QACIQ,EAAA,QAIJT,EAAA,QAKAa,EAAAb,EAAA,OAAAc,EAAA,WAAA;AAAA,MAAmE,QAAAT,EAAAH,EAAA,MAAA,UAAA,GAAA,CAAA,CAAA,KAAAK;AAAA,IACd,CAAA,IALjDJ,EAAA,YAAA,CAMH;AAAA,IAsBD,gBAAAM;AAAA;AAAA,IACA,6BAhBJ,CAAAM,IAAAf,EAAA,UAAA;AAEI,MAAAC,EAAA,UAIAQ,EAAA,QAAAM,IAAAF,EAAAE,GAAAD,EAAA,yBAAA;AAAA,QAC+D,QAAAT,EAAAH,EAAA,MAAA,UAAA,GAAA,CAAA,CAAA,KAAAK;AAAA,MACJ,CAAA,IAAA;AAAA,IAErD;AAAA,EASN;AAER;ACtDY,IAAAS,IAAA,kBAAAC,OACRA,EAAA,QAAA,SADQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;GCqHZE,KAAA,KA6BAC,KAAAC,EAAA;AAAA,EAAA,MAAA,EAAA,UAAAC,GAAA;AAAA,EACA,MAA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AAA,KAAA;AAAA,MACA;AAAA;AAAA,MA8DA,mBApDA,OAAAkD,MAAA;;AACA,QAAAnB,EAAA,UAGAmB,EAAA,eAAA,GAEAL,EAAA,GAGA,MAAAY,EAAA,GAGArC,EAAA,UAEAkB,EAAA,oBAAA,KAAA,CAAA,GACAjB,EAAAd,EAAA,OAAA,oBAAA,KAAA,CAAA,GAGA,MAAAkD,EAAA,KAIAvD,IAAA2B,EAAA,UAAA,QAAA3B,EAAA,MAAA,YAAA,GAAA,YAAAkB,EAAA;AAAA,MAAA;AAAA,IAiCA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"date-picker.js","sources":["../src/components/date-picker/composables/use-date-picker-single-calendar-text.ts","../src/components/date-picker/date-picker.types.ts","../src/components/date-picker/date-picker.vue"],"sourcesContent":["import { computed, ref } from 'vue';\nimport { de, enUS, fr } from 'date-fns/locale';\nimport { useI18n } from '@/utils/ts/i18n';\nimport { UseDateDisplayText } from './use-date-picker-single-calendar-text.types';\nimport { DateFormat } from '@/types';\nimport format from 'date-fns/format';\n\n/**\n * Composable that sets and formats the date to be displayed in the input box of a Single Date Picker\n * @param {Ref<Date>} option.datePickerValue Ref to the datePickerValue set in the DatePicker component\n * @param {Ref<boolean>} option.isDateIncorrect Indicates if the date is correct or not\n */\nexport const useDatePickerSingleCalendarText: UseDateDisplayText<Date> = ({ datePickerValue, isDateIncorrect }) => {\n const { locale, t } = useI18n();\n const locales = { de, enUS, fr };\n\n const textInputValue = ref(datePickerValue.value?.toDateString());\n\n const dateDisplayValue = computed(() => {\n // Display incorrect date when there's an error with the input\n if (isDateIncorrect.value) {\n return textInputValue.value;\n }\n\n // Display \"Select a date\" when there's no date selected or input\n if (!datePickerValue.value) {\n return t('selectDate') as string;\n }\n\n // Display the date in format \"dd MMM, yyyy (25 Jun, 2023)\" if there's a valid date selected\n return format(datePickerValue.value as Date, DateFormat.FULL_DATE, {\n locale: locales[locale.value.substring(0, 2)] || enUS,\n });\n });\n\n /**\n * Formats the \"dateToFormat\" date value with the yyyy-MM-dd format and sets it as \"formatTextInputDisplayValue\" value\n * @param {DATE} dateToFormat - Date to be assigned and formatted\n */\n const formatTextInputDisplayValue = (dateToFormat: Date = datePickerValue.value) => {\n // If date is incorrect, leave the textInputValue intact\n if (isDateIncorrect.value) {\n return;\n }\n\n textInputValue.value = dateToFormat\n ? format(dateToFormat, DateFormat.NUMERIC_DATE_YEAR_FIRST, {\n locale: locales[locale.value.substring(0, 2)] || enUS,\n })\n : null;\n };\n\n return {\n // Values\n dateDisplayValue,\n textInputValue,\n\n // Methods\n formatTextInputDisplayValue,\n };\n};\n","export { CalendarFirstDayOfWeek as BentoDatePickerFirstDayOfWeek } from '@/internal';\nexport type {\n CalendarIsDateDisabled as BentoDatePickerIsDateDisabled,\n CalendarSingleDateValue as BentoDatePickerValue,\n} from '@/internal';\n\nexport enum BentoDatePickerEvent {\n INPUT = 'input',\n}\n","<!-- TODO: Remove aria props as these are part of JSX elements /vue/types/jsx.d.ts -->\n<!-- eslint-disable vue/attribute-hyphenation -->\n<template>\n <div\n v-bento-click-outside-directive=\"closeDatePicker\"\n class=\"b-date-picker\"\n @keydown.space.capture=\"onSpaceBarOrEnter\"\n @keydown.enter.capture=\"onSpaceBarOrEnter\"\n >\n <!-- Label -->\n <field-label\n v-if=\"label\"\n :id=\"labelId\"\n :label=\"label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n />\n\n <!-- Input -->\n <div>\n <dropdown-input-default\n ref=\"inputContainerRef\"\n always-combobox-is-input\n :ariaControls=\"datePickerContainerId\"\n :ariaExpanded=\"isDatePickerOpen\"\n :aria-labelledby=\"label ? labelId : null\"\n :aria-describedby=\"ariaDescribedBy\"\n :disabled=\"disabled\"\n dynamic-filtering\n :is-invalid=\"!!errorMessage || !!dateErrorText\"\n :open=\"isDatePickerOpen\"\n :value=\"textInputValue\"\n :display-value=\"dateDisplayValue\"\n :debounce-time=\"0\"\n :readonly=\"isReadOnly\"\n @input=\"onDateInputChange\"\n @open=\"openDatePicker\"\n @keydown=\"onDateKeyDown\"\n @clear=\"clearDatePickerValue\"\n @close=\"closeDatePicker\"\n />\n </div>\n\n <!-- Error Messages -->\n <error-message\n v-if=\"dateErrorText\"\n :id=\"dateErrorId\"\n :error-message=\"dateErrorText\"\n class=\"b-date-picker__error-message\"\n />\n <error-message\n v-if=\"errorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-date-picker__error-message\"\n />\n\n <!-- Description -->\n <bento-typography\n v-if=\"description\"\n class=\"b-date-picker__description\"\n :class=\"descriptionConditionalClasses\"\n el=\"span\"\n >\n {{ description }}\n </bento-typography>\n\n <!-- Calendar container -->\n <bento-popover\n v-if=\"inputContainerRef\"\n :id=\"datePickerContainerId\"\n class=\"b-date-picker__container\"\n role=\"dialog\"\n :open=\"isDatePickerOpen\"\n :target-element=\"inputContainerRef\"\n :disable-focus-trap=\"true\"\n :aria-label=\"popoverAriaLabel\"\n :aria-modal=\"true\"\n position=\"bottom-start\"\n fit-content\n >\n <calendar\n ref=\"calendarContainerRef\"\n :first-day-of-week=\"firstDayOfWeek\"\n :is-date-disabled=\"isDateDisabled\"\n :number-of-months=\"1\"\n :value=\"value\"\n :min=\"min\"\n :max=\"max\"\n @input=\"onDateSelected\"\n />\n </bento-popover>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, nextTick, PropType, Ref, ref, toRef, watch } from 'vue';\n\n // Components\n import { BentoPopover } from '@/components/popover';\n import { BentoTypography } from '../typography';\n import { Calendar, ErrorMessage, FieldLabel } from '@/internal';\n import { DropdownInputDefault } from '@/components/dropdown/components';\n\n // Utils\n import { debounce } from '@/utils/ts/debounce';\n import { formatDateInputValue, validateDateInput } from '@/utils/ts/date-input';\n import { generateUid } from '@/utils/ts/unique-id';\n import { useI18n } from '@/utils/ts/i18n';\n\n // Composables\n import { useDatePickerSingleCalendarText } from './composables/use-date-picker-single-calendar-text';\n import { useFormLayoutFieldLoading } from '@/composables';\n\n // Directive\n import { BentoClickOutsideDirective } from '@/directives';\n\n // Types\n import { BentoDatePickerEvent, BentoDatePickerValue } from './date-picker.types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n const DEBOUNCE_TIME = 1000;\n\n /**\n * Date picker selector.\n *\n * @example\n * import { BentoDatePicker } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDatePicker },\n * template: `\n * <bento-date-picker\n * label=\"Label\"\n * description=\"Supporting text\"\n * required\n * optional\n * disabled\n * @input=\"onDateChanged\"\n * v-model=\"selectedDate\"\n * />\n * `,\n * setup() {\n * const selectedDate = ref(new Date()); // reactive({ startDate: new Date(), endDate: new Date() })\n * return {\n * selectedDate,\n * }\n * }\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-date-picker',\n components: {\n BentoTypography,\n BentoPopover,\n Calendar,\n ErrorMessage,\n DropdownInputDefault,\n FieldLabel,\n },\n directives: { BentoClickOutsideDirective },\n props: {\n /**\n * Descriptive supporting text visbile underneath the dropdown.\n */\n description: { type: String, default: undefined },\n\n /**\n * Disables dropdown functionality.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Displays component in an error state with an error message\n */\n errorMessage: { type: String, default: null },\n\n /**\n * Allows you to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday\n */\n firstDayOfWeek: Calendar.props.firstDayOfWeek,\n\n /**\n * Indicate if a date should be disabled or not\n */\n isDateDisabled: Calendar.props.isDateDisabled,\n\n /**\n * Sets a minimum limit for selectable dates - dates before `min` will not be selectable\n */\n min: Calendar.props.min,\n\n /**\n * Sets a maximum limit for selectable dates - dates after `max` will not be selectable\n */\n max: Calendar.props.max,\n\n /**\n * Text that is displayed as a label above the element.\n */\n label: { type: String, default: undefined },\n\n /**\n * Highlights the dropdown is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * The Boolean readonly property, when present, makes the element not mutable, meaning the user can not edit the date picker.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Highlights the dropdown is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Adds a info icon next to the label to display the passed tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * Selected date\n */\n value: { type: [Date, Object] as PropType<BentoDatePickerValue>, default: null },\n },\n emits: [BentoDatePickerEvent.INPUT],\n setup(props, { emit }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const datePickerContainerId = generateUid('bento-date-picker-container');\n const labelId = generateUid('bento-date-picker-label');\n const descriptionId = generateUid('bento-date-picker-description');\n const errorId = generateUid('bento-date-picker-error');\n const dateErrorId = generateUid('bento-date-picker-date-error');\n const popoverAriaLabel = computed(() => props.label || t('datePicker', { name: datePickerContainerId }));\n\n // Refs\n const calendarContainerRef = ref(null);\n const inputContainerRef = ref(null);\n\n // Values\n const isDateIncorrect = ref(false);\n const isDatePickerOpen = ref(false);\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n watch(\n () => props.disabled,\n disabled => {\n // Close date picker popover if it's opened when it's disabled\n if (disabled && isDatePickerOpen.value) {\n isDatePickerOpen.value = false;\n }\n }\n );\n\n const { dateDisplayValue, textInputValue, formatTextInputDisplayValue } = useDatePickerSingleCalendarText({\n datePickerValue: toRef(props, 'value') as Ref<Date>,\n isDateIncorrect,\n });\n\n const dateErrorText = computed(() => {\n if (\n props.isDateDisabled &&\n props.isDateDisabled(new Date(textInputValue.value)) &&\n !isDatePickerOpen.value\n ) {\n return t('selectedDateIsNotAvailable');\n }\n\n return isDateIncorrect.value ? t('provideDateInAFormat') : null;\n });\n\n const descriptionConditionalClasses = computed(() => ({\n 'b-date-picker__description--error': props.errorMessage || dateErrorText.value,\n }));\n\n const ariaDescribedBy = computed(\n () =>\n `${props.description ? descriptionId : ''} ${props.errorMessage ? errorId : ''} ${\n dateErrorText.value ? dateErrorId : ''\n }`.trim() || null\n );\n\n const isDateEnabled = (date: Date) => {\n // Check if date is between min/max bounds, if there are any\n if ((props.min && date <= props.min) || (props.max && date >= props.max)) {\n return false;\n }\n\n // Check if function is set, otherwise all dates are enabled\n if (props.isDateDisabled) {\n return !props.isDateDisabled(date);\n }\n\n return true;\n };\n\n const closeDatePicker = () => {\n isDatePickerOpen.value = false;\n };\n\n const openDatePicker = () => {\n isDatePickerOpen.value = true;\n\n formatTextInputDisplayValue();\n };\n\n const onDateSelected = (selectedDate: Date) => {\n // Reset the error state when a valid date is selected\n isDateIncorrect.value = false;\n\n closeDatePicker();\n emit(BentoDatePickerEvent.INPUT, selectedDate);\n };\n\n const clearDatePickerValue = async () => {\n if (isDateIncorrect.value) {\n isDateIncorrect.value = false;\n textInputValue.value = null;\n }\n emit(BentoDatePickerEvent.INPUT, null);\n };\n\n const onDateKeyDown = (event: KeyboardEvent) => {\n validateDateInput(event);\n };\n\n const validateDate = (stringDate: string) => {\n // Validate only if the date is complete\n if (stringDate.length < 10) {\n return;\n }\n\n // Checks for YYYY-MM-DD format\n const dateRegex = /^\\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/;\n const isValidDate = dateRegex.test(stringDate) && isDateEnabled(new Date(stringDate));\n if (isValidDate) {\n isDateIncorrect.value = false;\n emit(BentoDatePickerEvent.INPUT, new Date(stringDate));\n } else if (stringDate) {\n // Only set to true if the value exists (not null/undefined)\n isDateIncorrect.value = true;\n emit(BentoDatePickerEvent.INPUT, null);\n }\n };\n\n const validateDateDebounced = debounce(validateDate, DEBOUNCE_TIME);\n\n const onDateInputChange = (stringDate: string) => {\n textInputValue.value = formatDateInputValue(stringDate);\n // If we are closing the date picker, we should validate (and emit date inputs) immediately so the user doesn't have to wait for the debounce time.\n if (isDatePickerOpen.value) {\n validateDateDebounced(textInputValue.value);\n } else {\n validateDate(textInputValue.value);\n }\n };\n\n /**\n * Space bar and Enter keyDown event handler.\n *\n * * Opens the date picker dialog on the first keydown.\n * * Move focus to selected date, i.e., the date displayed in the date input text field. If no date has been selected, places focus on the current date.\n * @param {KeyboardEvent} event Event being triggered\n */\n const onSpaceBarOrEnter = async (event: KeyboardEvent) => {\n if (isDatePickerOpen.value) {\n return;\n }\n event.preventDefault();\n\n openDatePicker();\n\n // Wait for the date picker dialog to open\n await nextTick();\n\n // Set current date (today) if no date is selected\n if (!props.value) {\n // Format the opened date picker date to YYYY-MM-DD\n formatTextInputDisplayValue(new Date());\n emit(BentoDatePickerEvent.INPUT, new Date());\n\n // Wait for new value to be set with the emit\n await nextTick();\n }\n\n // Focus on date\n calendarContainerRef.value?.$refs.calendarRef[0].focusOnDate(props.value);\n };\n\n return {\n // Refs\n inputContainerRef,\n calendarContainerRef,\n\n // Values,\n dateDisplayValue,\n datePickerContainerId,\n descriptionConditionalClasses,\n isDateIncorrect,\n isDatePickerOpen,\n isReadOnly,\n dateErrorText,\n labelId,\n descriptionId,\n errorId,\n dateErrorId,\n popoverAriaLabel,\n ariaDescribedBy,\n textInputValue,\n\n // Events\n closeDatePicker,\n clearDatePickerValue,\n onDateSelected,\n openDatePicker,\n onDateKeyDown,\n onDateInputChange,\n\n // Keyboard navigation\n onSpaceBarOrEnter,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./date-picker.scss\" />\n"],"names":["useDatePickerSingleCalendarText","datePickerValue","isDateIncorrect","locale","t","useI18n","locales","de","enUS","fr","textInputValue","ref","_a","computed","format","DateFormat","dateToFormat","BentoDatePickerEvent","BentoDatePickerEvent2","DEBOUNCE_TIME","_sfc_main","defineComponent","messages","BentoTypography","BentoPopover","Calendar","ErrorMessage","DropdownInputDefault","FieldLabel","BentoClickOutsideDirective","props","emit","datePickerContainerId","generateUid","labelId","descriptionId","errorId","dateErrorId","popoverAriaLabel","calendarContainerRef","inputContainerRef","isDatePickerOpen","isReadOnly","useFormLayoutFieldLoading","toRef","watch","disabled","dateDisplayValue","formatTextInputDisplayValue","dateErrorText","descriptionConditionalClasses","ariaDescribedBy","isDateEnabled","date","closeDatePicker","openDatePicker","onDateSelected","selectedDate","clearDatePickerValue","onDateKeyDown","event","validateDateInput","validateDate","stringDate","validateDateDebounced","debounce","formatDateInputValue","nextTick"],"mappings":";;;;;;;;;;;;;;;;;;AAYO,MAAAA,KAAA,CAAA,EAAA,iBAAAC,GAAA,iBAAAC,EAAA,MAAA;;AACH,QAAA,EAAA,QAAAC,GAAA,GAAAC,EAAA,IAAAC,EAAA,GACAC,IAAA,EAAA,IAAAC,GAAA,MAAAC,GAAA,IAAAC,EAAA,GAEAC,IAAAC,GAAAC,IAAAX,EAAA,UAAA,gBAAAW,EAAA,cAAA;AAoCA,SAAA;AAAA;AAAA,IAAO,kBAlCPC,EAAA,MAEIX,EAAA,QACIQ,EAAA,QAIJT,EAAA,QAKAa,EAAAb,EAAA,OAAAc,EAAA,WAAA;AAAA,MAAmE,QAAAT,EAAAH,EAAA,MAAA,UAAA,GAAA,CAAA,CAAA,KAAAK;AAAA,IACd,CAAA,IALjDJ,EAAA,YAAA,CAMH;AAAA,IAsBD,gBAAAM;AAAA;AAAA,IACA,6BAhBJ,CAAAM,IAAAf,EAAA,UAAA;AAEI,MAAAC,EAAA,UAIAQ,EAAA,QAAAM,IAAAF,EAAAE,GAAAD,EAAA,yBAAA;AAAA,QAC+D,QAAAT,EAAAH,EAAA,MAAA,UAAA,GAAA,CAAA,CAAA,KAAAK;AAAA,MACJ,CAAA,IAAA;AAAA,IAErD;AAAA,EASN;AAER;ACtDY,IAAAS,IAAA,kBAAAC,OACRA,EAAA,QAAA,SADQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;GCsHZE,KAAA,KA6BAC,KAAAC,EAAA;AAAA,EAAA,MAAA,EAAA,UAAAC,GAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,YAAAC;AAAA,EACA;AAAA,EACA,YAAA,EAAA,4BAAAC,GAAA;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AAA,GACAjB,EAAAd,EAAA,OAAA,oBAAA,KAAA,CAAA,GAGA,MAAAkD,EAAA,KAIAvD,IAAA2B,EAAA,UAAA,QAAA3B,EAAA,MAAA,YAAA,GAAA,YAAAkB,EAAA;AAAA,MAAA;AAAA,IAiCA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as t, a as r } from "./chunks/index.
|
|
2
|
-
import { b as o } from "./chunks/calendar.
|
|
1
|
+
import { B as t, a as r } from "./chunks/index.339f15c4.js";
|
|
2
|
+
import { b as o } from "./chunks/calendar.17ab99de.js";
|
|
3
3
|
export {
|
|
4
4
|
t as BentoDateRangePicker,
|
|
5
5
|
r as BentoDateRangePickerEvent,
|
package/dist/date.js
CHANGED
package/dist/divider.js
CHANGED
package/dist/dropdown.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { B as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { B as p } from "./chunks/dropdown.4d800c61.js";
|
|
2
|
+
import { a as _t } from "./chunks/dropdown.4d800c61.js";
|
|
3
|
+
import { b as dt, a as ct } from "./chunks/listbox.e5d70b9b.js";
|
|
4
|
+
import { defineComponent as a, computed as l, toRefs as m } from "vue";
|
|
5
|
+
import { B as y, L as i } from "./chunks/listbox-option-tag.6f3e922c.js";
|
|
4
6
|
import { n as d } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
|
|
5
|
-
import {
|
|
6
|
-
import { u as
|
|
7
|
-
import { B as
|
|
8
|
-
import { BentoPaymentMethod as
|
|
9
|
-
import "./assets/
|
|
10
|
-
const
|
|
11
|
-
name: "bento-dropdown-avatar"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
BentoAvatar: f
|
|
15
|
-
},
|
|
7
|
+
import { d as v, B as w } from "./chunks/index.6ac01113.js";
|
|
8
|
+
import { u as b } from "./chunks/use-country-items.6b7985bf.js";
|
|
9
|
+
import { B as c } from "./chunks/country.types.002caff2.js";
|
|
10
|
+
import { BentoPaymentMethod as B } from "./payment-method.js";
|
|
11
|
+
import "./assets/index3.css";
|
|
12
|
+
const $ = a({
|
|
13
|
+
name: "bento-dropdown-avatar"
|
|
14
|
+
}), I = /* @__PURE__ */ a({
|
|
15
|
+
...$,
|
|
16
16
|
props: {
|
|
17
|
-
...
|
|
17
|
+
...p.props,
|
|
18
18
|
/**
|
|
19
19
|
* The option elements to populate the avatar dropdown with.
|
|
20
20
|
* It must be an array of {@see BentoAvatarListboxOptions }
|
|
@@ -28,41 +28,32 @@ const I = u({
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
emits: ["input"],
|
|
31
|
-
setup(
|
|
32
|
-
const n = (e) => t("input", e);
|
|
33
|
-
return {
|
|
34
|
-
// Values
|
|
35
|
-
dropdownItems: l(
|
|
36
|
-
() => r.items.map(({ value: e, label: a, src: p }) => ({ value: e, label: a, data: p }))
|
|
37
|
-
),
|
|
38
|
-
// Methods
|
|
39
|
-
onInput: n
|
|
40
|
-
};
|
|
31
|
+
setup(s, { emit: t }) {
|
|
32
|
+
const o = s, n = (e) => t("input", e), r = l(() => o.items.map(({ value: e, label: u, src: _ }) => ({ value: e, label: u, data: _ })));
|
|
33
|
+
return { __sfc: !0, props: o, emit: t, onInput: n, dropdownItems: r, BentoAvatar: y, BentoDropdown: p };
|
|
41
34
|
}
|
|
42
35
|
});
|
|
43
|
-
var
|
|
44
|
-
var t = this, n = t._self.
|
|
45
|
-
return
|
|
46
|
-
return [n
|
|
36
|
+
var x = function() {
|
|
37
|
+
var t = this, o = t._self._c, n = t._self._setupProxy;
|
|
38
|
+
return o("div", [o(n.BentoDropdown, t._b({ attrs: { items: n.dropdownItems }, on: { input: n.onInput }, scopedSlots: t._u([{ key: "default", fn: function({ label: r, data: e }) {
|
|
39
|
+
return [o(n.BentoAvatar, { attrs: { username: r, src: e } })];
|
|
47
40
|
} }]) }, "bento-dropdown", t.$props, !1))], 1);
|
|
48
|
-
},
|
|
41
|
+
}, D = [], h = /* @__PURE__ */ d(
|
|
49
42
|
I,
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
x,
|
|
44
|
+
D,
|
|
52
45
|
!1,
|
|
53
46
|
null,
|
|
54
47
|
null,
|
|
55
48
|
null,
|
|
56
49
|
null
|
|
57
50
|
);
|
|
58
|
-
const
|
|
59
|
-
name: "b-dropdown-country"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
BentoTypography: y
|
|
63
|
-
},
|
|
51
|
+
const tt = h.exports, g = a({
|
|
52
|
+
name: "b-dropdown-country"
|
|
53
|
+
}), C = /* @__PURE__ */ a({
|
|
54
|
+
...g,
|
|
64
55
|
props: {
|
|
65
|
-
...
|
|
56
|
+
...p.props,
|
|
66
57
|
/**
|
|
67
58
|
* The option elements to populate the country dropdown with.
|
|
68
59
|
* It must be an array of {@see BentoCountryListboxOptions }
|
|
@@ -79,48 +70,41 @@ const N = g.exports, h = u({
|
|
|
79
70
|
*/
|
|
80
71
|
variant: {
|
|
81
72
|
type: String,
|
|
82
|
-
default:
|
|
83
|
-
validator: (
|
|
73
|
+
default: c.CUSTOM,
|
|
74
|
+
validator: (s) => Object.values(c).includes(s)
|
|
84
75
|
}
|
|
85
76
|
},
|
|
86
77
|
emits: ["input"],
|
|
87
|
-
setup(
|
|
88
|
-
const
|
|
89
|
-
return (
|
|
78
|
+
setup(s, { emit: t }) {
|
|
79
|
+
const o = s, n = (_) => t("input", _), { variant: r, items: e } = m(o), u = b(r, e);
|
|
80
|
+
return (r.value === "custom" || e.value.some((_) => _.label)) && v(
|
|
90
81
|
'BentoDropdownCountry "custom" variant and "items" prop "label" key',
|
|
91
82
|
"Use any of the other BentoDropdownCountry variants instead OR use BentoDropdown component for custom labels",
|
|
92
83
|
"2.0.0"
|
|
93
|
-
), {
|
|
94
|
-
// Values
|
|
95
|
-
countryItems: a,
|
|
96
|
-
// Methods
|
|
97
|
-
onInput: e
|
|
98
|
-
};
|
|
84
|
+
), { __sfc: !0, props: o, emit: t, onInput: n, variant: r, items: e, countryItems: u, BentoTypography: w, BentoDropdown: p };
|
|
99
85
|
}
|
|
100
86
|
});
|
|
101
|
-
var
|
|
102
|
-
var t = this, n = t._self.
|
|
103
|
-
return
|
|
104
|
-
return [n
|
|
87
|
+
var T = function() {
|
|
88
|
+
var t = this, o = t._self._c, n = t._self._setupProxy;
|
|
89
|
+
return o("div", [o(n.BentoDropdown, t._b({ attrs: { items: n.countryItems }, on: { input: n.onInput }, scopedSlots: t._u([{ key: "default", fn: function({ label: r }) {
|
|
90
|
+
return [o(n.BentoTypography, { attrs: { el: "span" } }, [t._v(t._s(r))])];
|
|
105
91
|
} }]) }, "bento-dropdown", t.$props, !1))], 1);
|
|
106
|
-
},
|
|
107
|
-
h,
|
|
108
|
-
x,
|
|
92
|
+
}, A = [], P = /* @__PURE__ */ d(
|
|
109
93
|
C,
|
|
94
|
+
T,
|
|
95
|
+
A,
|
|
110
96
|
!1,
|
|
111
97
|
null,
|
|
112
98
|
null,
|
|
113
99
|
null,
|
|
114
100
|
null
|
|
115
101
|
);
|
|
116
|
-
const
|
|
117
|
-
name: "b-dropdown-currency"
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
ListboxOptionTag: c
|
|
121
|
-
},
|
|
102
|
+
const nt = P.exports, S = a({
|
|
103
|
+
name: "b-dropdown-currency"
|
|
104
|
+
}), R = /* @__PURE__ */ a({
|
|
105
|
+
...S,
|
|
122
106
|
props: {
|
|
123
|
-
...
|
|
107
|
+
...p.props,
|
|
124
108
|
/**
|
|
125
109
|
* The option elements to populate the country dropdown with.
|
|
126
110
|
* It must be an array of {@see BentoCurrencyListboxOptions }
|
|
@@ -133,36 +117,31 @@ const Q = D.exports, A = u({
|
|
|
133
117
|
}
|
|
134
118
|
},
|
|
135
119
|
emits: ["input"],
|
|
136
|
-
setup(
|
|
137
|
-
return {
|
|
138
|
-
// Methods
|
|
139
|
-
onInput: (o) => t("input", o)
|
|
140
|
-
};
|
|
120
|
+
setup(s, { emit: t }) {
|
|
121
|
+
return { __sfc: !0, emit: t, onInput: (n) => t("input", n), ListboxOptionTag: i, BentoDropdown: p };
|
|
141
122
|
}
|
|
142
123
|
});
|
|
143
|
-
var
|
|
144
|
-
var t = this, n = t._self.
|
|
145
|
-
return
|
|
146
|
-
return [n
|
|
124
|
+
var k = function() {
|
|
125
|
+
var t = this, o = t._self._c, n = t._self._setupProxy;
|
|
126
|
+
return o(n.BentoDropdown, t._b({ on: { input: n.onInput }, scopedSlots: t._u([{ key: "default", fn: function(r) {
|
|
127
|
+
return [o(n.ListboxOptionTag, { attrs: { option: r } })];
|
|
147
128
|
} }]) }, "bento-dropdown", t.$props, !1));
|
|
148
|
-
},
|
|
149
|
-
A,
|
|
150
|
-
P,
|
|
129
|
+
}, L = [], O = /* @__PURE__ */ d(
|
|
151
130
|
R,
|
|
131
|
+
k,
|
|
132
|
+
L,
|
|
152
133
|
!1,
|
|
153
134
|
null,
|
|
154
135
|
null,
|
|
155
136
|
null,
|
|
156
137
|
null
|
|
157
138
|
);
|
|
158
|
-
const
|
|
159
|
-
name: "bento-dropdown-payment-method"
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
BentoPaymentMethod: b
|
|
163
|
-
},
|
|
139
|
+
const ot = O.exports, F = a({
|
|
140
|
+
name: "bento-dropdown-payment-method"
|
|
141
|
+
}), M = /* @__PURE__ */ a({
|
|
142
|
+
...F,
|
|
164
143
|
props: {
|
|
165
|
-
...
|
|
144
|
+
...p.props,
|
|
166
145
|
/**
|
|
167
146
|
* The option elements to populate the payment method dropdown with.
|
|
168
147
|
* It must be an array of {@see BentoPaymentMethodListboxOptions }
|
|
@@ -175,36 +154,31 @@ const W = S.exports, k = u({
|
|
|
175
154
|
}
|
|
176
155
|
},
|
|
177
156
|
emits: ["input"],
|
|
178
|
-
setup(
|
|
179
|
-
return {
|
|
180
|
-
// Methods
|
|
181
|
-
onInput: (o) => t("input", o)
|
|
182
|
-
};
|
|
157
|
+
setup(s, { emit: t }) {
|
|
158
|
+
return { __sfc: !0, emit: t, onInput: (n) => t("input", n), BentoPaymentMethod: B, BentoDropdown: p };
|
|
183
159
|
}
|
|
184
160
|
});
|
|
185
|
-
var
|
|
186
|
-
var t = this, n = t._self.
|
|
187
|
-
return
|
|
188
|
-
return [n
|
|
161
|
+
var z = function() {
|
|
162
|
+
var t = this, o = t._self._c, n = t._self._setupProxy;
|
|
163
|
+
return o("div", [o(n.BentoDropdown, t._b({ on: { input: n.onInput }, scopedSlots: t._u([{ key: "default", fn: function({ value: r, label: e }) {
|
|
164
|
+
return [o(n.BentoPaymentMethod, { attrs: { type: r, label: e } })];
|
|
189
165
|
} }]) }, "bento-dropdown", t.$props, !1))], 1);
|
|
190
|
-
},
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
166
|
+
}, U = [], j = /* @__PURE__ */ d(
|
|
167
|
+
M,
|
|
168
|
+
z,
|
|
169
|
+
U,
|
|
194
170
|
!1,
|
|
195
171
|
null,
|
|
196
172
|
null,
|
|
197
173
|
null,
|
|
198
174
|
null
|
|
199
175
|
);
|
|
200
|
-
const
|
|
201
|
-
name: "bento-dropdown-tag"
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
ListboxOptionTag: c
|
|
205
|
-
},
|
|
176
|
+
const et = j.exports, E = a({
|
|
177
|
+
name: "bento-dropdown-tag"
|
|
178
|
+
}), V = /* @__PURE__ */ a({
|
|
179
|
+
...E,
|
|
206
180
|
props: {
|
|
207
|
-
...
|
|
181
|
+
...p.props,
|
|
208
182
|
/**
|
|
209
183
|
* The option elements to populate the tag dropdown with.
|
|
210
184
|
* It must be an array of {@see BentoTagListboxOptions }
|
|
@@ -218,43 +192,39 @@ const X = M.exports, O = u({
|
|
|
218
192
|
}
|
|
219
193
|
},
|
|
220
194
|
emits: ["input"],
|
|
221
|
-
setup(
|
|
222
|
-
const n = (e) => t("input", e)
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
var e;
|
|
228
|
-
return (e = r.items) == null ? void 0 : e.map(({ label: a, value: p, variant: i }) => ({ label: a, value: p, data: i }));
|
|
229
|
-
}
|
|
230
|
-
),
|
|
231
|
-
// Methods
|
|
232
|
-
onInput: n
|
|
233
|
-
};
|
|
195
|
+
setup(s, { emit: t }) {
|
|
196
|
+
const o = s, n = (e) => t("input", e), r = l(() => {
|
|
197
|
+
var e;
|
|
198
|
+
return (e = o.items) == null ? void 0 : e.map(({ label: u, value: _, variant: f }) => ({ label: u, value: _, data: f }));
|
|
199
|
+
});
|
|
200
|
+
return { __sfc: !0, props: o, emit: t, onInput: n, tagItems: r, ListboxOptionTag: i, BentoDropdown: p };
|
|
234
201
|
}
|
|
235
202
|
});
|
|
236
|
-
var
|
|
237
|
-
var t = this, n = t._self.
|
|
238
|
-
return
|
|
239
|
-
return [n
|
|
203
|
+
var q = function() {
|
|
204
|
+
var t = this, o = t._self._c, n = t._self._setupProxy;
|
|
205
|
+
return o(n.BentoDropdown, t._b({ staticClass: "b-dropdown-tag", attrs: { items: n.tagItems, "show-slot-content-in-multiple": "" }, on: { input: n.onInput }, scopedSlots: t._u([{ key: "default", fn: function({ label: r, data: e }) {
|
|
206
|
+
return [o(n.ListboxOptionTag, { attrs: { option: { value: r, data: e, label: "" } } })];
|
|
240
207
|
} }]) }, "bento-dropdown", t.$props, !1));
|
|
241
|
-
},
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
208
|
+
}, G = [], H = /* @__PURE__ */ d(
|
|
209
|
+
V,
|
|
210
|
+
q,
|
|
211
|
+
G,
|
|
245
212
|
!1,
|
|
246
213
|
null,
|
|
247
|
-
"
|
|
214
|
+
"bae2dd4a",
|
|
248
215
|
null,
|
|
249
216
|
null
|
|
250
217
|
);
|
|
251
|
-
const
|
|
218
|
+
const rt = H.exports;
|
|
252
219
|
export {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
220
|
+
p as BentoDropdown,
|
|
221
|
+
tt as BentoDropdownAvatar,
|
|
222
|
+
nt as BentoDropdownCountry,
|
|
223
|
+
ot as BentoDropdownCurrency,
|
|
224
|
+
dt as BentoDropdownEvent,
|
|
225
|
+
ct as BentoDropdownLazyLoadType,
|
|
226
|
+
et as BentoDropdownPaymentMethod,
|
|
227
|
+
_t as BentoDropdownSize,
|
|
228
|
+
rt as BentoDropdownTag
|
|
259
229
|
};
|
|
260
230
|
//# sourceMappingURL=dropdown.js.map
|