@adyen/bento-vue3 1.40.0 → 1.41.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 +6 -0
- package/dist/@types/packages/vue2/src/components/currency/currency.types.d.ts +18 -0
- package/dist/@types/packages/vue2/src/components/currency/currency.vue.d.ts +34 -211
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns.types.d.ts +0 -1
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/data-grid/composables/index.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-calculate-column-width/use-calculate-column-width.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-scroller/use-scroller.d.ts +10 -1
- package/dist/@types/packages/vue2/src/components/data-grid/composables/{use-selector.d.ts → use-selector/use-selector.d.ts} +2 -2
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-sorter.d.ts +1 -2
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +16 -1
- package/dist/@types/packages/vue2/src/components/image/image.vue.d.ts +43 -72
- package/dist/@types/packages/vue2/src/components/image/index.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/layout/components/layout-row/layout-row.vue.d.ts +54 -0
- package/dist/@types/packages/vue2/src/components/layout/index.d.ts +3 -0
- package/dist/@types/packages/vue2/src/components/layout/layout.keys.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/layout/layout.types.d.ts +19 -0
- package/dist/@types/packages/vue2/src/components/layout/layout.vue.d.ts +53 -0
- package/dist/@types/packages/vue2/src/components/promo-banner/__mock-image.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/promo-banner/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/promo-banner/promo-banner.types.d.ts +83 -0
- package/dist/@types/packages/vue2/src/components/promo-banner/promo-banner.vue.d.ts +65 -0
- package/dist/@types/packages/vue2/src/components/selection-card/components/selection-card-group/selection-card-group.types.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/selection-card/components/selection-card-group/selection-card-group.vue.d.ts +19 -4
- package/dist/@types/packages/vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue.d.ts +1 -3
- package/dist/@types/packages/vue2/src/components/structured-list/structured-list.vue.d.ts +1 -3
- package/dist/@types/packages/vue2/src/components/tutorial/components/tutorial-popover/tutorial-popover.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/index.d.ts +2 -0
- package/dist/action-bar.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/currency.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/layout-row.css +1 -0
- package/dist/assets/menu.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/popover.css +1 -1
- package/dist/assets/promo-banner.css +1 -0
- package/dist/assets/selection-card-group.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/structured-list-item.css +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{action-bar.CNH2XWmk.js → action-bar.BZIBGja0.js} +2 -2
- package/dist/chunks/{action-bar.CNH2XWmk.js.map → action-bar.BZIBGja0.js.map} +1 -1
- package/dist/chunks/{checkbox-group.Bu6WRt6i.js → checkbox-group.Zf-GivDW.js} +2 -2
- package/dist/chunks/{checkbox-group.Bu6WRt6i.js.map → checkbox-group.Zf-GivDW.js.map} +1 -1
- package/dist/chunks/{checkbox.DfUxRkJe.js → checkbox.DdMkyTo5.js} +15 -15
- package/dist/chunks/{checkbox.DfUxRkJe.js.map → checkbox.DdMkyTo5.js.map} +1 -1
- package/dist/chunks/{code-snippet.DqTEK8cz.js → code-snippet.Dp_tDJ-S.js} +3 -3
- package/dist/chunks/{code-snippet.DqTEK8cz.js.map → code-snippet.Dp_tDJ-S.js.map} +1 -1
- package/dist/chunks/{currency.BGrGBnhm.js → currency.Dz2x17_Q.js} +57 -70
- package/dist/chunks/currency.Dz2x17_Q.js.map +1 -0
- package/dist/chunks/{dashboard-section.rv0r2_-a.js → dashboard-section.BdRXcY4u.js} +2 -2
- package/dist/chunks/{dashboard-section.rv0r2_-a.js.map → dashboard-section.BdRXcY4u.js.map} +1 -1
- package/dist/chunks/{data-grid.DR-w_KKU.js → data-grid.BC2tOBxm.js} +1329 -1276
- package/dist/chunks/data-grid.BC2tOBxm.js.map +1 -0
- package/dist/chunks/{date-picker.mfXjVZ9w.js → date-picker.B6HK0sb2.js} +14 -14
- package/dist/chunks/{date-picker.mfXjVZ9w.js.map → date-picker.B6HK0sb2.js.map} +1 -1
- package/dist/chunks/{date-range-picker.Cs8Ia3Qs.js → date-range-picker.3iWt1Cd6.js} +23 -23
- package/dist/chunks/{date-range-picker.Cs8Ia3Qs.js.map → date-range-picker.3iWt1Cd6.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.DeoUXbp4.js → dropdown-tag.ChFJ9l5g.js} +2 -2
- package/dist/chunks/{dropdown-tag.DeoUXbp4.js.map → dropdown-tag.ChFJ9l5g.js.map} +1 -1
- package/dist/chunks/{dropdown.DBxpqjEM.js → dropdown.CMKdLPHi.js} +26 -26
- package/dist/chunks/{dropdown.DBxpqjEM.js.map → dropdown.CMKdLPHi.js.map} +1 -1
- package/dist/chunks/es6.b4enG1py.js +10 -0
- package/dist/chunks/es6.b4enG1py.js.map +1 -0
- package/dist/chunks/{filter-bar.DiW13x-f.js → filter-bar.pKcJryD3.js} +7 -7
- package/dist/chunks/{filter-bar.DiW13x-f.js.map → filter-bar.pKcJryD3.js.map} +1 -1
- package/dist/chunks/image.vue_vue_type_script_setup_true_lang.BMoSMeM-.js +47 -0
- package/dist/chunks/image.vue_vue_type_script_setup_true_lang.BMoSMeM-.js.map +1 -0
- package/dist/chunks/index.ChdIlujs.js +248 -0
- package/dist/chunks/{index.DKQuLmwu.js.map → index.ChdIlujs.js.map} +1 -1
- package/dist/chunks/{input-field.DbeVnbwg.js → input-field.Bk2p3kIb.js} +2 -2
- package/dist/chunks/{input-field.DbeVnbwg.js.map → input-field.Bk2p3kIb.js.map} +1 -1
- package/dist/chunks/layout-row.rzhGrBQ3.js +101 -0
- package/dist/chunks/layout-row.rzhGrBQ3.js.map +1 -0
- package/dist/chunks/{pagination.B-OihXTg.js → pagination.D_4FRHE9.js} +2 -2
- package/dist/chunks/{pagination.B-OihXTg.js.map → pagination.D_4FRHE9.js.map} +1 -1
- package/dist/chunks/promo-banner.BRn1iznD.js +126 -0
- package/dist/chunks/promo-banner.BRn1iznD.js.map +1 -0
- package/dist/chunks/{search-bar.DN-QKFlJ.js → search-bar.D_4u91te.js} +3 -3
- package/dist/chunks/{search-bar.DN-QKFlJ.js.map → search-bar.D_4u91te.js.map} +1 -1
- package/dist/chunks/{secondary-nav.C-7Qq6rE.js → secondary-nav.CQ3aLyrM.js} +4 -4
- package/dist/chunks/{secondary-nav.C-7Qq6rE.js.map → secondary-nav.CQ3aLyrM.js.map} +1 -1
- package/dist/chunks/selection-card-group.Du3Cwf47.js +474 -0
- package/dist/chunks/selection-card-group.Du3Cwf47.js.map +1 -0
- package/dist/chunks/{structured-list-item.BhNJlDub.js → structured-list-item.CujUEOTK.js} +3 -3
- package/dist/chunks/structured-list-item.CujUEOTK.js.map +1 -0
- package/dist/chunks/{timeline-item.CEolKFn0.js → timeline-item.B8VvkDfR.js} +2 -2
- package/dist/chunks/{timeline-item.CEolKFn0.js.map → timeline-item.B8VvkDfR.js.map} +1 -1
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.Bz6QyDuV.js → tutorial.vue_vue_type_script_setup_true_lang.CGpbGgfc.js} +9 -9
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.Bz6QyDuV.js.map → tutorial.vue_vue_type_script_setup_true_lang.CGpbGgfc.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.C7Lt5U_S.js → use-cached-selected-values.DaRzXFIt.js} +2 -2
- package/dist/chunks/{use-cached-selected-values.C7Lt5U_S.js.map → use-cached-selected-values.DaRzXFIt.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/currency.js +1 -1
- package/dist/dashboard-template.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker.js +1 -1
- package/dist/dropdown.js +3 -3
- package/dist/filter-bar.js +1 -1
- package/dist/image.js +1 -1
- package/dist/index.js +197 -190
- package/dist/index.js.map +1 -1
- package/dist/input-field.js +1 -1
- package/dist/internal.js +1 -1
- package/dist/layout.js +6 -0
- package/dist/layout.js.map +1 -0
- package/dist/pagination.js +1 -1
- package/dist/promo-banner.js +7 -0
- package/dist/promo-banner.js.map +1 -0
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/styles/bento-dark.css +16 -0
- package/dist/styles/bento-light.css +16 -0
- package/dist/styles/bento.css +16 -0
- package/dist/styles/legacy.css +16 -0
- package/dist/styles/styleguide.css +16 -0
- package/dist/timeline.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +2 -2
- package/dist/@types/packages/vue2/src/components/image/image.types.d.ts +0 -19
- package/dist/chunks/currency.BGrGBnhm.js.map +0 -1
- package/dist/chunks/data-grid.DR-w_KKU.js.map +0 -1
- package/dist/chunks/es6.BvpG4Oi6.js +0 -9
- package/dist/chunks/es6.BvpG4Oi6.js.map +0 -1
- package/dist/chunks/image.0KzfycGE.js +0 -78
- package/dist/chunks/image.0KzfycGE.js.map +0 -1
- package/dist/chunks/index.DKQuLmwu.js +0 -182
- package/dist/chunks/selection-card-group.DkSYInMF.js +0 -392
- package/dist/chunks/selection-card-group.DkSYInMF.js.map +0 -1
- package/dist/chunks/structured-list-item.BhNJlDub.js.map +0 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { ref as C, computed as P, defineComponent as H, toRef as V, watch as Q, nextTick as N, resolveComponent as c, resolveDirective as X, withDirectives as Z, openBlock as f, createElementBlock as _, withKeys as U, createBlock as y, createCommentVNode as k, createElementVNode as x, createVNode as M, normalizeClass as ee, withCtx as h, createTextVNode as ae, toDisplayString as te } from "vue";
|
|
2
2
|
import { B as re } from "./popover.HArIkKve.js";
|
|
3
3
|
import { B as ne } from "./typography.DNzU41ah.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { D as oe } from "./dropdown-default-textbox.CcRQ1f4U.js";
|
|
5
|
+
import { d as le } from "./debounce.DUTu11PS.js";
|
|
6
|
+
import { D as A, v as ie, f as se } from "./date-input.BqBdAO1E.js";
|
|
6
7
|
import { g as I } from "./generate-uid.D-HFI38h.js";
|
|
7
8
|
import { u as L } from "./i18n.CPGoe9tN.js";
|
|
8
|
-
import { g as
|
|
9
|
+
import { g as de } from "./get-date-locale.BN8xEjY0.js";
|
|
9
10
|
import { f as $ } from "./date.DVGj7WKQ.js";
|
|
10
|
-
import { u as
|
|
11
|
-
import { B as
|
|
11
|
+
import { u as ue } from "./use-form-layout-loading.D3lALhtC.js";
|
|
12
|
+
import { B as pe } from "./directive.O3yEdalv.js";
|
|
12
13
|
import "./events.FNmSWp_P.js";
|
|
13
14
|
import { a as g } from "./calendar.S9HFQA8j.js";
|
|
14
|
-
import { D as pe } from "./dropdown-default-textbox.CcRQ1f4U.js";
|
|
15
15
|
import { E as ce, F as fe } from "./error-message.CmMyB-k9.js";
|
|
16
16
|
import { _ as me } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
17
17
|
import "../assets/date-picker.css";
|
|
18
18
|
const De = ({ datePickerValue: e, isDateIncorrect: t }) => {
|
|
19
19
|
var s;
|
|
20
|
-
const { locale: o, t: m } = L(), l =
|
|
20
|
+
const { locale: o, t: m } = L(), l = de(), i = C((s = e.value) == null ? void 0 : s.toDateString());
|
|
21
21
|
return {
|
|
22
22
|
// Values
|
|
23
23
|
dateDisplayValue: P(() => t.value ? i.value : e.value ? $(e.value, A.FULL_DATE, {
|
|
@@ -57,10 +57,10 @@ const F = {
|
|
|
57
57
|
BentoPopover: re,
|
|
58
58
|
Calendar: g,
|
|
59
59
|
ErrorMessage: ce,
|
|
60
|
-
DropdownInputDefault:
|
|
60
|
+
DropdownInputDefault: oe,
|
|
61
61
|
FieldLabel: fe
|
|
62
62
|
},
|
|
63
|
-
directives: { BentoClickOutsideDirective:
|
|
63
|
+
directives: { BentoClickOutsideDirective: pe },
|
|
64
64
|
props: {
|
|
65
65
|
/**
|
|
66
66
|
* Descriptive supporting text visbile underneath the dropdown.
|
|
@@ -117,7 +117,7 @@ const F = {
|
|
|
117
117
|
},
|
|
118
118
|
emits: [u.INPUT],
|
|
119
119
|
setup(e, { emit: t }) {
|
|
120
|
-
const { t: o } = L({ messages: F }), m = I("bento-date-picker-container"), l = I("bento-date-picker-label"), i = I("bento-date-picker-description"), D = I("bento-date-picker-error"), b = I("bento-date-picker-date-error"), s = P(() => e.label || o("datePicker", { name: m })), d = C(null), E = C(null), r = C(!1), n = C(!1), { isReadOnly: v } =
|
|
120
|
+
const { t: o } = L({ messages: F }), m = I("bento-date-picker-container"), l = I("bento-date-picker-label"), i = I("bento-date-picker-description"), D = I("bento-date-picker-error"), b = I("bento-date-picker-date-error"), s = P(() => e.label || o("datePicker", { name: m })), d = C(null), E = C(null), r = C(!1), n = C(!1), { isReadOnly: v } = ue(V(e, "readonly"));
|
|
121
121
|
Q(
|
|
122
122
|
() => e.disabled,
|
|
123
123
|
(a) => {
|
|
@@ -140,12 +140,12 @@ const F = {
|
|
|
140
140
|
}, z = async () => {
|
|
141
141
|
r.value && (r.value = !1, p.value = null), t(u.INPUT, null);
|
|
142
142
|
}, J = (a) => {
|
|
143
|
-
|
|
143
|
+
ie(a);
|
|
144
144
|
}, R = (a) => {
|
|
145
145
|
if (a.length < 10)
|
|
146
146
|
return;
|
|
147
147
|
/^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/.test(a) && W(new Date(a)) ? (r.value = !1, t(u.INPUT, new Date(a))) : a && (r.value = !0, t(u.INPUT, null));
|
|
148
|
-
}, G =
|
|
148
|
+
}, G = le(R, be);
|
|
149
149
|
return {
|
|
150
150
|
// Refs
|
|
151
151
|
inputContainerRef: E,
|
|
@@ -172,7 +172,7 @@ const F = {
|
|
|
172
172
|
openDatePicker: O,
|
|
173
173
|
onDateKeyDown: J,
|
|
174
174
|
onDateInputChange: (a) => {
|
|
175
|
-
p.value =
|
|
175
|
+
p.value = se(a), n.value ? G(p.value) : R(p.value);
|
|
176
176
|
},
|
|
177
177
|
// Keyboard navigation
|
|
178
178
|
onSpaceBarOrEnter: async (a) => {
|
|
@@ -280,4 +280,4 @@ export {
|
|
|
280
280
|
Fe as B,
|
|
281
281
|
u as a
|
|
282
282
|
};
|
|
283
|
-
//# sourceMappingURL=date-picker.
|
|
283
|
+
//# sourceMappingURL=date-picker.B6HK0sb2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.mfXjVZ9w.js","sources":["../../../vue2/src/components/date-picker/composables/use-date-picker-single-calendar-text.ts","../../../vue2/src/components/date-picker/date-picker.types.ts","../../../vue2/src/components/date-picker/date-picker.vue"],"sourcesContent":["import { computed, ref } from 'vue';\nimport { useI18n } from '@/utils/ts/i18n';\nimport { UseDateDisplayText } from './use-date-picker-single-calendar-text.types';\nimport { DateFormat } from '@/types';\nimport { getDateLocale } from '@/utils/ts/get-date-locale/get-date-locale';\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 = getDateLocale();\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)] || locales.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)] || locales.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 '@/core/utils/ts';\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","getDateLocale","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","withDirectives","openBlock","createElementBlock","_ctx","createBlock","_component_field_label","optional","required","createCommentVNode","createElementVNode","createVNode","_component_dropdown_input_default","label","onDateInputChange","_component_error_message","_component_bento_typography","normalizeClass","createTextVNode","toDisplayString","_component_bento_popover","withCtx","_component_calendar","firstDayOfWeek","max"],"mappings":";;;;;;;;;;;;;;;;;AAYO,MAAAA,KAAA,CAAA,EAAA,iBAAAC,GAAA,iBAAAC,EAAA,MAAA;;AACH,QAAA,EAAA,QAAAC,GAAA,GAAAC,EAAA,IAAAC,EAAA,GACAC,IAAAC,GAAA,GAEAC,IAAAC,GAAAC,IAAAT,EAAA,UAAA,gBAAAS,EAAA,cAAA;AAoCA,SAAA;AAAA;AAAA,IAAO,kBAlCPC,EAAA,MAEIT,EAAA,QACIM,EAAA,QAIJP,EAAA,QAKAW,EAAAX,EAAA,OAAAY,EAAA,WAAA;AAAA,MAAmE,QAAAP,EAAAH,EAAA,MAAA,UAAA,GAAA,CAAA,CAAA,KAAAG,EAAA;AAAA,IACN,CAAA,IALzDF,EAAA,YAAA,CAMH;AAAA,IAsBD,gBAAAI;AAAA;AAAA,IACA,6BAhBJ,CAAAM,IAAAb,EAAA,UAAA;AAEI,MAAAC,EAAA,UA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f,EAAA,WAAA,GAAA,CAAA;AAAA,MAAA,CAAA;AAAA,MAAA,GAAA;AAAA,IAAA,GAAA,GAAA,CAAA,OAAA,CAAA,KAAAK,EAAA,IAAA,EAAA;AAAA,IA4FwBL,EAAA,qBAAAF,EAAA,GAAAG,EAAAe,GAAA;AAAA,MArBc,KAAA;AAAA,MACrB,IAAAhB,EAAA;AAAA,MACA,OAAA;AAAA,MACE9B,MAAAA;AAAAA,MACN,MAAA8B,EAAA;AAAA,MACA,kBAAAA,EAAA;AAAA,MACYjC,sBAAAA;AAAAA,MACI,cAAAiC,EAAA;AAAA,MACR,cAAA;AAAA,MACE,UAAA;AAAA,MAhFvB,eAAA;AAAA,IAAA,GAAA;AAAA,MAmFoB,SAAAiB,EAAA,MAAA;AAAA,QAAAV,EAAAW,GAAA;AAAA,UACgBC,KAAAA;AAAAA,UACnB,qBAAAnB,EAAA;AAAA,UACmB,oBAAAA,EAAA;AAAA,UACP,oBAAA;AAAA,UACJ,OAAAA,EAAA;AAAA,UACHoB,KAAAA,EAAAA;AAAAA,UACEnC,KAAAA,EAAAA;AAAAA;QA1FxB,GAAA,MAAA,GAAA,CAAA,qBAAA,oBAAA,SAAA,OAAA,OAAA,SAAA,CAAA;AAAA,MAAA,CAAA;AAAA,MAAA,GAAA;AAAA,IAAA,GAAA,GAAA,CAAA,MAAA,QAAA,kBAAA,YAAA,CAAA,KAAAoB,EAAA,IAAA,EAAA;AAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"date-picker.B6HK0sb2.js","sources":["../../../vue2/src/components/date-picker/composables/use-date-picker-single-calendar-text.ts","../../../vue2/src/components/date-picker/date-picker.types.ts","../../../vue2/src/components/date-picker/date-picker.vue"],"sourcesContent":["import { computed, ref } from 'vue';\nimport { useI18n } from '@/utils/ts/i18n';\nimport { UseDateDisplayText } from './use-date-picker-single-calendar-text.types';\nimport { DateFormat } from '@/types';\nimport { getDateLocale } from '@/utils/ts/get-date-locale/get-date-locale';\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 = getDateLocale();\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)] || locales.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)] || locales.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 '@/core/utils/ts';\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","getDateLocale","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","withDirectives","openBlock","createElementBlock","_ctx","createBlock","_component_field_label","optional","required","createCommentVNode","createElementVNode","createVNode","_component_dropdown_input_default","label","onDateInputChange","_component_error_message","_component_bento_typography","normalizeClass","createTextVNode","toDisplayString","_component_bento_popover","withCtx","_component_calendar","firstDayOfWeek","max"],"mappings":";;;;;;;;;;;;;;;;;AAYO,MAAAA,KAAA,CAAA,EAAA,iBAAAC,GAAA,iBAAAC,EAAA,MAAA;;AACH,QAAA,EAAA,QAAAC,GAAA,GAAAC,EAAA,IAAAC,EAAA,GACAC,IAAAC,GAAA,GAEAC,IAAAC,GAAAC,IAAAT,EAAA,UAAA,gBAAAS,EAAA,cAAA;AAoCA,SAAA;AAAA;AAAA,IAAO,kBAlCPC,EAAA,MAEIT,EAAA,QACIM,EAAA,QAIJP,EAAA,QAKAW,EAAAX,EAAA,OAAAY,EAAA,WAAA;AAAA,MAAmE,QAAAP,EAAAH,EAAA,MAAA,UAAA,GAAA,CA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AG,EAAAW,GAAA;AAAA,MAJPjC,KAAAA;AAAAA,MACL,OAAAkC,GAAA,CAAA,8BAAAb,EAAA,6BAAA,CAAA;AAAA,MA/Df,IAAA;AAAA,IAAA,GAAA;AAAA;QAAAc,GAAAC,GAAAf,EAAA,WAAA,GAAA,CAAA;AAAA,MAAA,CAAA;AAAA,MAAA,GAAA;AAAA,IAAA,GAAA,GAAA,CAAA,OAAA,CAAA,KAAAK,EAAA,IAAA,EAAA;AAAA,IA4FwBL,EAAA,qBAAAF,EAAA,GAAAG,EAAAe,GAAA;AAAA,MArBc,KAAA;AAAA,MACrB,IAAAhB,EAAA;AAAA,MACA,OAAA;AAAA,MACE9B,MAAAA;AAAAA,MACN,MAAA8B,EAAA;AAAA,MACA,kBAAAA,EAAA;AAAA,MACYjC,sBAAAA;AAAAA,MACI,cAAAiC,EAAA;AAAA,MACR,cAAA;AAAA,MACE,UAAA;AAAA,MAhFvB,eAAA;AAAA,IAAA,GAAA;AAAA,MAmFoB,SAAAiB,EAAA,MAAA;AAAA,QAAAV,EAAAW,GAAA;AAAA,UACgBC,KAAAA;AAAAA,UACnB,qBAAAnB,EAAA;AAAA,UACmB,oBAAAA,EAAA;AAAA,UACP,oBAAA;AAAA,UACJ,OAAAA,EAAA;AAAA,UACHoB,KAAAA,EAAAA;AAAAA,UACEnC,KAAAA,EAAAA;AAAAA;QA1FxB,GAAA,MAAA,GAAA,CAAA,qBAAA,oBAAA,SAAA,OAAA,OAAA,SAAA,CAAA;AAAA,MAAA,CAAA;AAAA,MAAA,GAAA;AAAA,IAAA,GAAA,GAAA,CAAA,MAAA,QAAA,kBAAA,YAAA,CAAA,KAAAoB,EAAA,IAAA,EAAA;AAAA;;;;;"}
|
|
@@ -2,24 +2,24 @@ import { reactive as ue, defineComponent as Ye, computed as I, ref as A, onMount
|
|
|
2
2
|
import { B as la } from "./divider.ugNXYI-T.js";
|
|
3
3
|
import { B as ia } from "./popover.HArIkKve.js";
|
|
4
4
|
import { B as Ge, d as da } from "./typography.DNzU41ah.js";
|
|
5
|
+
import { D as ua } from "./dropdown-default-textbox.CcRQ1f4U.js";
|
|
5
6
|
import { r as te, t as ae, g as ve } from "./get-date-locale.BN8xEjY0.js";
|
|
6
7
|
import { g as ne } from "./generate-uid.D-HFI38h.js";
|
|
7
8
|
import { u as ge } from "./i18n.CPGoe9tN.js";
|
|
8
9
|
import { t as ye, f as oe } from "./date.DVGj7WKQ.js";
|
|
9
|
-
import { f as we, v as
|
|
10
|
-
import { u as
|
|
11
|
-
import { B as
|
|
10
|
+
import { f as we, v as ma, D as E } from "./date-input.BqBdAO1E.js";
|
|
11
|
+
import { u as ca } from "./use-form-layout-loading.D3lALhtC.js";
|
|
12
|
+
import { B as Da } from "./directive.O3yEdalv.js";
|
|
12
13
|
import "./events.FNmSWp_P.js";
|
|
13
|
-
import { B as
|
|
14
|
-
import { B as
|
|
15
|
-
import { B as
|
|
14
|
+
import { B as pa } from "./input-field.Bk2p3kIb.js";
|
|
15
|
+
import { B as fa } from "./dropdown.CMKdLPHi.js";
|
|
16
|
+
import { B as va } from "./segmented-control.CueLfseV.js";
|
|
16
17
|
import { d as ie } from "./debounce.DUTu11PS.js";
|
|
17
|
-
import { u as
|
|
18
|
-
import { s as re, c as Oe, i as ee, d as
|
|
18
|
+
import { u as ga } from "./use-has-slot.B7eQSabc.js";
|
|
19
|
+
import { s as re, c as Oe, i as ee, d as ya, e as Me, f as ba, g as Ae, h as Ta, j as Ia, a as J, u as Ra } from "./calendar.S9HFQA8j.js";
|
|
19
20
|
import { e as W } from "./index.DPafeRJa.js";
|
|
20
21
|
import { e as Ce } from "./index.CrhTVr5J.js";
|
|
21
22
|
import { _ as qe } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
22
|
-
import { D as Ra } from "./dropdown-default-textbox.CcRQ1f4U.js";
|
|
23
23
|
import { B as ka, c as Sa } from "./button-actions.ndsyVgzV.js";
|
|
24
24
|
import { E as Ea, F as ha } from "./error-message.CmMyB-k9.js";
|
|
25
25
|
import "../assets/date-range-picker.css";
|
|
@@ -64,13 +64,13 @@ const Aa = ({
|
|
|
64
64
|
p = re(i.earliest);
|
|
65
65
|
else {
|
|
66
66
|
const d = Oe(p, { weekStartsOn: e });
|
|
67
|
-
ee(p, d) || (p = re(
|
|
67
|
+
ee(p, d) || (p = re(ya(Me(p, { weekStartsOn: e }), 1)));
|
|
68
68
|
}
|
|
69
69
|
if (i.latest)
|
|
70
70
|
n = W(i.latest);
|
|
71
71
|
else {
|
|
72
72
|
const d = Me(n, { weekStartsOn: e });
|
|
73
|
-
ee(n, d) || (n = W(
|
|
73
|
+
ee(n, d) || (n = W(ba(Oe(n, { weekStartsOn: e }), 1)));
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
if ((i == null ? void 0 : i.type) === "monthly") {
|
|
@@ -78,13 +78,13 @@ const Aa = ({
|
|
|
78
78
|
p = re(i.earliest);
|
|
79
79
|
else {
|
|
80
80
|
const d = Ae(p);
|
|
81
|
-
ee(p, d) || (p = Ae(
|
|
81
|
+
ee(p, d) || (p = Ae(Ta(p, 1)));
|
|
82
82
|
}
|
|
83
83
|
if (i.latest)
|
|
84
84
|
n = W(i.latest);
|
|
85
85
|
else {
|
|
86
86
|
const d = Ce(n);
|
|
87
|
-
ee(n, d) || (n = Ce(
|
|
87
|
+
ee(n, d) || (n = Ce(Ia(n, 1)));
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
return { min: p, max: n };
|
|
@@ -150,9 +150,9 @@ const _a = /[\d]/, Fa = /^\d{2}$/, Ua = /^\d{2}:\d{2}$/, Ba = (e) => {
|
|
|
150
150
|
i18n: { messages: Pe },
|
|
151
151
|
name: "date-range-picker-calendar",
|
|
152
152
|
components: {
|
|
153
|
-
BentoDropdown:
|
|
154
|
-
BentoInputField:
|
|
155
|
-
BentoSegmentedControl:
|
|
153
|
+
BentoDropdown: fa,
|
|
154
|
+
BentoInputField: pa,
|
|
155
|
+
BentoSegmentedControl: va,
|
|
156
156
|
BentoTypography: Ge,
|
|
157
157
|
Calendar: J
|
|
158
158
|
},
|
|
@@ -265,7 +265,7 @@ const _a = /[\d]/, Fa = /^\d{2}$/, Ua = /^\d{2}:\d{2}$/, Ba = (e) => {
|
|
|
265
265
|
adjustEndDateInputForWeekly: F,
|
|
266
266
|
adjustStartDateInputForMonthly: g,
|
|
267
267
|
adjustEndDateInputForMonthly: _
|
|
268
|
-
} =
|
|
268
|
+
} = Ra(e.firstDayOfWeek), { savedRanges: T, saveRange: K, resetSavedRanges: se } = Ca(), R = (a) => a ? oe(a, E.NUMERIC_DATE_YEAR_FIRST, {
|
|
269
269
|
locale: p[u.value.substring(0, 2)] || p.enUS
|
|
270
270
|
}) : "", j = (a) => a ? oe(a, E.HOUR_MINUTE_SECONDS, {
|
|
271
271
|
locale: p[u.value.substring(0, 2)] || p.enUS
|
|
@@ -377,7 +377,7 @@ const _a = /[\d]/, Fa = /^\d{2}$/, Ua = /^\d{2}:\d{2}$/, Ba = (e) => {
|
|
|
377
377
|
}, Ne), We = (a) => {
|
|
378
378
|
o.endDate = we(a), me(o.endDate);
|
|
379
379
|
}, He = (a) => {
|
|
380
|
-
|
|
380
|
+
ma(a);
|
|
381
381
|
}, je = ie((a) => {
|
|
382
382
|
if (le(a)) {
|
|
383
383
|
G.value = !1, n.startDate = z(n.startDate, a);
|
|
@@ -483,7 +483,7 @@ const _a = /[\d]/, Fa = /^\d{2}$/, Ua = /^\d{2}:\d{2}$/, Ba = (e) => {
|
|
|
483
483
|
quickSelectRangeDefaultItems: h,
|
|
484
484
|
formInputWrapperConditionalClasses: y,
|
|
485
485
|
// Methods
|
|
486
|
-
hasSlot:
|
|
486
|
+
hasSlot: ga(l),
|
|
487
487
|
t: i,
|
|
488
488
|
// Events
|
|
489
489
|
onDateInput: be,
|
|
@@ -703,11 +703,11 @@ const Ve = {
|
|
|
703
703
|
BentoTypography: Ge,
|
|
704
704
|
BentoPopover: ia,
|
|
705
705
|
DateRangePickerCalendar: B,
|
|
706
|
-
DropdownInputDefault:
|
|
706
|
+
DropdownInputDefault: ua,
|
|
707
707
|
ErrorMessage: Ea,
|
|
708
708
|
FieldLabel: ha
|
|
709
709
|
},
|
|
710
|
-
directives: { BentoClickOutsideDirective:
|
|
710
|
+
directives: { BentoClickOutsideDirective: Da },
|
|
711
711
|
props: {
|
|
712
712
|
/**
|
|
713
713
|
* Allows user to enter time values in the form
|
|
@@ -805,7 +805,7 @@ const Ve = {
|
|
|
805
805
|
setup(e, { emit: t }) {
|
|
806
806
|
const { locale: l, t: u } = ge({ messages: Ve }), i = ve(), p = ne("bento-date-range-picker-container"), n = ne("bento-date-range-picker-label"), d = ne("bento-date-range-picker-description"), y = ne("bento-date-range-picker-error"), h = ne("bento-date-range-picker-date-error"), O = I(
|
|
807
807
|
() => e.label || u("dateRangePicker", { name: p })
|
|
808
|
-
), v = A(!1), V = A(null), m = A(!1), { isReadOnly: Y } =
|
|
808
|
+
), v = A(!1), V = A(null), m = A(!1), { isReadOnly: Y } = ca(ce(e, "readonly"));
|
|
809
809
|
he(
|
|
810
810
|
() => e.disabled,
|
|
811
811
|
() => {
|
|
@@ -1032,4 +1032,4 @@ export {
|
|
|
1032
1032
|
de as a,
|
|
1033
1033
|
_e as i
|
|
1034
1034
|
};
|
|
1035
|
-
//# sourceMappingURL=date-range-picker.
|
|
1035
|
+
//# sourceMappingURL=date-range-picker.3iWt1Cd6.js.map
|