@adyen/bento-vue2 1.62.0 → 1.62.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/assets/accordion-item.css +1 -1
  2. package/dist/assets/action-bar.css +1 -1
  3. package/dist/assets/base-modal.css +1 -1
  4. package/dist/assets/card.css +1 -1
  5. package/dist/assets/data-grid.css +1 -1
  6. package/dist/assets/dialog-page.css +1 -1
  7. package/dist/assets/file-uploader.css +1 -1
  8. package/dist/assets/inspector.css +1 -1
  9. package/dist/assets/menu.css +1 -1
  10. package/dist/assets/modal-fullscreen.css +1 -1
  11. package/dist/assets/popover.css +1 -1
  12. package/dist/assets/sidepanel.css +1 -1
  13. package/dist/chunks/{code-snippet.n93oYvH4.js → code-snippet.C17bZ5LS.js} +2 -2
  14. package/dist/chunks/{code-snippet.n93oYvH4.js.map → code-snippet.C17bZ5LS.js.map} +1 -1
  15. package/dist/chunks/{data-grid.BcGRXt9C.js → data-grid.BFw0RHNG.js} +5 -5
  16. package/dist/chunks/{data-grid.BcGRXt9C.js.map → data-grid.BFw0RHNG.js.map} +1 -1
  17. package/dist/chunks/{date-picker.Dc_HdQnr.js → date-picker.DIegsFDO.js} +12 -12
  18. package/dist/chunks/{date-picker.Dc_HdQnr.js.map → date-picker.DIegsFDO.js.map} +1 -1
  19. package/dist/chunks/{date-range-picker.D6xJAHoB.js → date-range-picker.bQnZ1R2Q.js} +20 -20
  20. package/dist/chunks/{date-range-picker.D6xJAHoB.js.map → date-range-picker.bQnZ1R2Q.js.map} +1 -1
  21. package/dist/chunks/{dropdown-tag.qKSu6xYY.js → dropdown-tag.DopZ3PPD.js} +2 -2
  22. package/dist/chunks/{dropdown-tag.qKSu6xYY.js.map → dropdown-tag.DopZ3PPD.js.map} +1 -1
  23. package/dist/chunks/{dropdown.BNLPzKbr.js → dropdown.4KhU0G3H.js} +16 -16
  24. package/dist/chunks/{dropdown.BNLPzKbr.js.map → dropdown.4KhU0G3H.js.map} +1 -1
  25. package/dist/chunks/{filter-bar.TiqZofNt.js → filter-bar.BcQUTqis.js} +7 -7
  26. package/dist/chunks/{filter-bar.TiqZofNt.js.map → filter-bar.BcQUTqis.js.map} +1 -1
  27. package/dist/chunks/{header-with-views.MFHmiIXb.js → header-with-views.DKj9cp5r.js} +2 -2
  28. package/dist/chunks/{header-with-views.MFHmiIXb.js.map → header-with-views.DKj9cp5r.js.map} +1 -1
  29. package/dist/chunks/{input-field-password.BlX3Icgt.js → input-field-password.D-rEjNIS.js} +3 -3
  30. package/dist/chunks/{input-field-password.BlX3Icgt.js.map → input-field-password.D-rEjNIS.js.map} +1 -1
  31. package/dist/chunks/{input-field-phone-number.Ofvi2A48.js → input-field-phone-number.BXopNol8.js} +3 -3
  32. package/dist/chunks/{input-field-phone-number.Ofvi2A48.js.map → input-field-phone-number.BXopNol8.js.map} +1 -1
  33. package/dist/chunks/{input-field.Dck9dAeK.js → input-field.cU5zOb6o.js} +2 -2
  34. package/dist/chunks/{input-field.Dck9dAeK.js.map → input-field.cU5zOb6o.js.map} +1 -1
  35. package/dist/chunks/{pagination.BvhUFgsT.js → pagination.K2EzoJKj.js} +2 -2
  36. package/dist/chunks/{pagination.BvhUFgsT.js.map → pagination.K2EzoJKj.js.map} +1 -1
  37. package/dist/chunks/{search-bar.Ch1dLZAb.js → search-bar.2U9B3XTR.js} +3 -3
  38. package/dist/chunks/{search-bar.Ch1dLZAb.js.map → search-bar.2U9B3XTR.js.map} +1 -1
  39. package/dist/chunks/{secondary-nav.DBssP9fQ.js → secondary-nav.D5bWZz_7.js} +2 -2
  40. package/dist/chunks/{secondary-nav.DBssP9fQ.js.map → secondary-nav.D5bWZz_7.js.map} +1 -1
  41. package/dist/chunks/{use-cached-selected-values.Da6xbfzO.js → use-cached-selected-values.DzIppuhI.js} +181 -181
  42. package/dist/chunks/{use-cached-selected-values.Da6xbfzO.js.map → use-cached-selected-values.DzIppuhI.js.map} +1 -1
  43. package/dist/code-snippet.js +1 -1
  44. package/dist/data-grid.js +1 -1
  45. package/dist/date-picker.js +1 -1
  46. package/dist/date-range-picker.js +1 -1
  47. package/dist/dropdown.js +3 -3
  48. package/dist/filter-bar.js +1 -1
  49. package/dist/header-with-views.js +1 -1
  50. package/dist/index.js +15 -15
  51. package/dist/input-field-password.js +1 -1
  52. package/dist/input-field-phone-number.js +1 -1
  53. package/dist/input-field.js +1 -1
  54. package/dist/internal.js +1 -1
  55. package/dist/pagination.js +1 -1
  56. package/dist/search-bar.js +2 -2
  57. package/dist/secondary-nav.js +1 -1
  58. package/dist/web-types.json +1 -1
  59. package/package.json +2 -2
