@adyen/bento-vue3 2.1.1 → 2.1.2
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/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/button-actions.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/navigation-menu-group.css +1 -1
- package/dist/assets/secondary-nav.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{calendar.CycKx_P3.js → calendar.0d9D-nmt.js} +2 -2
- package/dist/chunks/{calendar.CycKx_P3.js.map → calendar.0d9D-nmt.js.map} +1 -1
- package/dist/chunks/{checkbox-group.Bcy98dh8.js → checkbox-group.Deb5pHjj.js} +2 -2
- package/dist/chunks/{checkbox-group.Bcy98dh8.js.map → checkbox-group.Deb5pHjj.js.map} +1 -1
- package/dist/chunks/{checkbox.BN7ttBqd.js → checkbox.YBhv3GCJ.js} +14 -14
- package/dist/chunks/{checkbox.BN7ttBqd.js.map → checkbox.YBhv3GCJ.js.map} +1 -1
- package/dist/chunks/{code-snippet.3u22Ij2R.js → code-snippet.Ct8V995o.js} +2 -2
- package/dist/chunks/{code-snippet.3u22Ij2R.js.map → code-snippet.Ct8V995o.js.map} +1 -1
- package/dist/chunks/{data-grid.DYNep9mz.js → data-grid.1Inq7Qcv.js} +6 -6
- package/dist/chunks/{data-grid.DYNep9mz.js.map → data-grid.1Inq7Qcv.js.map} +1 -1
- package/dist/chunks/{date-picker.DjLNf7fF.js → date-picker.DwA7PxtZ.js} +8 -8
- package/dist/chunks/{date-picker.DjLNf7fF.js.map → date-picker.DwA7PxtZ.js.map} +1 -1
- package/dist/chunks/{date-range-picker.CI5hBzgs.js → date-range-picker.CpYS55md.js} +46 -46
- package/dist/chunks/{date-range-picker.CI5hBzgs.js.map → date-range-picker.CpYS55md.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.GOcJPx20.js → dropdown-tag.BpJ_jwDg.js} +2 -2
- package/dist/chunks/{dropdown-tag.GOcJPx20.js.map → dropdown-tag.BpJ_jwDg.js.map} +1 -1
- package/dist/chunks/{dropdown.BvrZG8Za.js → dropdown.CpcbBlcE.js} +41 -41
- package/dist/chunks/{dropdown.BvrZG8Za.js.map → dropdown.CpcbBlcE.js.map} +1 -1
- package/dist/chunks/{filter-bar.DrOXGxUc.js → filter-bar.BR84cHEs.js} +9 -9
- package/dist/chunks/{filter-bar.DrOXGxUc.js.map → filter-bar.BR84cHEs.js.map} +1 -1
- package/dist/chunks/{header-with-views.LJ3oCsMN.js → header-with-views.BbRmt1H5.js} +4 -4
- package/dist/chunks/{header-with-views.LJ3oCsMN.js.map → header-with-views.BbRmt1H5.js.map} +1 -1
- package/dist/chunks/{input-field-password.CFBPscot.js → input-field-password.DbeEL3hn.js} +2 -2
- package/dist/chunks/{input-field-password.CFBPscot.js.map → input-field-password.DbeEL3hn.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.BNAKRBLr.js → input-field-phone-number.COLI-j2g.js} +2 -2
- package/dist/chunks/{input-field-phone-number.BNAKRBLr.js.map → input-field-phone-number.COLI-j2g.js.map} +1 -1
- package/dist/chunks/{input-field.BBSr4o-k.js → input-field.CNYZ-qxB.js} +2 -2
- package/dist/chunks/{input-field.BBSr4o-k.js.map → input-field.CNYZ-qxB.js.map} +1 -1
- package/dist/chunks/{input-time.Cdz9Jb-1.js → input-time.ClwtIJrn.js} +3 -3
- package/dist/chunks/{input-time.Cdz9Jb-1.js.map → input-time.ClwtIJrn.js.map} +1 -1
- package/dist/chunks/{pagination.DbGaudSO.js → pagination.Bx1uI60B.js} +2 -2
- package/dist/chunks/{pagination.DbGaudSO.js.map → pagination.Bx1uI60B.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.CjbYg6ee.js → rich-text-editor.ClUU1zPM.js} +2 -2
- package/dist/chunks/{rich-text-editor.CjbYg6ee.js.map → rich-text-editor.ClUU1zPM.js.map} +1 -1
- package/dist/chunks/{search-bar.D8LwiALL.js → search-bar.ChSjMgxy.js} +3 -3
- package/dist/chunks/{search-bar.D8LwiALL.js.map → search-bar.ChSjMgxy.js.map} +1 -1
- package/dist/chunks/{secondary-nav.CWZFULKD.js → secondary-nav.CJ7ZpLYv.js} +2 -2
- package/dist/chunks/{secondary-nav.CWZFULKD.js.map → secondary-nav.CJ7ZpLYv.js.map} +1 -1
- package/dist/chunks/{selection-card-group.Covrf9mH.js → selection-card-group.CQsS8-H9.js} +9 -9
- package/dist/chunks/{selection-card-group.Covrf9mH.js.map → selection-card-group.CQsS8-H9.js.map} +1 -1
- package/dist/chunks/{use-date-input-formatter.deZ3kB0L.js → use-date-input-formatter.ByQ6j4AU.js} +2 -2
- package/dist/chunks/{use-date-input-formatter.deZ3kB0L.js.map → use-date-input-formatter.ByQ6j4AU.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/date-range-picker.js +2 -2
- package/dist/date-time-picker.js +4 -4
- package/dist/dropdown.js +2 -2
- package/dist/filter-bar.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/index.js +20 -20
- package/dist/input-field-password.js +1 -1
- package/dist/input-field-phone-number.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/input-time.js +1 -1
- package/dist/internal.js +2 -2
- package/dist/pagination.js +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +3 -3
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ref as m, computed as n, defineComponent as fe, toRef as w, watch as T, withDirectives as De, openBlock as u, createElementBlock as be, withKeys as V, createBlock as v, unref as t, createCommentVNode as h, createElementVNode as ye, normalizeClass as ge, withCtx as J, createTextVNode as ke, toDisplayString as he, createVNode as Fe, nextTick as Ie } from "vue";
|
|
2
|
-
import { g as Se, f as H, b as Ne, h as Ce, i as Re, p as Be } from "./calendar.
|
|
2
|
+
import { g as Se, f as H, b as Ne, h as Ce, i as Re, p as Be } from "./calendar.0d9D-nmt.js";
|
|
3
3
|
import { h as Pe } from "./button-actions.DvuGEQxM.js";
|
|
4
4
|
import { B as Ee } from "./typography.B6elnWpr.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { B as Me } from "./input-field.CNYZ-qxB.js";
|
|
6
|
+
import { D as we, g as Te } from "./dropdown.CpcbBlcE.js";
|
|
7
7
|
import { g as F } from "./generate-uid.DBWe4g6T.js";
|
|
8
8
|
import { u as Q } from "./index.CGBfMQdv.js";
|
|
9
9
|
import { u as Ve } from "./form-field.B60VsF8d.js";
|
|
10
|
-
import { u as Y, a as Oe } from "./use-date-input-formatter.
|
|
10
|
+
import { u as Y, a as Oe } from "./use-date-input-formatter.ByQ6j4AU.js";
|
|
11
11
|
import { u as Ae } from "./use-form-layout-loading.CWbjZiwP.js";
|
|
12
12
|
import { u as qe } from "./use-touch-device.DTqFAbXh.js";
|
|
13
13
|
import { B as Le } from "./directive.D1-d-C2K.js";
|
|
@@ -140,7 +140,7 @@ const O = {
|
|
|
140
140
|
return;
|
|
141
141
|
const o = $(e) ? K(e) : null, G = M(o);
|
|
142
142
|
!G && o ? (l.value = null, d(o)) : e && (l.value = G || "invalidDateFormat", d(null));
|
|
143
|
-
}, me =
|
|
143
|
+
}, me = Te(j, 1e3), pe = (e) => {
|
|
144
144
|
l.value = null, f.value = ae(e), i.value || k.value ? j(f.value) : me(f.value);
|
|
145
145
|
}, x = async (e) => {
|
|
146
146
|
i.value || (e.preventDefault(), _(), await Ie(), c.value || (U(/* @__PURE__ */ new Date()), d(/* @__PURE__ */ new Date())), L.value = q.value?.$refs.calendarRef[0].focusOnDate(
|
|
@@ -164,7 +164,7 @@ const O = {
|
|
|
164
164
|
required: e.required
|
|
165
165
|
}, null, 8, ["id", "label", "tooltip-text", "optional", "required"])) : h("", !0),
|
|
166
166
|
ye("div", null, [
|
|
167
|
-
t(k) ? (u(), v(t(
|
|
167
|
+
t(k) ? (u(), v(t(Me), {
|
|
168
168
|
key: 0,
|
|
169
169
|
ref_key: "inputContainerRef",
|
|
170
170
|
ref: g,
|
|
@@ -180,7 +180,7 @@ const O = {
|
|
|
180
180
|
min: ie.value,
|
|
181
181
|
max: re.value,
|
|
182
182
|
"onUpdate:modelValue": ne
|
|
183
|
-
}, null, 8, ["type", "aria-labelledby", "aria-label", "aria-describedby", "aria-required", "disabled", "error-message", "model-value", "readonly", "min", "max"])) : (u(), v(t(
|
|
183
|
+
}, null, 8, ["type", "aria-labelledby", "aria-label", "aria-describedby", "aria-required", "disabled", "error-message", "model-value", "readonly", "min", "max"])) : (u(), v(t(we), {
|
|
184
184
|
key: 1,
|
|
185
185
|
ref_key: "inputContainerRef",
|
|
186
186
|
ref: g,
|
|
@@ -271,4 +271,4 @@ const O = {
|
|
|
271
271
|
export {
|
|
272
272
|
ia as B
|
|
273
273
|
};
|
|
274
|
-
//# sourceMappingURL=date-picker.
|
|
274
|
+
//# sourceMappingURL=date-picker.DwA7PxtZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.DjLNf7fF.js","sources":["../../../vue2/src/components/date-picker/composables/use-date-picker-single-calendar-text.ts","../../../vue2/src/components/date-picker/date-picker.vue"],"sourcesContent":["import { computed, ref } from 'vue';\nimport { useI18n } from '@/utils/ts/i18n';\nimport { type UseDateDisplayText } from './use-date-picker-single-calendar-text.types';\nimport { startOfMonth } from 'date-fns/startOfMonth';\nimport { getDateTimeFormatter } from '@/utils/ts/format-date/format-date';\nimport { useDateInputFormatter } from '@/composables/use-date-input-formatter/use-date-input-formatter';\nimport messages from '../messages.json';\n\ntype MessageSchema = (typeof messages)['en-US'];\n\n/**\n * Composable that sets and formats the date to be displayed in the input box of a Single Date Picker\n * @param option.datePickerValue Ref to the datePickerValue set in the DatePicker component\n * @param option.dateError The i18n message key for the current error, or null if valid\n * @param option.isMonthVariant Indicates if the date picker has variant \"month\"\n */\nexport const useDatePickerSingleCalendarText: UseDateDisplayText<Date> = ({\n datePickerValue,\n dateError,\n isMonthVariant,\n placeholder,\n}) => {\n const { locale, t } = useI18n<{ message: MessageSchema }>({ messages });\n const { formatDate } = useDateInputFormatter();\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 (dateError.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 placeholder?.value || (t('selectDate') as string);\n }\n\n // Display the date in format \"dd MMM, yyyy (25 Jun, 2023)\" or \"MMMM yyyy (June 2023)\"\n // if there's a valid date selected\n const dateFormatOptions: Intl.DateTimeFormatOptions = isMonthVariant?.value\n ? { month: 'long', year: 'numeric' }\n : { day: 'numeric', month: 'short', year: 'numeric' };\n\n return getDateTimeFormatter(locale.value, dateFormatOptions).format(datePickerValue.value);\n });\n\n /**\n * Formats the \"dateToFormat\" date value with the current format and sets it as \"formatTextInputDisplayValue\" value\n * @param 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 (dateError.value) {\n return;\n }\n\n if (!dateToFormat) {\n textInputValue.value = '';\n return;\n }\n\n const date = isMonthVariant?.value ? startOfMonth(dateToFormat) : dateToFormat;\n textInputValue.value = formatDate(date);\n };\n\n return {\n // Values\n dateDisplayValue,\n textInputValue,\n\n // Methods\n formatTextInputDisplayValue,\n };\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 <bento-input-field\n v-if=\"isTouchDevice\"\n ref=\"inputContainerRef\"\n :type=\"isMonthVariant ? 'month' : 'date'\"\n :aria-labelledby=\"label ? labelId : $attrs?.['aria-labelledby']\"\n :aria-label=\"label || $attrs?.['aria-labelledby'] ? null : popoverAriaLabel\"\n :aria-describedby=\"ariaDescribedBy\"\n :aria-required=\"required\"\n :disabled=\"disabled\"\n :error-message=\"inputErrorMessage\"\n :model-value=\"nativeValue\"\n :readonly=\"isReadOnly\"\n :min=\"formattedMin\"\n :max=\"formattedMax\"\n @update:model-value=\"onNativeDateInput\"\n />\n <dropdown-input-default\n v-else\n ref=\"inputContainerRef\"\n always-combobox-is-input\n :ariaControls=\"datePickerContainerId\"\n :ariaExpanded=\"isDatePickerOpen\"\n :aria-labelledby=\"label ? labelId : $attrs?.['aria-labelledby']\"\n :aria-label=\"label ? null : popoverAriaLabel\"\n :aria-describedby=\"ariaDescribedBy\"\n :aria-required=\"required\"\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=\"!isTouchDevice && dateErrorText && !errorMessage\"\n :id=\"dateErrorId\"\n :error-message=\"dateErrorText\"\n class=\"b-date-picker__error-message\"\n />\n <error-message\n v-if=\"!isTouchDevice && 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 && !isTouchDevice\"\n :id=\"datePickerContainerId\"\n class=\"b-date-picker__container\"\n role=\"dialog\"\n :open=\"isDatePickerOpen\"\n :target-element=\"inputContainerRef\"\n :aria-label=\"popoverAriaLabel\"\n :aria-modal=\"true\"\n position=\"bottom-start\"\n fallback-strategy=\"initialPlacement\"\n fit-content\n trap-all\n overflow-visible\n :trap-all-options=\"computedTrapAllOptions\"\n @keydown.esc.native=\"closeDatePicker\"\n >\n <calendar\n ref=\"calendarContainerRef\"\n :default-display-month=\"defaultDisplayMonth\"\n :first-day-of-week=\"resolvedFirstDayOfWeek\"\n :is-date-disabled=\"isDateDisabled\"\n :number-of-months=\"1\"\n :value=\"internalModelValue\"\n :min=\"min\"\n :max=\"max\"\n :variant=\"variant\"\n :year-range=\"yearRange\"\n @input=\"onDateSelected\"\n />\n </bento-popover>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, ref, toRef, watch } from 'vue';\n import { startOfMonth } from 'date-fns/startOfMonth';\n\n // Components\n import { BentoPopover } from '@/components/popover';\n import { BentoTypography } from '../typography';\n import { Calendar, type CalendarSingleDateValue, ErrorMessage, FieldLabel } from '@/internal';\n import { DropdownInputDefault } from '@/components/dropdown/components';\n import { BentoInputField } from '@/components/input-field';\n\n // Utils\n import { debounce } from '@/utils/ts/debounce';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { useI18n } from '@/utils/ts/i18n';\n import { dateToNativeDateString, dateToNativeMonthString, parseNativeDateString } from '@/utils/ts/format-date';\n import { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\n\n // Composables\n import { useDatePickerSingleCalendarText } from './composables/use-date-picker-single-calendar-text';\n import { useDateInputFormatter, useFirstDayOfWeek, useFormLayoutFieldLoading, useTouchDevice } from '@/composables';\n\n // Directive\n import { BentoClickOutsideDirective as vBentoClickOutsideDirective } from '@/directives';\n\n // Types\n import { type BentoDatePickerEmits, type BentoDatePickerProps } 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 const props = withDefaults(defineProps<BentoDatePickerProps>(), {\n defaultDisplayMonth: null,\n description: undefined,\n disabled: false,\n errorMessage: null,\n firstDayOfWeek: undefined,\n isDateDisabled: undefined,\n label: undefined,\n max: null,\n min: null,\n modelValue: null,\n optional: false,\n placeholder: null,\n readonly: false,\n required: false,\n tooltipText: null,\n variant: undefined, // Default will be set by @/internal/calendar\n yearRange: undefined,\n });\n\n const emit = defineEmits<BentoDatePickerEmits>();\n\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 dateError = ref<keyof MessageSchema | null>(null);\n const isDatePickerOpen = ref(false);\n const initialFocusOnDatePickerOpen = ref(undefined);\n const internalModelValue = ref<CalendarSingleDateValue | null>(props.modelValue);\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n const { emitValue } = useFormFieldEmits<CalendarSingleDateValue>(emit);\n const { resolvedFirstDayOfWeek } = useFirstDayOfWeek(toRef(props, 'firstDayOfWeek'));\n const { isFormatValid, parseDate, onKeyDown, autoFormat } = useDateInputFormatter();\n const { isTouchDevice } = useTouchDevice();\n\n const computedTrapAllOptions = computed(() => ({\n initialFocus: initialFocusOnDatePickerOpen.value,\n additionalContainers: [inputContainerRef.value.$el],\n }));\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 watch(\n () => props.modelValue,\n newModelValue => (internalModelValue.value = newModelValue),\n { immediate: true }\n );\n\n const isMonthVariant = computed(() => props.variant === 'month');\n\n const { dateDisplayValue, textInputValue, formatTextInputDisplayValue } = useDatePickerSingleCalendarText({\n datePickerValue: internalModelValue,\n dateError,\n isMonthVariant,\n placeholder: toRef(props, 'placeholder'),\n });\n\n const formatNativeDate = (date: Date): string => {\n if (!date) {\n return '';\n }\n return isMonthVariant.value ? dateToNativeMonthString(date) : dateToNativeDateString(date);\n };\n\n const nativeValue = computed(() => formatNativeDate(internalModelValue.value));\n\n const onNativeDateInput = (value: string) => {\n if (!value) {\n dateError.value = null;\n emitValue(null);\n return;\n }\n\n const date = parseNativeDateString(value, isMonthVariant.value ? 'month' : 'date');\n dateError.value = getDateErrorReason(date);\n\n if (dateError.value) {\n // Emit null to match the non-touch validation behavior.\n // Note: on repeated invalid selections, the native input may still display\n // the selected date because Vue skips re-rendering when the model stays null.\n emitValue(null);\n return;\n }\n\n emitValue(date);\n };\n\n const formattedMin = computed(() => formatNativeDate(props.min));\n const formattedMax = computed(() => formatNativeDate(props.max));\n\n const getDateErrorReason = (date: Date | null): keyof MessageSchema | null => {\n if (!date || isNaN(date.getTime())) {\n return 'invalidDateFormat';\n }\n\n // Check if date is between min/max bounds, if there are any (inclusive)\n if ((props.min && date < props.min) || (props.max && date > props.max)) {\n return 'invalidDateFormat';\n }\n\n // Check if function is set, otherwise all dates are enabled\n if (props.isDateDisabled && props.isDateDisabled(date)) {\n return 'selectedDateIsNotAvailable';\n }\n\n return null;\n };\n\n const dateErrorText = computed(() => (dateError.value ? t(dateError.value) : null));\n const inputErrorMessage = computed(() => props.errorMessage || dateErrorText.value);\n\n watch(\n [isDatePickerOpen, textInputValue, () => props.isDateDisabled, () => props.min, () => props.max],\n ([isOpen, textValue]) => {\n // Re-validate the current input when the picker closes, validation props change or text input change\n if (!isOpen && textValue && isFormatValid(textValue)) {\n dateError.value = getDateErrorReason(parseDate(textValue));\n }\n }\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 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 dateError.value = null;\n\n closeDatePicker();\n emitValue(selectedDate);\n };\n\n const clearDatePickerValue = async () => {\n if (dateError.value) {\n dateError.value = null;\n textInputValue.value = null;\n }\n emitValue(null);\n };\n\n const onDateKeyDown = (event: KeyboardEvent) => {\n onKeyDown(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 const parsedDate = isFormatValid(stringDate) ? parseDate(stringDate) : null;\n const errorKey = getDateErrorReason(parsedDate);\n\n if (!errorKey && parsedDate) {\n dateError.value = null;\n emitValue(parsedDate);\n } else if (stringDate) {\n dateError.value = errorKey || 'invalidDateFormat';\n emitValue(null);\n }\n };\n\n const validateDateDebounced = debounce(validateDate, DEBOUNCE_TIME);\n\n const onDateInputChange = (stringDate: string) => {\n dateError.value = null;\n textInputValue.value = autoFormat(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 // On touch devices with native input, we also want immediate feedback.\n if (isDatePickerOpen.value || isTouchDevice.value) {\n validateDate(textInputValue.value);\n } else {\n validateDateDebounced(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 (!internalModelValue.value) {\n // Format the opened date picker date to YYYY-MM-DD\n formatTextInputDisplayValue(new Date());\n emitValue(new Date());\n }\n\n // Set initial focus\n initialFocusOnDatePickerOpen.value =\n calendarContainerRef.value?.$refs.calendarRef[0].focusOnDate(\n props.variant === 'month' ? startOfMonth(internalModelValue.value) : internalModelValue.value,\n true\n ) ?? undefined;\n };\n</script>\n\n<script lang=\"ts\">\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 * 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 {\n i18n: { messages },\n name: 'bento-date-picker',\n model: { prop: 'modelValue', event: 'update:model-value' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./date-picker.scss\" />\n"],"names":["useDatePickerSingleCalendarText","datePickerValue","dateError","isMonthVariant","placeholder","locale","t","useI18n","messages","formatDate","useDateInputFormatter","textInputValue","ref","computed","dateFormatOptions","getDateTimeFormatter","dateToFormat","date","startOfMonth","__default__","props","__props","emit","__emit","datePickerContainerId","generateUid","labelId","descriptionId","errorId","dateErrorId","popoverAriaLabel","calendarContainerRef","inputContainerRef","isDatePickerOpen","initialFocusOnDatePickerOpen","internalModelValue","isReadOnly","useFormLayoutFieldLoading","toRef","emitValue","useFormFieldEmits","resolvedFirstDayOfWeek","useFirstDayOfWeek","isFormatValid","parseDate","onKeyDown","autoFormat","isTouchDevice","useTouchDevice","computedTrapAllOptions","watch","disabled","newModelValue","dateDisplayValue","formatTextInputDisplayValue","formatNativeDate","dateToNativeMonthString","dateToNativeDateString","nativeValue","onNativeDateInput","value","parseNativeDateString","getDateErrorReason","formattedMin","formattedMax","dateErrorText","inputErrorMessage","isOpen","textValue","descriptionConditionalClasses","ariaDescribedBy","closeDatePicker","openDatePicker","onDateSelected","selectedDate","clearDatePickerValue","onDateKeyDown","event","validateDate","stringDate","parsedDate","errorKey","validateDateDebounced","debounce","onDateInputChange","onSpaceBarOrEnter","nextTick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgBOA,KAAA,CAAA;AAAA,EAAmE,iBAAAC;AAAA,EACtE,WAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,aAAAC;AAEJ,MAAA;AACI,QAAA,EAAA,QAAAC,GAAA,GAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAC,EAAA,CAAA,GACA,EAAA,YAAAC,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAAX,EAAA,OAAA,aAAA,CAAA;AAyCA,SAAA;AAAA;AAAA,IAAO,kBAvCPY,EAAA,MAAA;AAEI,UAAAX,EAAA;AACI,eAAAS,EAAA;AAIJ,UAAA,CAAAV,EAAA;AACI,eAAAG,GAAA,SAAAE,EAAA,YAAA;AAKJ,YAAAQ,IAAAX,GAAA,QAAA,EAAA,OAAA,QAAA,MAAA,UAAA,IAAA,EAAA,KAAA,WAAA,OAAA,SAAA,MAAA,UAAA;AAIA,aAAAY,GAAAV,EAAA,OAAAS,CAAA,EAAA,OAAAb,EAAA,KAAA;AAAA,IAAyF,CAAA;AAAA,IAwBzF,gBAAAU;AAAA;AAAA,IACA,6BAlBJ,CAAAK,IAAAf,EAAA,UAA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AA,SAAA;AACI;AAGJ,YAAAC,IAAArC,EAAAoC,CAAA,IAAAnC,EAAAmC,CAAA,IAAA,MACAE,IAAAnB,EAAAkB,CAAA;AAEA,MAAA,CAAAC,KAAAD,KACI9E,EAAA,QAAA,MACAqC,EAAAyC,CAAA,KAAoBD,MAEpB7E,EAAA,QAAA+E,KAAA,qBACA1C,EAAA,IAAA;AAAA,IACJ,GAGJ2C,KAAAC,GAAAL,GAAA,GAAA,GAEAM,KAAA,CAAAL,MAAA;AACI,MAAA7E,EAAA,QAAA,MACAS,EAAA,QAAAmC,GAAAiC,CAAA,GAGA9C,EAAA,SAAAc,EAAA,QACI+B,EAAAnE,EAAA,KAAA,IAEAuE,GAAAvE,EAAA,KAAA;AAAA,IACJ,GAUJ0E,IAAA,OAAAR,MAAA;AACI,MAAA5C,EAAA,UAGA4C,EAAA,eAAA,GAEAL,EAAA,GAGA,MAAAc,GAAA,GAGAnD,EAAA,UAEImB,EAAA,oBAAA,KAAA,CAAA,GACAf,EAAA,oBAAA,KAAA,CAAA,IAIJL,EAAA,QAAAH,EAAA,OAAA,MAAA,YAAA,CAAA,EAAA;AAAA,QACqDX,EAAA,YAAA,UAAAF,EAAAiB,EAAA,KAAA,IAAAA,EAAA;AAAA,QAC2C;AAAA,MACxF,KAAA;AAAA,IACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"date-picker.DwA7PxtZ.js","sources":["../../../vue2/src/components/date-picker/composables/use-date-picker-single-calendar-text.ts","../../../vue2/src/components/date-picker/date-picker.vue"],"sourcesContent":["import { computed, ref } from 'vue';\nimport { useI18n } from '@/utils/ts/i18n';\nimport { type UseDateDisplayText } from './use-date-picker-single-calendar-text.types';\nimport { startOfMonth } from 'date-fns/startOfMonth';\nimport { getDateTimeFormatter } from '@/utils/ts/format-date/format-date';\nimport { useDateInputFormatter } from '@/composables/use-date-input-formatter/use-date-input-formatter';\nimport messages from '../messages.json';\n\ntype MessageSchema = (typeof messages)['en-US'];\n\n/**\n * Composable that sets and formats the date to be displayed in the input box of a Single Date Picker\n * @param option.datePickerValue Ref to the datePickerValue set in the DatePicker component\n * @param option.dateError The i18n message key for the current error, or null if valid\n * @param option.isMonthVariant Indicates if the date picker has variant \"month\"\n */\nexport const useDatePickerSingleCalendarText: UseDateDisplayText<Date> = ({\n datePickerValue,\n dateError,\n isMonthVariant,\n placeholder,\n}) => {\n const { locale, t } = useI18n<{ message: MessageSchema }>({ messages });\n const { formatDate } = useDateInputFormatter();\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 (dateError.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 placeholder?.value || (t('selectDate') as string);\n }\n\n // Display the date in format \"dd MMM, yyyy (25 Jun, 2023)\" or \"MMMM yyyy (June 2023)\"\n // if there's a valid date selected\n const dateFormatOptions: Intl.DateTimeFormatOptions = isMonthVariant?.value\n ? { month: 'long', year: 'numeric' }\n : { day: 'numeric', month: 'short', year: 'numeric' };\n\n return getDateTimeFormatter(locale.value, dateFormatOptions).format(datePickerValue.value);\n });\n\n /**\n * Formats the \"dateToFormat\" date value with the current format and sets it as \"formatTextInputDisplayValue\" value\n * @param 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 (dateError.value) {\n return;\n }\n\n if (!dateToFormat) {\n textInputValue.value = '';\n return;\n }\n\n const date = isMonthVariant?.value ? startOfMonth(dateToFormat) : dateToFormat;\n textInputValue.value = formatDate(date);\n };\n\n return {\n // Values\n dateDisplayValue,\n textInputValue,\n\n // Methods\n formatTextInputDisplayValue,\n };\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 <bento-input-field\n v-if=\"isTouchDevice\"\n ref=\"inputContainerRef\"\n :type=\"isMonthVariant ? 'month' : 'date'\"\n :aria-labelledby=\"label ? labelId : $attrs?.['aria-labelledby']\"\n :aria-label=\"label || $attrs?.['aria-labelledby'] ? null : popoverAriaLabel\"\n :aria-describedby=\"ariaDescribedBy\"\n :aria-required=\"required\"\n :disabled=\"disabled\"\n :error-message=\"inputErrorMessage\"\n :model-value=\"nativeValue\"\n :readonly=\"isReadOnly\"\n :min=\"formattedMin\"\n :max=\"formattedMax\"\n @update:model-value=\"onNativeDateInput\"\n />\n <dropdown-input-default\n v-else\n ref=\"inputContainerRef\"\n always-combobox-is-input\n :ariaControls=\"datePickerContainerId\"\n :ariaExpanded=\"isDatePickerOpen\"\n :aria-labelledby=\"label ? labelId : $attrs?.['aria-labelledby']\"\n :aria-label=\"label ? null : popoverAriaLabel\"\n :aria-describedby=\"ariaDescribedBy\"\n :aria-required=\"required\"\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=\"!isTouchDevice && dateErrorText && !errorMessage\"\n :id=\"dateErrorId\"\n :error-message=\"dateErrorText\"\n class=\"b-date-picker__error-message\"\n />\n <error-message\n v-if=\"!isTouchDevice && 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 && !isTouchDevice\"\n :id=\"datePickerContainerId\"\n class=\"b-date-picker__container\"\n role=\"dialog\"\n :open=\"isDatePickerOpen\"\n :target-element=\"inputContainerRef\"\n :aria-label=\"popoverAriaLabel\"\n :aria-modal=\"true\"\n position=\"bottom-start\"\n fallback-strategy=\"initialPlacement\"\n fit-content\n trap-all\n overflow-visible\n :trap-all-options=\"computedTrapAllOptions\"\n @keydown.esc.native=\"closeDatePicker\"\n >\n <calendar\n ref=\"calendarContainerRef\"\n :default-display-month=\"defaultDisplayMonth\"\n :first-day-of-week=\"resolvedFirstDayOfWeek\"\n :is-date-disabled=\"isDateDisabled\"\n :number-of-months=\"1\"\n :value=\"internalModelValue\"\n :min=\"min\"\n :max=\"max\"\n :variant=\"variant\"\n :year-range=\"yearRange\"\n @input=\"onDateSelected\"\n />\n </bento-popover>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, ref, toRef, watch } from 'vue';\n import { startOfMonth } from 'date-fns/startOfMonth';\n\n // Components\n import { BentoPopover } from '@/components/popover';\n import { BentoTypography } from '../typography';\n import { Calendar, type CalendarSingleDateValue, ErrorMessage, FieldLabel } from '@/internal';\n import { DropdownInputDefault } from '@/components/dropdown/components';\n import { BentoInputField } from '@/components/input-field';\n\n // Utils\n import { debounce } from '@/utils/ts/debounce';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { useI18n } from '@/utils/ts/i18n';\n import { dateToNativeDateString, dateToNativeMonthString, parseNativeDateString } from '@/utils/ts/format-date';\n import { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\n\n // Composables\n import { useDatePickerSingleCalendarText } from './composables/use-date-picker-single-calendar-text';\n import { useDateInputFormatter, useFirstDayOfWeek, useFormLayoutFieldLoading, useTouchDevice } from '@/composables';\n\n // Directive\n import { BentoClickOutsideDirective as vBentoClickOutsideDirective } from '@/directives';\n\n // Types\n import { type BentoDatePickerEmits, type BentoDatePickerProps } 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 const props = withDefaults(defineProps<BentoDatePickerProps>(), {\n defaultDisplayMonth: null,\n description: undefined,\n disabled: false,\n errorMessage: null,\n firstDayOfWeek: undefined,\n isDateDisabled: undefined,\n label: undefined,\n max: null,\n min: null,\n modelValue: null,\n optional: false,\n placeholder: null,\n readonly: false,\n required: false,\n tooltipText: null,\n variant: undefined, // Default will be set by @/internal/calendar\n yearRange: undefined,\n });\n\n const emit = defineEmits<BentoDatePickerEmits>();\n\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 dateError = ref<keyof MessageSchema | null>(null);\n const isDatePickerOpen = ref(false);\n const initialFocusOnDatePickerOpen = ref(undefined);\n const internalModelValue = ref<CalendarSingleDateValue | null>(props.modelValue);\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n const { emitValue } = useFormFieldEmits<CalendarSingleDateValue>(emit);\n const { resolvedFirstDayOfWeek } = useFirstDayOfWeek(toRef(props, 'firstDayOfWeek'));\n const { isFormatValid, parseDate, onKeyDown, autoFormat } = useDateInputFormatter();\n const { isTouchDevice } = useTouchDevice();\n\n const computedTrapAllOptions = computed(() => ({\n initialFocus: initialFocusOnDatePickerOpen.value,\n additionalContainers: [inputContainerRef.value.$el],\n }));\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 watch(\n () => props.modelValue,\n newModelValue => (internalModelValue.value = newModelValue),\n { immediate: true }\n );\n\n const isMonthVariant = computed(() => props.variant === 'month');\n\n const { dateDisplayValue, textInputValue, formatTextInputDisplayValue } = useDatePickerSingleCalendarText({\n datePickerValue: internalModelValue,\n dateError,\n isMonthVariant,\n placeholder: toRef(props, 'placeholder'),\n });\n\n const formatNativeDate = (date: Date): string => {\n if (!date) {\n return '';\n }\n return isMonthVariant.value ? dateToNativeMonthString(date) : dateToNativeDateString(date);\n };\n\n const nativeValue = computed(() => formatNativeDate(internalModelValue.value));\n\n const onNativeDateInput = (value: string) => {\n if (!value) {\n dateError.value = null;\n emitValue(null);\n return;\n }\n\n const date = parseNativeDateString(value, isMonthVariant.value ? 'month' : 'date');\n dateError.value = getDateErrorReason(date);\n\n if (dateError.value) {\n // Emit null to match the non-touch validation behavior.\n // Note: on repeated invalid selections, the native input may still display\n // the selected date because Vue skips re-rendering when the model stays null.\n emitValue(null);\n return;\n }\n\n emitValue(date);\n };\n\n const formattedMin = computed(() => formatNativeDate(props.min));\n const formattedMax = computed(() => formatNativeDate(props.max));\n\n const getDateErrorReason = (date: Date | null): keyof MessageSchema | null => {\n if (!date || isNaN(date.getTime())) {\n return 'invalidDateFormat';\n }\n\n // Check if date is between min/max bounds, if there are any (inclusive)\n if ((props.min && date < props.min) || (props.max && date > props.max)) {\n return 'invalidDateFormat';\n }\n\n // Check if function is set, otherwise all dates are enabled\n if (props.isDateDisabled && props.isDateDisabled(date)) {\n return 'selectedDateIsNotAvailable';\n }\n\n return null;\n };\n\n const dateErrorText = computed(() => (dateError.value ? t(dateError.value) : null));\n const inputErrorMessage = computed(() => props.errorMessage || dateErrorText.value);\n\n watch(\n [isDatePickerOpen, textInputValue, () => props.isDateDisabled, () => props.min, () => props.max],\n ([isOpen, textValue]) => {\n // Re-validate the current input when the picker closes, validation props change or text input change\n if (!isOpen && textValue && isFormatValid(textValue)) {\n dateError.value = getDateErrorReason(parseDate(textValue));\n }\n }\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 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 dateError.value = null;\n\n closeDatePicker();\n emitValue(selectedDate);\n };\n\n const clearDatePickerValue = async () => {\n if (dateError.value) {\n dateError.value = null;\n textInputValue.value = null;\n }\n emitValue(null);\n };\n\n const onDateKeyDown = (event: KeyboardEvent) => {\n onKeyDown(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 const parsedDate = isFormatValid(stringDate) ? parseDate(stringDate) : null;\n const errorKey = getDateErrorReason(parsedDate);\n\n if (!errorKey && parsedDate) {\n dateError.value = null;\n emitValue(parsedDate);\n } else if (stringDate) {\n dateError.value = errorKey || 'invalidDateFormat';\n emitValue(null);\n }\n };\n\n const validateDateDebounced = debounce(validateDate, DEBOUNCE_TIME);\n\n const onDateInputChange = (stringDate: string) => {\n dateError.value = null;\n textInputValue.value = autoFormat(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 // On touch devices with native input, we also want immediate feedback.\n if (isDatePickerOpen.value || isTouchDevice.value) {\n validateDate(textInputValue.value);\n } else {\n validateDateDebounced(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 (!internalModelValue.value) {\n // Format the opened date picker date to YYYY-MM-DD\n formatTextInputDisplayValue(new Date());\n emitValue(new Date());\n }\n\n // Set initial focus\n initialFocusOnDatePickerOpen.value =\n calendarContainerRef.value?.$refs.calendarRef[0].focusOnDate(\n props.variant === 'month' ? startOfMonth(internalModelValue.value) : internalModelValue.value,\n true\n ) ?? undefined;\n };\n</script>\n\n<script lang=\"ts\">\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 * 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 {\n i18n: { messages },\n name: 'bento-date-picker',\n model: { prop: 'modelValue', event: 'update:model-value' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./date-picker.scss\" />\n"],"names":["useDatePickerSingleCalendarText","datePickerValue","dateError","isMonthVariant","placeholder","locale","t","useI18n","messages","formatDate","useDateInputFormatter","textInputValue","ref","computed","dateFormatOptions","getDateTimeFormatter","dateToFormat","date","startOfMonth","__default__","props","__props","emit","__emit","datePickerContainerId","generateUid","labelId","descriptionId","errorId","dateErrorId","popoverAriaLabel","calendarContainerRef","inputContainerRef","isDatePickerOpen","initialFocusOnDatePickerOpen","internalModelValue","isReadOnly","useFormLayoutFieldLoading","toRef","emitValue","useFormFieldEmits","resolvedFirstDayOfWeek","useFirstDayOfWeek","isFormatValid","parseDate","onKeyDown","autoFormat","isTouchDevice","useTouchDevice","computedTrapAllOptions","watch","disabled","newModelValue","dateDisplayValue","formatTextInputDisplayValue","formatNativeDate","dateToNativeMonthString","dateToNativeDateString","nativeValue","onNativeDateInput","value","parseNativeDateString","getDateErrorReason","formattedMin","formattedMax","dateErrorText","inputErrorMessage","isOpen","textValue","descriptionConditionalClasses","ariaDescribedBy","closeDatePicker","openDatePicker","onDateSelected","selectedDate","clearDatePickerValue","onDateKeyDown","event","validateDate","stringDate","parsedDate","errorKey","validateDateDebounced","debounce","onDateInputChange","onSpaceBarOrEnter","nextTick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgBOA,KAAA,CAAA;AAAA,EAAmE,iBAAAC;AAAA,EACtE,WAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,aAAAC;AAEJ,MAAA;AACI,QAAA,EAAA,QAAAC,GAAA,GAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAC,EAAA,CAAA,GACA,EAAA,YAAAC,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAAX,EAAA,OAAA,aAAA,CAAA;AAyCA,SAAA;AAAA;AAAA,IAAO,kBAvCPY,EAAA,MAAA;AAEI,UAAAX,EAAA;AACI,eAAAS,EAAA;AAIJ,UAAA,CAAAV,EAAA;AACI,eAAAG,GAAA,SAAAE,EAAA,YAAA;AAKJ,YAAAQ,IAAAX,GAAA,QAAA,EAAA,OAAA,QAAA,MAAA,UAAA,IAAA,EAAA,KAAA,WAAA,OAAA,SAAA,MAAA,UAAA;AAIA,aAAAY,GAAAV,EAAA,OAAAS,CAAA,EAAA,OAAAb,EAAA,KAAA;AAAA,IAAyF,CAAA;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hC,GAAAgC,CAAA;AAAA,IAAe,GAGnBC,IAAA,CAAAC,MAAA;AAEI,UAAAA,EAAA,SAAA;AACI;AAGJ,YAAAC,IAAArC,EAAAoC,CAAA,IAAAnC,EAAAmC,CAAA,IAAA,MACAE,IAAAnB,EAAAkB,CAAA;AAEA,MAAA,CAAAC,KAAAD,KACI9E,EAAA,QAAA,MACAqC,EAAAyC,CAAA,KAAoBD,MAEpB7E,EAAA,QAAA+E,KAAA,qBACA1C,EAAA,IAAA;AAAA,IACJ,GAGJ2C,KAAAC,GAAAL,GAAA,GAAA,GAEAM,KAAA,CAAAL,MAAA;AACI,MAAA7E,EAAA,QAAA,MACAS,EAAA,QAAAmC,GAAAiC,CAAA,GAGA9C,EAAA,SAAAc,EAAA,QACI+B,EAAAnE,EAAA,KAAA,IAEAuE,GAAAvE,EAAA,KAAA;AAAA,IACJ,GAUJ0E,IAAA,OAAAR,MAAA;AACI,MAAA5C,EAAA,UAGA4C,EAAA,eAAA,GAEAL,EAAA,GAGA,MAAAc,GAAA,GAGAnD,EAAA,UAEImB,EAAA,oBAAA,KAAA,CAAA,GACAf,EAAA,oBAAA,KAAA,CAAA,IAIJL,EAAA,QAAAH,EAAA,OAAA,MAAA,YAAA,CAAA,EAAA;AAAA,QACqDX,EAAA,YAAA,UAAAF,EAAAiB,EAAA,KAAA,IAAAA,EAAA;AAAA,QAC2C;AAAA,MACxF,KAAA;AAAA,IACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,17 +3,17 @@ import { d as Ca, h as Va } from "./index.DCpihRYV.js";
|
|
|
3
3
|
import { B as La } from "./divider.BlxQCxkM.js";
|
|
4
4
|
import { h as _a, B as Wa } from "./button-actions.DvuGEQxM.js";
|
|
5
5
|
import { B as Qe, p as Ua } from "./typography.B6elnWpr.js";
|
|
6
|
-
import { B as Qa, g as na, D as $a } from "./dropdown.BvrZG8Za.js";
|
|
7
6
|
import { g as fe } from "./generate-uid.DBWe4g6T.js";
|
|
8
7
|
import { u as Ge } from "./index.CGBfMQdv.js";
|
|
9
|
-
import { B as
|
|
10
|
-
import { j as ye, k as z, s as w, l as
|
|
8
|
+
import { B as Qa, s as Ma, i as na } from "./input-time.ClwtIJrn.js";
|
|
9
|
+
import { j as ye, k as z, s as w, l as $a, m as ra, n as Ga, f as sa, o as ja, q as Ja, r as Ha, t as oa, u as Ka, b as V, v as Xa, e as b, h as Za, i as et, w as la, x as ia, g as at } from "./calendar.0d9D-nmt.js";
|
|
11
10
|
import { s as Ee, a as ke } from "./set-time-in-date.DVo8R8w-.js";
|
|
12
|
-
import { u as je, a as
|
|
13
|
-
import { t as Pe, n as
|
|
14
|
-
import { u as
|
|
15
|
-
import { B as
|
|
16
|
-
import { u as
|
|
11
|
+
import { u as je, a as tt } from "./use-date-input-formatter.ByQ6j4AU.js";
|
|
12
|
+
import { t as Pe, n as nt, c as rt } from "./en-US.C412g-7U.js";
|
|
13
|
+
import { u as st } from "./use-form-layout-loading.CWbjZiwP.js";
|
|
14
|
+
import { B as ot } from "./directive.D1-d-C2K.js";
|
|
15
|
+
import { u as lt } from "./form-field.B60VsF8d.js";
|
|
16
|
+
import { B as it, g as ua, D as ut } from "./dropdown.CpcbBlcE.js";
|
|
17
17
|
import { B as dt } from "./alert.BYmn1ewo.js";
|
|
18
18
|
import { B as ct } from "./segmented-control.CarI0i3p.js";
|
|
19
19
|
import { u as mt } from "./use-has-slot.CyMiImRQ.js";
|
|
@@ -21,7 +21,7 @@ import { u as Dt } from "./use-touch-device.DTqFAbXh.js";
|
|
|
21
21
|
import { e as W, a as da } from "./differenceInMonths.CPDkGea3.js";
|
|
22
22
|
import { s as ca } from "./startOfWeek.CzdYFzXX.js";
|
|
23
23
|
import { c as vt } from "./constructNow.Dl44Mvpp.js";
|
|
24
|
-
import { B as pt } from "./input-field.
|
|
24
|
+
import { B as pt } from "./input-field.CNYZ-qxB.js";
|
|
25
25
|
import { B as ft } from "./form-layout-group.B9Kzae5F.js";
|
|
26
26
|
import { _ as ya } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
27
27
|
import { F as gt } from "./field-label.vrUwhoOg.js";
|
|
@@ -35,7 +35,7 @@ function ge(s, v) {
|
|
|
35
35
|
return +Pe(s) == +Pe(v);
|
|
36
36
|
}
|
|
37
37
|
function yt(s, v, T) {
|
|
38
|
-
const [d, c] =
|
|
38
|
+
const [d, c] = nt(
|
|
39
39
|
T?.in,
|
|
40
40
|
s,
|
|
41
41
|
v
|
|
@@ -51,7 +51,7 @@ function We(s, v) {
|
|
|
51
51
|
}
|
|
52
52
|
function ht(s, v) {
|
|
53
53
|
return z(
|
|
54
|
-
|
|
54
|
+
rt(s, s),
|
|
55
55
|
vt(s)
|
|
56
56
|
);
|
|
57
57
|
}
|
|
@@ -87,7 +87,7 @@ const Tt = {
|
|
|
87
87
|
"onUpdate:modelValue": e[1] || (e[1] = (l) => c.$emit("update:date-model-value", l)),
|
|
88
88
|
onKeydown: e[2] || (e[2] = (l) => c.$emit("date:keydown", l))
|
|
89
89
|
}), null, 16, ["model-value"]),
|
|
90
|
-
c.showTimeInput ? (E(), L(i(
|
|
90
|
+
c.showTimeInput ? (E(), L(i(Qa), ea({ key: 0 }, d.value, {
|
|
91
91
|
"model-value": c.timeModelValue,
|
|
92
92
|
onClick: e[3] || (e[3] = (l) => c.$emit("click")),
|
|
93
93
|
"onUpdate:modelValue": e[4] || (e[4] = (l) => c.$emit("update:time-model-value", l)),
|
|
@@ -111,27 +111,27 @@ const Tt = {
|
|
|
111
111
|
e = w(c.earliest);
|
|
112
112
|
else if (e) {
|
|
113
113
|
const f = ca(e, { weekStartsOn: s });
|
|
114
|
-
z(e, f) || (e = w(
|
|
114
|
+
z(e, f) || (e = w($a(ra(e, { weekStartsOn: s }), 1)));
|
|
115
115
|
}
|
|
116
116
|
if (c.latest)
|
|
117
117
|
l = W(c.latest);
|
|
118
118
|
else if (l) {
|
|
119
|
-
const f =
|
|
120
|
-
z(l, f) || (l = W(
|
|
119
|
+
const f = ra(l, { weekStartsOn: s });
|
|
120
|
+
z(l, f) || (l = W(Ga(ca(l, { weekStartsOn: s }), 1)));
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
if (c?.type === "monthly") {
|
|
124
124
|
if (c.earliest)
|
|
125
125
|
e = w(c.earliest);
|
|
126
126
|
else if (e) {
|
|
127
|
-
const f =
|
|
128
|
-
z(e, f) || (e =
|
|
127
|
+
const f = sa(e);
|
|
128
|
+
z(e, f) || (e = sa(ja(e, 1)));
|
|
129
129
|
}
|
|
130
130
|
if (c.latest)
|
|
131
131
|
l = W(c.latest);
|
|
132
132
|
else if (l) {
|
|
133
133
|
const f = da(l);
|
|
134
|
-
z(l, f) || (l = da(
|
|
134
|
+
z(l, f) || (l = da(Ja(l, 1)));
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
if (c?.type === "quarterly") {
|
|
@@ -139,13 +139,13 @@ const Tt = {
|
|
|
139
139
|
e = ye(c.earliest);
|
|
140
140
|
else if (e) {
|
|
141
141
|
const f = ye(e);
|
|
142
|
-
z(e, f) || (e = ye(
|
|
142
|
+
z(e, f) || (e = ye(Ha(e, 1)));
|
|
143
143
|
}
|
|
144
144
|
if (c.latest)
|
|
145
145
|
l = W(c.latest);
|
|
146
146
|
else if (l) {
|
|
147
|
-
const f =
|
|
148
|
-
z(l, f) || (l =
|
|
147
|
+
const f = oa(l);
|
|
148
|
+
z(l, f) || (l = oa(Ka(l, 1)));
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
return { min: e, max: l };
|
|
@@ -168,17 +168,17 @@ const Tt = {
|
|
|
168
168
|
};
|
|
169
169
|
var D = /* @__PURE__ */ ((s) => (s.CUSTOM_RANGE = "custom-range", s.INPUT = "input", s.ERROR = "error", s.FORM_DATE = "form-date", s.START_DATE_SELECTED = "start-date-selected", s))(D || {});
|
|
170
170
|
const ha = {
|
|
171
|
-
"de-DE": { "DD-MM-YYYY": "TT-MM-JJJJ", "MM-DD-YYYY": "MM-TT-JJJJ", "YYYY-MM-DD": "JJJJ-MM-TT", customRange: "Benutzerdefinierter Bereich", daily: "Täglich", dateFrom: "Datum von", dateTo: "Datum bis", invalidDateFormat: "Ungültiges Datumsformat", lastMonth: "Letzter Monat", lastSevenDays: "Letzte 7 Tage", lastThreeMonths: "Letzte drei Monate", maxRangeDays: "Sie können bis zu {count} Tag auswählen | Sie können bis zu {count} Tage auswählen", maxRangeMonths: "Sie können bis zu {count} Monat auswählen | Sie können bis zu {count} Monate auswählen", maxRangeQuarters: "Sie können bis zu {count} Quartal auswählen | Sie können bis zu {count} Quartale auswählen", maxRangeWeeks: "Sie können bis zu {count} Woche auswählen | Sie können bis zu {count} Wochen auswählen", monthly: "Monatlich", quarterly: "Vierteljährlich", selectedDateIsNotAvailable: "Ausgewähltes Datum ist nicht verfügbar", startDateMustPrecedeEndDate: "Das Anfangsdatum muss vor dem Enddatum liegen", timeFrom: "Zeit von", timeTo: "Zeit bis", weekly: "Wöchentlich" },
|
|
172
|
-
"en-GB": { "DD-MM-YYYY": "DD-MM-YYYY", "MM-DD-YYYY": "MM-DD-YYYY", "YYYY-MM-DD": "YYYY-MM-DD", customRange: "Custom range", daily: "Daily", dateFrom: "Date from", dateTo: "Date to", invalidDateFormat: "Invalid date format", lastMonth: "Last month", lastSevenDays: "Last 7 days", lastThreeMonths: "The last three months", maxRangeDays: "You can select up to {count} day | You can select up to {count} days", maxRangeMonths: "You can select up to {count} month | You can select up to {count} months", maxRangeQuarters: "You can select up to {count} quarter | You can select up to {count} quarters", maxRangeWeeks: "You can select up to {count} week | You can select up to {count} weeks", monthly: "Monthly", quarterly: "Quarterly", selectedDateIsNotAvailable: "Selected date is not available", startDateMustPrecedeEndDate: "Start date must precede end date", timeFrom: "Time from", timeTo: "Time to", weekly: "Weekly" },
|
|
171
|
+
"de-DE": { "DD-MM-YYYY": "TT-MM-JJJJ", "MM-DD-YYYY": "MM-TT-JJJJ", "YYYY-MM-DD": "JJJJ-MM-TT", customRange: "Benutzerdefinierter Bereich", daily: "Täglich", dateFrom: "Datum von", dateTo: "Datum bis", from: "Von", invalidDateFormat: "Ungültiges Datumsformat", lastMonth: "Letzter Monat", lastSevenDays: "Letzte 7 Tage", lastThreeMonths: "Letzte drei Monate", maxRangeDays: "Sie können bis zu {count} Tag auswählen | Sie können bis zu {count} Tage auswählen", maxRangeMonths: "Sie können bis zu {count} Monat auswählen | Sie können bis zu {count} Monate auswählen", maxRangeQuarters: "Sie können bis zu {count} Quartal auswählen | Sie können bis zu {count} Quartale auswählen", maxRangeWeeks: "Sie können bis zu {count} Woche auswählen | Sie können bis zu {count} Wochen auswählen", monthly: "Monatlich", quarterly: "Vierteljährlich", selectedDateIsNotAvailable: "Ausgewähltes Datum ist nicht verfügbar", startDateMustPrecedeEndDate: "Das Anfangsdatum muss vor dem Enddatum liegen", timeFrom: "Zeit von", timeTo: "Zeit bis", to: "Bis", weekly: "Wöchentlich" },
|
|
172
|
+
"en-GB": { "DD-MM-YYYY": "DD-MM-YYYY", "MM-DD-YYYY": "MM-DD-YYYY", "YYYY-MM-DD": "YYYY-MM-DD", customRange: "Custom range", daily: "Daily", dateFrom: "Date from", dateTo: "Date to", from: "From", invalidDateFormat: "Invalid date format", lastMonth: "Last month", lastSevenDays: "Last 7 days", lastThreeMonths: "The last three months", maxRangeDays: "You can select up to {count} day | You can select up to {count} days", maxRangeMonths: "You can select up to {count} month | You can select up to {count} months", maxRangeQuarters: "You can select up to {count} quarter | You can select up to {count} quarters", maxRangeWeeks: "You can select up to {count} week | You can select up to {count} weeks", monthly: "Monthly", quarterly: "Quarterly", selectedDateIsNotAvailable: "Selected date is not available", startDateMustPrecedeEndDate: "Start date must precede end date", timeFrom: "Time from", timeTo: "Time to", to: "To", weekly: "Weekly" },
|
|
173
173
|
"en-US": { "DD-MM-YYYY": "DD-MM-YYYY", "MM-DD-YYYY": "MM-DD-YYYY", "YYYY-MM-DD": "YYYY-MM-DD", customRange: "Custom range", daily: "Daily", dateFrom: "Date from", dateTo: "Date to", from: "From", invalidDateFormat: "Invalid date format", lastMonth: "Last month", lastSevenDays: "Last 7 days", lastThreeMonths: "Last three months", maxRangeDays: "You can select up to {count} day | You can select up to {count} days", maxRangeMonths: "You can select up to {count} month | You can select up to {count} months", maxRangeQuarters: "You can select up to {count} quarter | You can select up to {count} quarters", maxRangeWeeks: "You can select up to {count} week | You can select up to {count} weeks", monthly: "Monthly", quarterly: "Quarterly", selectedDateIsNotAvailable: "Selected date is not available", startDateMustPrecedeEndDate: "Start date must precede end date", timeFrom: "Time from", timeTo: "Time to", to: "To", weekly: "Weekly" },
|
|
174
|
-
"es-419": { "DD-MM-YYYY": "DD-MM-AAAA", "MM-DD-YYYY": "MM-DD-AAAA", "YYYY-MM-DD": "AAAA-MM-DD", customRange: "Rango personalizado", daily: "Diario", dateFrom: "Fecha desde", dateTo: "Fecha hasta", invalidDateFormat: "Formato de fecha no válido", lastMonth: "El mes pasado", lastSevenDays: "Últimos 7 días", lastThreeMonths: "Últimos tres meses", maxRangeDays: "Puedes seleccionar hasta {count} día | Puedes seleccionar hasta {count} días", maxRangeMonths: "Puedes seleccionar hasta {count} mes | Puedes seleccionar hasta {count} meses", maxRangeQuarters: "Puedes seleccionar hasta {count} trimestre | Puedes seleccionar hasta {count} trimestres", maxRangeWeeks: "Puedes seleccionar hasta {count} semana | Puedes seleccionar hasta {count} semanas", monthly: "Mensual", quarterly: "Trimestral", selectedDateIsNotAvailable: "La fecha seleccionada no está disponible", startDateMustPrecedeEndDate: "La fecha de inicio debe ser anterior a la fecha de finalización", timeFrom: "Tiempo desde", timeTo: "Es hora de", weekly: "Semanal" },
|
|
175
|
-
"es-ES": { "DD-MM-YYYY": "DD-MM-AAAA", "MM-DD-YYYY": "MM-DD-AAAA", "YYYY-MM-DD": "AAAA-MM-DD", customRange: "Rango personalizado", daily: "Diario", dateFrom: "Fecha desde", dateTo: "Fecha hasta", invalidDateFormat: "Formato de fecha no válido", lastMonth: "El mes pasado", lastSevenDays: "Últimos 7 días", lastThreeMonths: "Últimos tres meses", maxRangeDays: "Puedes seleccionar hasta {count} día | Puedes seleccionar hasta {count} días", maxRangeMonths: "Puedes seleccionar hasta {count} mes | Puedes seleccionar hasta {count} meses", maxRangeQuarters: "Puedes seleccionar hasta {count} trimestre | Puedes seleccionar hasta {count} trimestres", maxRangeWeeks: "Puedes seleccionar hasta {count} semana | Puedes seleccionar hasta {count} semanas", monthly: "Mensualmente", quarterly: "Trimestral", selectedDateIsNotAvailable: "La fecha seleccionada no está disponible", startDateMustPrecedeEndDate: "La fecha de inicio debe ser anterior a la fecha de finalización", timeFrom: "Hora desde", timeTo: "Hora hasta", weekly: "Semanal" },
|
|
174
|
+
"es-419": { "DD-MM-YYYY": "DD-MM-AAAA", "MM-DD-YYYY": "MM-DD-AAAA", "YYYY-MM-DD": "AAAA-MM-DD", customRange: "Rango personalizado", daily: "Diario", dateFrom: "Fecha desde", dateTo: "Fecha hasta", from: "Desde", invalidDateFormat: "Formato de fecha no válido", lastMonth: "El mes pasado", lastSevenDays: "Últimos 7 días", lastThreeMonths: "Últimos tres meses", maxRangeDays: "Puedes seleccionar hasta {count} día | Puedes seleccionar hasta {count} días", maxRangeMonths: "Puedes seleccionar hasta {count} mes | Puedes seleccionar hasta {count} meses", maxRangeQuarters: "Puedes seleccionar hasta {count} trimestre | Puedes seleccionar hasta {count} trimestres", maxRangeWeeks: "Puedes seleccionar hasta {count} semana | Puedes seleccionar hasta {count} semanas", monthly: "Mensual", quarterly: "Trimestral", selectedDateIsNotAvailable: "La fecha seleccionada no está disponible", startDateMustPrecedeEndDate: "La fecha de inicio debe ser anterior a la fecha de finalización", timeFrom: "Tiempo desde", timeTo: "Es hora de", to: "Hasta", weekly: "Semanal" },
|
|
175
|
+
"es-ES": { "DD-MM-YYYY": "DD-MM-AAAA", "MM-DD-YYYY": "MM-DD-AAAA", "YYYY-MM-DD": "AAAA-MM-DD", customRange: "Rango personalizado", daily: "Diario", dateFrom: "Fecha desde", dateTo: "Fecha hasta", from: "Desde", invalidDateFormat: "Formato de fecha no válido", lastMonth: "El mes pasado", lastSevenDays: "Últimos 7 días", lastThreeMonths: "Últimos tres meses", maxRangeDays: "Puedes seleccionar hasta {count} día | Puedes seleccionar hasta {count} días", maxRangeMonths: "Puedes seleccionar hasta {count} mes | Puedes seleccionar hasta {count} meses", maxRangeQuarters: "Puedes seleccionar hasta {count} trimestre | Puedes seleccionar hasta {count} trimestres", maxRangeWeeks: "Puedes seleccionar hasta {count} semana | Puedes seleccionar hasta {count} semanas", monthly: "Mensualmente", quarterly: "Trimestral", selectedDateIsNotAvailable: "La fecha seleccionada no está disponible", startDateMustPrecedeEndDate: "La fecha de inicio debe ser anterior a la fecha de finalización", timeFrom: "Hora desde", timeTo: "Hora hasta", to: "Hasta", weekly: "Semanal" },
|
|
176
176
|
"es-MX": { "DD-MM-YYYY": "DD-MM-AAAA", "MM-DD-YYYY": "MM-DD-AAAA", "YYYY-MM-DD": "AAAA-MM-DD", customRange: "Rango personalizado", daily: "Diario", dateFrom: "Fecha de", dateTo: "Fecha hasta", invalidDateFormat: "Formato de fecha no válido", lastMonth: "El mes pasado", lastSevenDays: "Últimos 7 días", lastThreeMonths: "Últimos tres meses", maxRangeDays: "Puedes seleccionar hasta {count} día | Puedes seleccionar hasta {count} días", maxRangeMonths: "Puedes seleccionar hasta {count} mes | Puedes seleccionar hasta {count} meses", maxRangeQuarters: "Puedes seleccionar hasta {count} trimestre | Puedes seleccionar hasta {count} trimestres", maxRangeWeeks: "Puedes seleccionar hasta {count} semana | Puedes seleccionar hasta {count} semanas", monthly: "Mensual", quarterly: "Trimestral", selectedDateIsNotAvailable: "La fecha seleccionada no está disponible", startDateMustPrecedeEndDate: "La fecha de inicio debe ser anterior a la fecha de finalización", timeFrom: "Tiempo desde", timeTo: "Es hora de", weekly: "Semanal" },
|
|
177
|
-
"fr-FR": { "DD-MM-YYYY": "JJ-MM-AAAA", "MM-DD-YYYY": "MM-JJ-AAAA", "YYYY-MM-DD": "AAAA-MM-JJ", customRange: "Plage personnalisée", daily: "Quotidien", dateFrom: "Date de début", dateTo: "Date de fin", invalidDateFormat: "Format de date non valide", lastMonth: "Le mois dernier", lastSevenDays: "7 derniers jours", lastThreeMonths: "Trois derniers mois", maxRangeDays: "Vous pouvez sélectionner jusqu'à {count} jour| Vous pouvez sélectionner jusqu'à {count} jours", maxRangeMonths: "Vous pouvez sélectionner jusqu'à {count} mois | Vous pouvez sélectionner jusqu'à {count} mois", maxRangeQuarters: "Vous pouvez sélectionner jusqu'à {count} trimestre | Vous pouvez sélectionner jusqu'à {count} trimestres", maxRangeWeeks: "Vous pouvez sélectionner jusqu'à {count} semaine | Vous pouvez sélectionner jusqu'à {count} semaines", monthly: "Mensuel", quarterly: "Trimestriel", selectedDateIsNotAvailable: "La date sélectionnée n’est pas disponible", startDateMustPrecedeEndDate: "La date de début doit précéder la date de fin", timeFrom: "Heure de début", timeTo: "Heure de fin", weekly: "Hebdomadaire" },
|
|
178
|
-
"it-IT": { "DD-MM-YYYY": "GG-MM-AAAA", "MM-DD-YYYY": "MM-GG-AAAA", "YYYY-MM-DD": "AAAA-MM-GG", customRange: "Intervallo personalizzato", daily: "Giornaliero", dateFrom: "Data da", dateTo: "Da", invalidDateFormat: "Formato data non valido", lastMonth: "Il mese scorso", lastSevenDays: "Ultimi 7 giorni", lastThreeMonths: "Gli ultimi tre mesi", maxRangeDays: "Puoi selezionare fino a {count} giorno | Puoi selezionare fino a {count} giorni", maxRangeMonths: "Puoi selezionare fino a {count} mese | Puoi selezionare fino a {count} mesi", maxRangeQuarters: "Puoi selezionare fino a {count} trimestre | Puoi selezionare fino a {count} trimestri", maxRangeWeeks: "Puoi selezionare fino a {count} settimana | Puoi selezionare fino a {count} settimane", monthly: "Mensile", quarterly: "Trimestrale", selectedDateIsNotAvailable: "La data selezionata non è disponibile", startDateMustPrecedeEndDate: "La data di inizio deve precedere la data di fine", timeFrom: "Tempo dal", timeTo: "Tempo fino al", weekly: "Settimanale" },
|
|
179
|
-
"ja-JP": { "DD-MM-YYYY": "DD-MM-YYYY", "MM-DD-YYYY": "MM-DD-YYYY", "YYYY-MM-DD": "YYYY-MM-DD", customRange: "カスタム範囲", daily: "毎日", dateFrom: "開始日", dateTo: "終了日", invalidDateFormat: "無効な日付形式", lastMonth: "先月", lastSevenDays: "過去 7 日間", lastThreeMonths: "過去3か月", maxRangeDays: "{count}日間まで選択できます | {count}日間まで選択できます", maxRangeMonths: "{count}か月まで選択できます | {count}か月まで選択できます", maxRangeQuarters: "{count}四半期まで選択できます | {count}四半期まで選択できます", maxRangeWeeks: "{count}週間まで選択できます | {count}週間まで選択できます", monthly: "毎月", quarterly: "四半期ごと", selectedDateIsNotAvailable: "選択した日付は利用できません", startDateMustPrecedeEndDate: "開始日は終了日より前にする必要があります", timeFrom: "開始時刻", timeTo: "終了時刻", weekly: "毎週" },
|
|
180
|
-
"pt-BR": { "DD-MM-YYYY": "DD-MM-AAAA", "MM-DD-YYYY": "MM-DD-AAAA", "YYYY-MM-DD": "AAAA-MM-DD", customRange: "Intervalo personalizado", daily: "Diário", dateFrom: "Data a partir de", dateTo: "Data até", invalidDateFormat: "Formato de data inválido", lastMonth: "Último mês", lastSevenDays: "Últimos 7 dias", lastThreeMonths: "Últimos 3 meses", maxRangeDays: "Você pode selecionar até {count} dia | Você pode selecionar até {count} dias", maxRangeMonths: "Você pode selecionar até {count} mês | Você pode selecionar até {count} meses", maxRangeQuarters: "Você pode selecionar até {count} trimestre | Você pode selecionar até {count} trimestres", maxRangeWeeks: "Você pode selecionar até {count} semana | Você pode selecionar até {count} semanas", monthly: "Mensal", quarterly: "Trimestral", selectedDateIsNotAvailable: "A data selecionada não está disponível", startDateMustPrecedeEndDate: "A data de início deve preceder a data de término", timeFrom: "Horário a partir de", timeTo: "Horário até", weekly: "Semanal" },
|
|
181
|
-
"zh-CN": { "DD-MM-YYYY": "日-月-年", "MM-DD-YYYY": "月-日-年", "YYYY-MM-DD": "年-月-日", customRange: "自定义范围", daily: "每日", dateFrom: "日期自", dateTo: "日期至", invalidDateFormat: "日期格式无效", lastMonth: "上个月", lastSevenDays: "最近 7 天", lastThreeMonths: "过去三个月", maxRangeDays: "您可以选择最多 {count} 天 | 您可以选择最多 {count} 天", maxRangeMonths: "您可以选择最多 {count} 个月 | 您可以选择最多 {count} 个月", maxRangeQuarters: "您最多可以选择 {count} 个季度 | 您最多可以选择 {count} 个季度", maxRangeWeeks: "您最多可以选择 {count} 周 | 您最多可以选择 {count} 周", monthly: "每月", quarterly: "每季度", selectedDateIsNotAvailable: "所选日期不可用", startDateMustPrecedeEndDate: "开始日期必须早于结束日期", timeFrom: "时间自", timeTo: "是时候", weekly: "每周" }
|
|
177
|
+
"fr-FR": { "DD-MM-YYYY": "JJ-MM-AAAA", "MM-DD-YYYY": "MM-JJ-AAAA", "YYYY-MM-DD": "AAAA-MM-JJ", customRange: "Plage personnalisée", daily: "Quotidien", dateFrom: "Date de début", dateTo: "Date de fin", from: "De", invalidDateFormat: "Format de date non valide", lastMonth: "Le mois dernier", lastSevenDays: "7 derniers jours", lastThreeMonths: "Trois derniers mois", maxRangeDays: "Vous pouvez sélectionner jusqu'à {count} jour| Vous pouvez sélectionner jusqu'à {count} jours", maxRangeMonths: "Vous pouvez sélectionner jusqu'à {count} mois | Vous pouvez sélectionner jusqu'à {count} mois", maxRangeQuarters: "Vous pouvez sélectionner jusqu'à {count} trimestre | Vous pouvez sélectionner jusqu'à {count} trimestres", maxRangeWeeks: "Vous pouvez sélectionner jusqu'à {count} semaine | Vous pouvez sélectionner jusqu'à {count} semaines", monthly: "Mensuel", quarterly: "Trimestriel", selectedDateIsNotAvailable: "La date sélectionnée n’est pas disponible", startDateMustPrecedeEndDate: "La date de début doit précéder la date de fin", timeFrom: "Heure de début", timeTo: "Heure de fin", to: "À", weekly: "Hebdomadaire" },
|
|
178
|
+
"it-IT": { "DD-MM-YYYY": "GG-MM-AAAA", "MM-DD-YYYY": "MM-GG-AAAA", "YYYY-MM-DD": "AAAA-MM-GG", customRange: "Intervallo personalizzato", daily: "Giornaliero", dateFrom: "Data da", dateTo: "Da", from: "Da", invalidDateFormat: "Formato data non valido", lastMonth: "Il mese scorso", lastSevenDays: "Ultimi 7 giorni", lastThreeMonths: "Gli ultimi tre mesi", maxRangeDays: "Puoi selezionare fino a {count} giorno | Puoi selezionare fino a {count} giorni", maxRangeMonths: "Puoi selezionare fino a {count} mese | Puoi selezionare fino a {count} mesi", maxRangeQuarters: "Puoi selezionare fino a {count} trimestre | Puoi selezionare fino a {count} trimestri", maxRangeWeeks: "Puoi selezionare fino a {count} settimana | Puoi selezionare fino a {count} settimane", monthly: "Mensile", quarterly: "Trimestrale", selectedDateIsNotAvailable: "La data selezionata non è disponibile", startDateMustPrecedeEndDate: "La data di inizio deve precedere la data di fine", timeFrom: "Tempo dal", timeTo: "Tempo fino al", to: "A", weekly: "Settimanale" },
|
|
179
|
+
"ja-JP": { "DD-MM-YYYY": "DD-MM-YYYY", "MM-DD-YYYY": "MM-DD-YYYY", "YYYY-MM-DD": "YYYY-MM-DD", customRange: "カスタム範囲", daily: "毎日", dateFrom: "開始日", dateTo: "終了日", from: "下限", invalidDateFormat: "無効な日付形式", lastMonth: "先月", lastSevenDays: "過去 7 日間", lastThreeMonths: "過去3か月", maxRangeDays: "{count}日間まで選択できます | {count}日間まで選択できます", maxRangeMonths: "{count}か月まで選択できます | {count}か月まで選択できます", maxRangeQuarters: "{count}四半期まで選択できます | {count}四半期まで選択できます", maxRangeWeeks: "{count}週間まで選択できます | {count}週間まで選択できます", monthly: "毎月", quarterly: "四半期ごと", selectedDateIsNotAvailable: "選択した日付は利用できません", startDateMustPrecedeEndDate: "開始日は終了日より前にする必要があります", timeFrom: "開始時刻", timeTo: "終了時刻", to: "上限", weekly: "毎週" },
|
|
180
|
+
"pt-BR": { "DD-MM-YYYY": "DD-MM-AAAA", "MM-DD-YYYY": "MM-DD-AAAA", "YYYY-MM-DD": "AAAA-MM-DD", customRange: "Intervalo personalizado", daily: "Diário", dateFrom: "Data a partir de", dateTo: "Data até", from: "De", invalidDateFormat: "Formato de data inválido", lastMonth: "Último mês", lastSevenDays: "Últimos 7 dias", lastThreeMonths: "Últimos 3 meses", maxRangeDays: "Você pode selecionar até {count} dia | Você pode selecionar até {count} dias", maxRangeMonths: "Você pode selecionar até {count} mês | Você pode selecionar até {count} meses", maxRangeQuarters: "Você pode selecionar até {count} trimestre | Você pode selecionar até {count} trimestres", maxRangeWeeks: "Você pode selecionar até {count} semana | Você pode selecionar até {count} semanas", monthly: "Mensal", quarterly: "Trimestral", selectedDateIsNotAvailable: "A data selecionada não está disponível", startDateMustPrecedeEndDate: "A data de início deve preceder a data de término", timeFrom: "Horário a partir de", timeTo: "Horário até", to: "Para", weekly: "Semanal" },
|
|
181
|
+
"zh-CN": { "DD-MM-YYYY": "日-月-年", "MM-DD-YYYY": "月-日-年", "YYYY-MM-DD": "年-月-日", customRange: "自定义范围", daily: "每日", dateFrom: "日期自", dateTo: "日期至", from: "自", invalidDateFormat: "日期格式无效", lastMonth: "上个月", lastSevenDays: "最近 7 天", lastThreeMonths: "过去三个月", maxRangeDays: "您可以选择最多 {count} 天 | 您可以选择最多 {count} 天", maxRangeMonths: "您可以选择最多 {count} 个月 | 您可以选择最多 {count} 个月", maxRangeQuarters: "您最多可以选择 {count} 个季度 | 您最多可以选择 {count} 个季度", maxRangeWeeks: "您最多可以选择 {count} 周 | 您最多可以选择 {count} 周", monthly: "每月", quarterly: "每季度", selectedDateIsNotAvailable: "所选日期不可用", startDateMustPrecedeEndDate: "开始日期必须早于结束日期", timeFrom: "时间自", timeTo: "是时候", to: "至", weekly: "每周" }
|
|
182
182
|
}, bt = { class: "b-date-range-picker-calendar" }, At = { class: "b-date-range-picker-calendar__form" }, kt = { key: 0 }, It = {
|
|
183
183
|
key: 0,
|
|
184
184
|
class: "b-date-range-picker-calendar__calendars-container",
|
|
@@ -333,7 +333,7 @@ const ha = {
|
|
|
333
333
|
})) ?? []
|
|
334
334
|
), { getGranularCalendarLimits: xe } = Rt(e), te = m(
|
|
335
335
|
() => e.granularities ? xe(J.value) : { min: e.min ? w(e.min) : null, max: e.max ? W(e.max) : null }
|
|
336
|
-
), { normalizeRange: ce } =
|
|
336
|
+
), { normalizeRange: ce } = Xa(e.firstDayOfWeek), { savedRanges: X, saveRange: Te, resetSavedRanges: me } = Yt(), O = (a) => a ? ee(a) : "", Q = (a, o = !0) => {
|
|
337
337
|
if (!t.startDate || !t.endDate)
|
|
338
338
|
return;
|
|
339
339
|
const u = ce({
|
|
@@ -375,8 +375,8 @@ const ha = {
|
|
|
375
375
|
}
|
|
376
376
|
return !0;
|
|
377
377
|
};
|
|
378
|
-
return
|
|
379
|
-
}, K = m(() => e.variant === "month"), Ye = (a) => a ? K.value ?
|
|
378
|
+
return na(a) && u();
|
|
379
|
+
}, K = m(() => e.variant === "month"), Ye = (a) => a ? K.value ? Za(a) : et(a) : "", qe = m(() => Ye(t.startDate)), Ne = m(() => Ye(t.endDate)), be = m(() => A.value ? K.value ? "month" : "date" : "text"), Be = m(() => A.value ? qe.value : r.startDate), ze = m(() => A.value ? Ne.value : r.endDate), n = (a, o) => !o || !na(o) || e.variant === "month" ? a : Ee(new Date(a), o), x = (a, o = !1) => {
|
|
380
380
|
if (!o) {
|
|
381
381
|
const u = e.min && e.allowTimeInput && z(e.min, a.startDate), M = e.max && e.allowTimeInput && z(e.max, a.endDate);
|
|
382
382
|
r.startTime = u ? p(b(e.min), "up") : p(b(w(a.startDate)), "down"), r.endTime = M ? p(b(e.max), "down") : p(b(W(a.endDate)), "up");
|
|
@@ -432,8 +432,8 @@ const ha = {
|
|
|
432
432
|
});
|
|
433
433
|
} else
|
|
434
434
|
h.value = B(a), l(D.ERROR, { ...r });
|
|
435
|
-
}, Ya =
|
|
436
|
-
r.startDate = A.value && K.value ? a : j(a), A.value ? K.value && a ? Ve(O(
|
|
435
|
+
}, Ya = ua(Ve, 300), ba = (a) => {
|
|
436
|
+
r.startDate = A.value && K.value ? a : j(a), A.value ? K.value && a ? Ve(O(la(a)), !0) : r.startDate ? Ve(r.startDate) : h.value = null : Ya(r.startDate);
|
|
437
437
|
}, Le = (a, o = !1) => {
|
|
438
438
|
if (se(a)) {
|
|
439
439
|
const u = a;
|
|
@@ -462,8 +462,8 @@ const ha = {
|
|
|
462
462
|
});
|
|
463
463
|
} else
|
|
464
464
|
g.value = B(a), l(D.ERROR, { ...r });
|
|
465
|
-
}, Aa =
|
|
466
|
-
r.endDate = A.value && K.value ? a : j(a), A.value ? K.value && a ? Le(O(
|
|
465
|
+
}, Aa = ua(Le, 300), ka = (a) => {
|
|
466
|
+
r.endDate = A.value && K.value ? a : j(a), A.value ? K.value && a ? Le(O(la(a)), !0) : r.endDate ? Le(r.endDate) : g.value = null : Aa(r.endDate);
|
|
467
467
|
}, Ke = (a) => {
|
|
468
468
|
C(a);
|
|
469
469
|
}, Ia = () => {
|
|
@@ -572,7 +572,7 @@ const ha = {
|
|
|
572
572
|
}, [
|
|
573
573
|
oe("div", At, [
|
|
574
574
|
i(G)("title") ? aa(a.$slots, "title", { key: 0 }, void 0, !0) : q("", !0),
|
|
575
|
-
s.quickSelectRanges ? (E(), L(
|
|
575
|
+
s.quickSelectRanges ? (E(), L(it, {
|
|
576
576
|
key: 1,
|
|
577
577
|
"aria-label": i(y)("customRange"),
|
|
578
578
|
items: Oe.value,
|
|
@@ -740,10 +740,10 @@ const ha = {
|
|
|
740
740
|
return Y.label;
|
|
741
741
|
}
|
|
742
742
|
if (s.value.granularity === "quarterly") {
|
|
743
|
-
const { startDate: Y, endDate: C } = s.value, j = f("quarter", { quarter:
|
|
743
|
+
const { startDate: Y, endDate: C } = s.value, j = f("quarter", { quarter: ia(Y), year: Da(Y) });
|
|
744
744
|
if (yt(Y, C))
|
|
745
745
|
return j;
|
|
746
|
-
const ee = f("quarter", { quarter:
|
|
746
|
+
const ee = f("quarter", { quarter: ia(C), year: Da(C) });
|
|
747
747
|
return `${j} - ${ee}`;
|
|
748
748
|
}
|
|
749
749
|
if (!y(s.value.startDate) || !y(s.value.endDate))
|
|
@@ -755,7 +755,7 @@ const ha = {
|
|
|
755
755
|
minute: "numeric",
|
|
756
756
|
second: "numeric",
|
|
757
757
|
hour12: !1
|
|
758
|
-
}),
|
|
758
|
+
}), at(l.value, k).formatRange(
|
|
759
759
|
s.value.startDate,
|
|
760
760
|
s.value.endDate
|
|
761
761
|
);
|
|
@@ -797,7 +797,7 @@ const ha = {
|
|
|
797
797
|
},
|
|
798
798
|
emits: ["update:model-value"],
|
|
799
799
|
setup(s, { emit: v }) {
|
|
800
|
-
const T = v, d = s, c = Ba(), { t: e } = Ge({ messages: Je }), { dateToInputDateString: l } = je(), f = fe("bento-date-range-picker-container"), G = fe("bento-date-range-picker-label"), y = fe("bento-date-range-picker-description"), I = fe("bento-date-range-picker-error"), A = fe("bento-date-range-picker-date-error"), le = m(() => d.label || e("dateRangePicker", { name: f })), { resolvedFirstDayOfWeek: k } =
|
|
800
|
+
const T = v, d = s, c = Ba(), { t: e } = Ge({ messages: Je }), { dateToInputDateString: l } = je(), f = fe("bento-date-range-picker-container"), G = fe("bento-date-range-picker-label"), y = fe("bento-date-range-picker-description"), I = fe("bento-date-range-picker-error"), A = fe("bento-date-range-picker-date-error"), le = m(() => d.label || e("dateRangePicker", { name: f })), { resolvedFirstDayOfWeek: k } = tt(_e(d, "firstDayOfWeek")), Y = Ca({
|
|
801
801
|
none: 0,
|
|
802
802
|
one: 710,
|
|
803
803
|
// width of date range picker with one panes
|
|
@@ -833,7 +833,7 @@ const ha = {
|
|
|
833
833
|
timeDifference: x
|
|
834
834
|
}
|
|
835
835
|
};
|
|
836
|
-
})), ie = m(() => d.label ? G : c?.["aria-labelledby"] ?? null), S = P(!1), ae = P(null), ue = P(null), p = P(!1), { width: he } = Va(ue), { isReadOnly: t } =
|
|
836
|
+
})), ie = m(() => d.label ? G : c?.["aria-labelledby"] ?? null), S = P(!1), ae = P(null), ue = P(null), p = P(!1), { width: he } = Va(ue), { isReadOnly: t } = st(_e(d, "readonly")), { emitValue: U } = lt(T);
|
|
837
837
|
Me(
|
|
838
838
|
() => d.disabled,
|
|
839
839
|
() => {
|
|
@@ -936,7 +936,7 @@ const ha = {
|
|
|
936
936
|
ref: ue,
|
|
937
937
|
onKeydown: ta(Ne, ["enter"])
|
|
938
938
|
}, [
|
|
939
|
-
_(i(
|
|
939
|
+
_(i(ut), {
|
|
940
940
|
ref_key: "inputContainerRef",
|
|
941
941
|
ref: ae,
|
|
942
942
|
"always-combobox-is-input": "",
|
|
@@ -1032,7 +1032,7 @@ const ha = {
|
|
|
1032
1032
|
_: 1
|
|
1033
1033
|
}, 8, ["id", "open", "target-element", "aria-label", "match-width"])) : q("", !0)
|
|
1034
1034
|
])), [
|
|
1035
|
-
[i(
|
|
1035
|
+
[i(ot), Q]
|
|
1036
1036
|
]);
|
|
1037
1037
|
}
|
|
1038
1038
|
}), Dn = /* @__PURE__ */ ya(qt, [["__scopeId", "data-v-17331b7d"]]);
|
|
@@ -1042,4 +1042,4 @@ export {
|
|
|
1042
1042
|
ht as a,
|
|
1043
1043
|
ge as i
|
|
1044
1044
|
};
|
|
1045
|
-
//# sourceMappingURL=date-range-picker.
|
|
1045
|
+
//# sourceMappingURL=date-range-picker.CpYS55md.js.map
|