@@ -2,15 +2,15 @@ import { ref as v, computed as u, defineComponent as q, toRef as E, watch as W,
2
2
  import { s as R, a as D } from "./calendar.DoOFNX-Z.js";
3
3
  import { B as j } from "./popover.B05xkQ4e.js";
4
4
  import { B as K } from "./typography.J1v_SPG3.js";
5
- import { D as $ } from "./dropdown-default-textbox.7PMxHqoa.js";
6
- import { d as z } from "./debounce.DUTu11PS.js";
7
- import { D as _, v as G, f as H } from "./date-input.BqBdAO1E.js";
5
+ import { d as $ } from "./debounce.DUTu11PS.js";
6
+ import { D as _, v as z, f as G } from "./date-input.BqBdAO1E.js";
8
7
  import { g as m } from "./generate-uid.NJ8tVoha.js";
9
8
  import { u as B } from "./i18n.BQkEbtPM.js";
10
- import { g as J } from "./get-date-locale.BN8xEjY0.js";
9
+ import { g as H } from "./get-date-locale.BN8xEjY0.js";
11
10
  import { f as T } from "./date.dYFFEunA.js";
12
- import { u as Q } from "./use-form-layout-loading.D3lALhtC.js";
11
+ import { u as J } from "./use-form-layout-loading.D3lALhtC.js";
13
12
  import "./index.Cl4_42j5.js";
13
+ import { D as Q } from "./dropdown-default-textbox.7PMxHqoa.js";
14
14
  import { B as X } from "./directive.Cbdox5VL.js";
15
15
  import { F as Z, E as ee } from "./error-message.BeExHHgv.js";
16
16
  import { n as ae } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
@@ -21,7 +21,7 @@ const te = ({
21
21
  isMonthVariant: t
22
22
  }) => {
23
23
  var p;
24
- const { locale: n, t: b } = B(), o = J(), d = v((p = a.value) == null ? void 0 : p.toDateString());
24
+ const { locale: n, t: b } = B(), o = H(), d = v((p = a.value) == null ? void 0 : p.toDateString());
25
25
  return {
26
26
  // Values
27
27
  dateDisplayValue: u(() => e.value ? d.value : a.value ? T(
@@ -68,7 +68,7 @@ const re = {
68
68
  BentoPopover: j,
69
69
  Calendar: D,
70
70
  ErrorMessage: ee,
71
- DropdownInputDefault: $,
71
+ DropdownInputDefault: Q,
72
72
  FieldLabel: Z
73
73
  },
74
74
  directives: { BentoClickOutsideDirective: X },
@@ -144,7 +144,7 @@ const re = {
144
144
  },
145
145
  emits: [s.INPUT],
146
146
  setup(a, { emit: e }) {
147
- const { t } = B(), n = m("bento-date-picker-container"), b = m("bento-date-picker-label"), o = m("bento-date-picker-description"), d = m("bento-date-picker-error"), y = m("bento-date-picker-date-error"), I = u(() => a.label || t("datePicker", { name: n })), p = v(null), f = v(null), l = v(!1), i = v(!1), { isReadOnly: w } = Q(E(a, "readonly"));
147
+ const { t } = B(), n = m("bento-date-picker-container"), b = m("bento-date-picker-label"), o = m("bento-date-picker-description"), d = m("bento-date-picker-error"), y = m("bento-date-picker-date-error"), I = u(() => a.label || t("datePicker", { name: n })), p = v(null), f = v(null), l = v(!1), i = v(!1), { isReadOnly: w } = J(E(a, "readonly"));
148
148
  W(
149
149
  () => a.disabled,
150
150
  (r) => {
@@ -168,12 +168,12 @@ const re = {
168
168
  }, M = async () => {
169
169
  l.value && (l.value = !1, c.value = null), e(s.INPUT, null);
170
170
  }, V = (r) => {
171
- G(r);
171
+ z(r);
172
172
  }, S = (r) => {
173
173
  if (r.length < 10)
174
174
  return;
175
175
  /^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/.test(r) && F(new Date(r)) ? (l.value = !1, e(s.INPUT, new Date(r))) : r && (l.value = !0, e(s.INPUT, null));
176
- }, Y = z(S, ne);
176
+ }, Y = $(S, ne);
177
177
  return {
178
178
  // Refs
179
179
  inputContainerRef: f,
@@ -200,7 +200,7 @@ const re = {
200
200
  openDatePicker: P,
201
201
  onDateKeyDown: V,
202
202
  onDateInputChange: (r) => {
203
- c.value = H(r), i.value ? Y(c.value) : S(c.value);
203
+ c.value = G(r), i.value ? Y(c.value) : S(c.value);
204
204
  },
205
205
  // Keyboard navigation
206
206
  onSpaceBarOrEnter: async (r) => {
@@ -232,4 +232,4 @@ export {
232
232
  Oe as B,
233
233
  s as a
234
234
  };
235
- //# sourceMappingURL=date-picker.Dc_HdQnr.js.map
235
+ //# sourceMappingURL=date-picker.DIegsFDO.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.Dc_HdQnr.js","sources":["../../src/components/date-picker/composables/use-date-picker-single-calendar-text.ts","../../src/components/date-picker/date-picker.types.ts","../../src/components/date-picker/date-picker.vue"],"sourcesContent":["import { computed, ref } from 'vue';\nimport { 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';\nimport startOfMonth from 'date-fns/startOfMonth';\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 * @param {?Ref<boolean>} option.isMonthVariant Indicates if the date picker has variant \"month\"\n */\nexport const useDatePickerSingleCalendarText: UseDateDisplayText<Date> = ({\n datePickerValue,\n isDateIncorrect,\n isMonthVariant,\n}) => {\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)\" or \"MMMM yyyy (June 2023)\"\n // if there's a valid date selected\n return format(\n datePickerValue.value,\n isMonthVariant?.value ? DateFormat.LONG_MONTH_YEAR : DateFormat.FULL_DATE,\n {\n locale: locales[locale.value.substring(0, 2)] || locales.enUS,\n }\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 const date = isMonthVariant?.value ? startOfMonth(dateToFormat) : dateToFormat;\n textInputValue.value = dateToFormat\n ? format(date, 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 CalendarVariant as BentoDatePickerVariant,\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 :default-display-month=\"defaultDisplayMonth\"\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 :variant=\"variant\"\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 import startOfMonth from 'date-fns/startOfMonth';\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, BentoDatePickerVariant } 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 /**\n * The type of calendar to display. Defaults to showing days.\n */\n variant: {\n type: String as PropType<`${BentoDatePickerVariant}`>,\n default: undefined, // Default will be set by @/internal/calendar\n },\n\n /**\n * Default start date for the calendar pane\n */\n defaultDisplayMonth: {\n type: String,\n default: null,\n validator: (value: string) => {\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(value);\n\n return isValidDate;\n },\n },\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 isMonthVariant = computed(() => props.variant === 'month');\n\n const { dateDisplayValue, textInputValue, formatTextInputDisplayValue } = useDatePickerSingleCalendarText({\n datePickerValue: toRef(props, 'value') as Ref<Date>,\n isDateIncorrect,\n isMonthVariant,\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(\n props.variant === 'month' ? startOfMonth(props.value) : props.value\n );\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","isMonthVariant","locale","t","useI18n","locales","getDateLocale","textInputValue","ref","_a","computed","format","DateFormat","dateToFormat","date","startOfMonth","BentoDatePickerEvent","BentoDatePickerEvent2","DEBOUNCE_TIME","_sfc_main","defineComponent","messages","BentoTypography","BentoPopover","Calendar","ErrorMessage","DropdownInputDefault","FieldLabel","BentoClickOutsideDirective","value","props","emit","datePickerContainerId","generateUid","labelId","descriptionId","errorId","dateErrorId","popoverAriaLabel","calendarContainerRef","inputContainerRef","isDatePickerOpen","isReadOnly","useFormLayoutFieldLoading","toRef","watch","disabled","dateDisplayValue","formatTextInputDisplayValue","dateErrorText","descriptionConditionalClasses","ariaDescribedBy","isDateEnabled","closeDatePicker","openDatePicker","onDateSelected","selectedDate","clearDatePickerValue","onDateKeyDown","event","validateDateInput","validateDate","stringDate","validateDateDebounced","debounce","formatDateInputValue","nextTick"],"mappings":";;;;;;;;;;;;;;;;;AAcO,MAAAA,KAAA,CAAA;AAAA,EAAmE,iBAAAC;AAAA,EACtE,iBAAAC;AAAA,EACA,gBAAAC;AAEJ,MAAA;;AACI,QAAA,EAAA,QAAAC,GAAA,GAAAC,EAAA,IAAAC,EAAA,GACAC,IAAAC,EAAA,GAEAC,IAAAC,GAAAC,IAAAV,EAAA,UAAA,gBAAAU,EAAA,cAAA;AA0CA,SAAA;AAAA;AAAA,IAAO,kBAxCPC,EAAA,MAEIV,EAAA,QACIO,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C,EAAA,UAEAkB,EAAA,oBAAA,KAAA,CAAA,GACAjB,EAAAf,EAAA,OAAA,oBAAA,KAAA,CAAA,GAGA,MAAAkD,EAAA,KAIAzD,IAAA8B,EAAA,UAAA,QAAA9B,EAAA,MAAA,YAAA,GAAA;AAAA,UAAAqB,EAAA,YAAA,UAAAf,EAAAe,EAAA,KAAA,IAAAA,EAAA;AAAA;AAAA,MAEA;AAAA,IAiCA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"date-picker.DIegsFDO.js","sources":["../../src/components/date-picker/composables/use-date-picker-single-calendar-text.ts","../../src/components/date-picker/date-picker.types.ts","../../src/components/date-picker/date-picker.vue"],"sourcesContent":["import { computed, ref } from 'vue';\nimport { 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';\nimport startOfMonth from 'date-fns/startOfMonth';\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 * @param {?Ref<boolean>} option.isMonthVariant Indicates if the date picker has variant \"month\"\n */\nexport const useDatePickerSingleCalendarText: UseDateDisplayText<Date> = ({\n datePickerValue,\n isDateIncorrect,\n isMonthVariant,\n}) => {\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)\" or \"MMMM yyyy (June 2023)\"\n // if there's a valid date selected\n return format(\n datePickerValue.value,\n isMonthVariant?.value ? DateFormat.LONG_MONTH_YEAR : DateFormat.FULL_DATE,\n {\n locale: locales[locale.value.substring(0, 2)] || locales.enUS,\n }\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 const date = isMonthVariant?.value ? startOfMonth(dateToFormat) : dateToFormat;\n textInputValue.value = dateToFormat\n ? format(date, 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 CalendarVariant as BentoDatePickerVariant,\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 :default-display-month=\"defaultDisplayMonth\"\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 :variant=\"variant\"\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 import startOfMonth from 'date-fns/startOfMonth';\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, BentoDatePickerVariant } 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 /**\n * The type of calendar to display. Defaults to showing days.\n */\n variant: {\n type: String as PropType<`${BentoDatePickerVariant}`>,\n default: undefined, // Default will be set by @/internal/calendar\n },\n\n /**\n * Default start date for the calendar pane\n */\n defaultDisplayMonth: {\n type: String,\n default: null,\n validator: (value: string) => {\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(value);\n\n return isValidDate;\n },\n },\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 isMonthVariant = computed(() => props.variant === 'month');\n\n const { dateDisplayValue, textInputValue, formatTextInputDisplayValue } = useDatePickerSingleCalendarText({\n datePickerValue: toRef(props, 'value') as Ref<Date>,\n isDateIncorrect,\n isMonthVariant,\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(\n props.variant === 'month' ? startOfMonth(props.value) : props.value\n );\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","isMonthVariant","locale","t","useI18n","locales","getDateLocale","textInputValue","ref","_a","computed","format","DateFormat","dateToFormat","date","startOfMonth","BentoDatePickerEvent","BentoDatePickerEvent2","DEBOUNCE_TIME","_sfc_main","defineComponent","messages","BentoTypography","BentoPopover","Calendar","ErrorMessage","DropdownInputDefault","FieldLabel","BentoClickOutsideDirective","value","props","emit","datePickerContainerId","generateUid","labelId","descriptionId","errorId","dateErrorId","popoverAriaLabel","calendarContainerRef","inputContainerRef","isDatePickerOpen","isReadOnly","useFormLayoutFieldLoading","toRef","watch","disabled","dateDisplayValue","formatTextInputDisplayValue","dateErrorText","descriptionConditionalClasses","ariaDescribedBy","isDateEnabled","closeDatePicker","openDatePicker","onDateSelected","selectedDate","clearDatePickerValue","onDateKeyDown","event","validateDateInput","validateDate","stringDate","validateDateDebounced","debounce","formatDateInputValue","nextTick"],"mappings":";;;;;;;;;;;;;;;;;AAcO,MAAAA,KAAA,CAAA;AAAA,EAAmE,iBAAAC;AAAA,EACtE,iBAAAC;AAAA,EACA,gBAAAC;AAEJ,MAAA;;AACI,QAAA,EAAA,QAAAC,GAAA,GAAAC,EAAA,IAAAC,EAAA,GACAC,IAAAC,EAAA,GAEAC,IAAAC,GAAAC,IAAAV,EAAA,UAAA,gBAAAU,EAAA,cAAA;AA0CA,SAAA;AAAA;AAAA,IAAO,kBAxCPC,EAAA,MAEIV,EAAA,QACIO,EAAA,QAIJR,EAAA,QAMAY;AAAA,MAAOZ,EAAA;AAAA,MACaE,KAAA,QAAAA,EAAA,QAAAW,EAAA,kBAAAA,EAAA;AAAA,MACgD;AAAA,QAChE,QAAAP,E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AAA9B,EAAA,MAAA,YAAA,GAAA;AAAA,UAAAqB,EAAA,YAAA,UAAAf,EAAAe,EAAA,KAAA,IAAAA,EAAA;AAAA;AAAA,MAEA;AAAA,IAiCA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;;;"}
@@ -2,22 +2,22 @@ import { reactive as ce, defineComponent as Pe, computed as y, ref as w, onMount
2
2
  import { B as tt } from "./divider.Cc4JFWG_.js";
3
3
  import { B as at } from "./popover.B05xkQ4e.js";
4
4
  import { B as Ne, d as nt } from "./typography.J1v_SPG3.js";
5
- import { D as rt } from "./dropdown-default-textbox.7PMxHqoa.js";
6
5
  import { r as h, t as $, g as ve } from "./get-date-locale.BN8xEjY0.js";
7
6
  import { g as te } from "./generate-uid.NJ8tVoha.js";
8
7
  import { u as pe } from "./i18n.BQkEbtPM.js";
9
8
  import { t as re, f as ne } from "./date.dYFFEunA.js";
10
- import { e as qe, f as ae, i as P, g as K, h as Ie, j as st, k as Se, l as it, s as ke, m as ot, n as Ee, a as Y, u as lt } from "./calendar.DoOFNX-Z.js";
11
- import { f as he, v as ut, D as S } from "./date-input.BqBdAO1E.js";
12
- import { u as dt } from "./use-form-layout-loading.D3lALhtC.js";
9
+ import { e as qe, f as ae, i as P, g as K, h as Ie, j as rt, k as Se, l as st, s as ke, m as it, n as Ee, a as Y, u as ot } from "./calendar.DoOFNX-Z.js";
10
+ import { f as he, v as lt, D as S } from "./date-input.BqBdAO1E.js";
11
+ import { u as ut } from "./use-form-layout-loading.D3lALhtC.js";
13
12
  import "./index.Cl4_42j5.js";
14
- import { B as ct } from "./input-field.Dck9dAeK.js";
15
- import { B as Dt } from "./dropdown.BNLPzKbr.js";
16
- import { B as mt } from "./segmented-control.B-uxKqMN.js";
13
+ import { B as dt } from "./input-field.cU5zOb6o.js";
14
+ import { B as ct } from "./dropdown.4KhU0G3H.js";
15
+ import { B as Dt } from "./segmented-control.B-uxKqMN.js";
17
16
  import { d as ue } from "./debounce.DUTu11PS.js";
18
- import { u as ft } from "./use-has-slot.C9lQZ6nz.js";
17
+ import { u as mt } from "./use-has-slot.C9lQZ6nz.js";
19
18
  import { e as B, a as Oe } from "./index.BDuTpjD8.js";
20
19
  import { n as Le } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
20
+ import { D as ft } from "./dropdown-default-textbox.7PMxHqoa.js";
21
21
  import { B as vt } from "./directive.Cbdox5VL.js";
22
22
  import { F as pt, E as gt } from "./error-message.BeExHHgv.js";
23
23
  import { B as yt, c as Tt } from "./button-actions._OIvTdKt.js";
@@ -95,13 +95,13 @@ const ht = ({
95
95
  D = K(l.earliest);
96
96
  else {
97
97
  const r = Ie(D, { weekStartsOn: t });
98
- P(D, r) || (D = K(st(Se(D, { weekStartsOn: t }), 1)));
98
+ P(D, r) || (D = K(rt(Se(D, { weekStartsOn: t }), 1)));
99
99
  }
100
100
  if (l.latest)
101
101
  m = B(l.latest);
102
102
  else {
103
103
  const r = Se(m, { weekStartsOn: t });
104
- P(m, r) || (m = B(it(Ie(m, { weekStartsOn: t }), 1)));
104
+ P(m, r) || (m = B(st(Ie(m, { weekStartsOn: t }), 1)));
105
105
  }
106
106
  }
107
107
  if ((l == null ? void 0 : l.type) === "monthly") {
@@ -115,7 +115,7 @@ const ht = ({
115
115
  m = B(l.latest);
116
116
  else {
117
117
  const r = Oe(m);
118
- P(m, r) || (m = Oe(ot(m, 1)));
118
+ P(m, r) || (m = Oe(it(m, 1)));
119
119
  }
120
120
  }
121
121
  if ((l == null ? void 0 : l.type) === "quarterly") {
@@ -197,9 +197,9 @@ const wt = /[\d]/, Mt = /^\d{2}$/, Ct = /^\d{2}:\d{2}$/, At = (t) => {
197
197
  i18n: { messages: xt },
198
198
  name: "date-range-picker-calendar",
199
199
  components: {
200
- BentoDropdown: Dt,
201
- BentoInputField: ct,
202
- BentoSegmentedControl: mt,
200
+ BentoDropdown: ct,
201
+ BentoInputField: dt,
202
+ BentoSegmentedControl: Dt,
203
203
  BentoTypography: Ne,
204
204
  Calendar: Y
205
205
  },
@@ -348,7 +348,7 @@ const wt = /[\d]/, Mt = /^\d{2}$/, Ct = /^\d{2}:\d{2}$/, At = (t) => {
348
348
  adjustEndDateInputForMonthly: A,
349
349
  adjustStartDateInputForQuarterly: Q,
350
350
  adjustEndDateInputForQuarterly: De
351
- } = lt(t.firstDayOfWeek), { savedRanges: x, saveRange: ie, resetSavedRanges: F } = Ot(), T = (a) => a ? ne(a, S.NUMERIC_DATE_YEAR_FIRST, {
351
+ } = ot(t.firstDayOfWeek), { savedRanges: x, saveRange: ie, resetSavedRanges: F } = Ot(), T = (a) => a ? ne(a, S.NUMERIC_DATE_YEAR_FIRST, {
352
352
  locale: D[o.value.substring(0, 2)] || D.enUS
353
353
  }) : "", N = (a) => a ? ne(a, S.HOUR_MINUTE_SECONDS, {
354
354
  locale: D[o.value.substring(0, 2)] || D.enUS
@@ -485,7 +485,7 @@ const wt = /[\d]/, Mt = /^\d{2}$/, Ct = /^\d{2}:\d{2}$/, At = (t) => {
485
485
  }, Fe), Ge = (a) => {
486
486
  s.endDate = he(a), Qe(s.endDate);
487
487
  }, He = (a) => {
488
- ut(a);
488
+ lt(a);
489
489
  }, Ve = ue((a) => {
490
490
  if (oe(a)) {
491
491
  G.value = !1, r.startDate = E(r.startDate, a);
@@ -586,7 +586,7 @@ const wt = /[\d]/, Mt = /^\d{2}$/, Ct = /^\d{2}:\d{2}$/, At = (t) => {
586
586
  quickSelectRangeDefaultItems: ee,
587
587
  formInputWrapperConditionalClasses: se,
588
588
  // Methods
589
- hasSlot: ft(n),
589
+ hasSlot: mt(n),
590
590
  t: l,
591
591
  // Events
592
592
  onDateInput: ge,
@@ -702,7 +702,7 @@ const qt = {
702
702
  BentoTypography: Ne,
703
703
  BentoPopover: at,
704
704
  DateRangePickerCalendar: U,
705
- DropdownInputDefault: rt,
705
+ DropdownInputDefault: ft,
706
706
  ErrorMessage: gt,
707
707
  FieldLabel: pt
708
708
  },
@@ -822,7 +822,7 @@ const qt = {
822
822
  timeDifference: O
823
823
  }
824
824
  };
825
- })), p = w(!1), z = w(null), b = w(!1), { isReadOnly: g } = dt(be(t, "readonly"));
825
+ })), p = w(!1), z = w(null), b = w(!1), { isReadOnly: g } = ut(be(t, "readonly"));
826
826
  me(
827
827
  () => t.disabled,
828
828
  () => {
@@ -974,4 +974,4 @@ export {
974
974
  bt as b,
975
975
  Rt as i
976
976
  };
977
- //# sourceMappingURL=date-range-picker.D6xJAHoB.js.map
977
+ //# sourceMappingURL=date-range-picker.bQnZ1R2Q.js.map