@adyen/bento-vue2 1.57.0 → 1.57.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 (64) hide show
  1. package/dist/@types/index.d.ts +1 -1
  2. package/dist/assets/accordion-item.css +1 -1
  3. package/dist/assets/action-bar.css +1 -1
  4. package/dist/assets/base-modal.css +1 -1
  5. package/dist/assets/card.css +1 -1
  6. package/dist/assets/data-grid.css +1 -1
  7. package/dist/assets/dialog-page.css +1 -1
  8. package/dist/assets/file-uploader.css +1 -1
  9. package/dist/assets/inspector.css +1 -1
  10. package/dist/assets/menu.css +1 -1
  11. package/dist/assets/modal-fullscreen.css +1 -1
  12. package/dist/assets/pagination.css +1 -1
  13. package/dist/assets/popover.css +1 -1
  14. package/dist/assets/sidepanel.css +1 -1
  15. package/dist/avatar.js +1 -1
  16. package/dist/chunks/{avatar.BgwjpLQO.js → avatar.CP1oL5W2.js} +3 -4
  17. package/dist/chunks/{avatar.BgwjpLQO.js.map → avatar.CP1oL5W2.js.map} +1 -1
  18. package/dist/chunks/{code-snippet.B1_T5Y4d.js → code-snippet.BdwtKOEj.js} +2 -2
  19. package/dist/chunks/{code-snippet.B1_T5Y4d.js.map → code-snippet.BdwtKOEj.js.map} +1 -1
  20. package/dist/chunks/{data-grid.BNgBYl3r.js → data-grid.DwdO-UCB.js} +5 -5
  21. package/dist/chunks/{data-grid.BNgBYl3r.js.map → data-grid.DwdO-UCB.js.map} +1 -1
  22. package/dist/chunks/{date-picker.S8ABQaHP.js → date-picker.oVG4b_5b.js} +14 -15
  23. package/dist/chunks/{date-picker.S8ABQaHP.js.map → date-picker.oVG4b_5b.js.map} +1 -1
  24. package/dist/chunks/{date-range-picker.CQNhNKK-.js → date-range-picker.CbLz3jJx.js} +23 -24
  25. package/dist/chunks/{date-range-picker.CQNhNKK-.js.map → date-range-picker.CbLz3jJx.js.map} +1 -1
  26. package/dist/chunks/{dropdown-tag.BiJvxp5n.js → dropdown-tag.CqcduQgK.js} +3 -3
  27. package/dist/chunks/{dropdown-tag.BiJvxp5n.js.map → dropdown-tag.CqcduQgK.js.map} +1 -1
  28. package/dist/chunks/{dropdown.Qc6K5BzU.js → dropdown.sRIb4drl.js} +15 -15
  29. package/dist/chunks/{dropdown.Qc6K5BzU.js.map → dropdown.sRIb4drl.js.map} +1 -1
  30. package/dist/chunks/{filter-bar.BFAsFxQo.js → filter-bar.DRDC6mhJ.js} +9 -10
  31. package/dist/chunks/{filter-bar.BFAsFxQo.js.map → filter-bar.DRDC6mhJ.js.map} +1 -1
  32. package/dist/chunks/{header-with-views.CO2aEwi4.js → header-with-views.B8ncHkZt.js} +4 -5
  33. package/dist/chunks/{header-with-views.CO2aEwi4.js.map → header-with-views.B8ncHkZt.js.map} +1 -1
  34. package/dist/chunks/{input-field-password.D6PVCLoF.js → input-field-password.GhHsOaiD.js} +3 -3
  35. package/dist/chunks/{input-field-password.D6PVCLoF.js.map → input-field-password.GhHsOaiD.js.map} +1 -1
  36. package/dist/chunks/{input-field-phone-number.Bg9XyY_1.js → input-field-phone-number.DFt3iS_A.js} +3 -3
  37. package/dist/chunks/{input-field-phone-number.Bg9XyY_1.js.map → input-field-phone-number.DFt3iS_A.js.map} +1 -1
  38. package/dist/chunks/{input-field.DgUkNPXo.js → input-field.rHXIJKN8.js} +2 -2
  39. package/dist/chunks/{input-field.DgUkNPXo.js.map → input-field.rHXIJKN8.js.map} +1 -1
  40. package/dist/chunks/{pagination.1PxOrSA9.js → pagination.BJ4qwHJn.js} +82 -73
  41. package/dist/chunks/{pagination.1PxOrSA9.js.map → pagination.BJ4qwHJn.js.map} +1 -1
  42. package/dist/chunks/{search-bar.-Lpxv9sU.js → search-bar.Cc8VBCjQ.js} +3 -3
  43. package/dist/chunks/{search-bar.-Lpxv9sU.js.map → search-bar.Cc8VBCjQ.js.map} +1 -1
  44. package/dist/chunks/{secondary-nav.DvTPsW8x.js → secondary-nav.DEDQjtj6.js} +2 -2
  45. package/dist/chunks/{secondary-nav.DvTPsW8x.js.map → secondary-nav.DEDQjtj6.js.map} +1 -1
  46. package/dist/chunks/{toast.B2u2W_TQ.js → toast.BuxfqZJb.js} +3 -4
  47. package/dist/chunks/{toast.B2u2W_TQ.js.map → toast.BuxfqZJb.js.map} +1 -1
  48. package/dist/code-snippet.js +1 -1
  49. package/dist/data-grid.js +1 -1
  50. package/dist/date-picker.js +1 -1
  51. package/dist/date-range-picker.js +1 -1
  52. package/dist/dropdown.js +2 -2
  53. package/dist/filter-bar.js +1 -1
  54. package/dist/header-with-views.js +1 -1
  55. package/dist/index.js +16 -16
  56. package/dist/input-field-password.js +1 -1
  57. package/dist/input-field-phone-number.js +1 -1
  58. package/dist/input-field.js +1 -1
  59. package/dist/pagination.js +1 -1
  60. package/dist/search-bar.js +2 -2
  61. package/dist/secondary-nav.js +1 -1
  62. package/dist/toast.js +1 -1
  63. package/dist/web-types.json +11 -1
  64. package/package.json +3 -3
@@ -2,15 +2,14 @@ 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.C0iatn5N.js";
3
3
  import { B as j } from "./popover.DXo3nXew.js";
4
4
  import { B as K } from "./typography.J1v_SPG3.js";
5
- import { d as $ } from "./debounce.DUTu11PS.js";
6
- import { D as _, v as z, f as G } from "./date-input.BqBdAO1E.js";
5
+ import { D as $ } from "./dropdown-default-textbox.AUsF-RIc.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";
7
8
  import { g as m } from "./generate-uid.NJ8tVoha.js";
8
9
  import { u as B } from "./i18n.BQkEbtPM.js";
9
- import { g as H } from "./get-date-locale.BN8xEjY0.js";
10
+ import { g as J } from "./get-date-locale.BN8xEjY0.js";
10
11
  import { f as T } from "./date.dYFFEunA.js";
11
- import { u as J } from "./use-form-layout-loading.D3lALhtC.js";
12
- import "./index.Cl4_42j5.js";
13
- import { D as Q } from "./dropdown-default-textbox.AUsF-RIc.js";
12
+ import { u as Q } from "./use-form-layout-loading.D3lALhtC.js";
14
13
  import { B as X } from "./directive.Cbdox5VL.js";
15
14
  import { F as Z, E as ee } from "./error-message.JskAm-Td.js";
16
15
  import { n as ae } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
@@ -21,7 +20,7 @@ const te = ({
21
20
  isMonthVariant: t
22
21
  }) => {
23
22
  var p;
24
- const { locale: n, t: b } = B(), o = H(), d = v((p = a.value) == null ? void 0 : p.toDateString());
23
+ const { locale: n, t: b } = B(), o = J(), d = v((p = a.value) == null ? void 0 : p.toDateString());
25
24
  return {
26
25
  // Values
27
26
  dateDisplayValue: u(() => e.value ? d.value : a.value ? T(
@@ -68,7 +67,7 @@ const re = {
68
67
  BentoPopover: j,
69
68
  Calendar: D,
70
69
  ErrorMessage: ee,
71
- DropdownInputDefault: Q,
70
+ DropdownInputDefault: $,
72
71
  FieldLabel: Z
73
72
  },
74
73
  directives: { BentoClickOutsideDirective: X },
@@ -144,7 +143,7 @@ const re = {
144
143
  },
145
144
  emits: [s.INPUT],
146
145
  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 } = J(E(a, "readonly"));
146
+ 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"));
148
147
  W(
149
148
  () => a.disabled,
150
149
  (r) => {
@@ -168,12 +167,12 @@ const re = {
168
167
  }, M = async () => {
169
168
  l.value && (l.value = !1, c.value = null), e(s.INPUT, null);
170
169
  }, V = (r) => {
171
- z(r);
170
+ G(r);
172
171
  }, S = (r) => {
173
172
  if (r.length < 10)
174
173
  return;
175
174
  /^\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 = $(S, ne);
175
+ }, Y = z(S, ne);
177
176
  return {
178
177
  // Refs
179
178
  inputContainerRef: f,
@@ -200,7 +199,7 @@ const re = {
200
199
  openDatePicker: P,
201
200
  onDateKeyDown: V,
202
201
  onDateInputChange: (r) => {
203
- c.value = G(r), i.value ? Y(c.value) : S(c.value);
202
+ c.value = H(r), i.value ? Y(c.value) : S(c.value);
204
203
  },
205
204
  // Keyboard navigation
206
205
  onSpaceBarOrEnter: async (r) => {
@@ -227,9 +226,9 @@ var ie = function() {
227
226
  null,
228
227
  "8933e97a"
229
228
  );
230
- const Oe = se.exports;
229
+ const Ee = se.exports;
231
230
  export {
232
- Oe as B,
231
+ Ee as B,
233
232
  s as a
234
233
  };
235
- //# sourceMappingURL=date-picker.S8ABQaHP.js.map
234
+ //# sourceMappingURL=date-picker.oVG4b_5b.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.S8ABQaHP.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;A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AI;AAAA,MACA,mBAtEA,CAAAI,MAAA;AACA,QAAAvD,EAAA,QAAA0D,EAAAH,CAAA,GAEArB,EAAA,QACAsB,EAAAxD,EAAA,KAAA,IAEAsD,EAAAtD,EAAA,KAAA;AAAA,MACA;AAAA;AAAA,MAgEA,mBAtDA,OAAAoD,MAAA;;AACA,QAAAlB,EAAA,UAGAkB,EAAA,eAAA,GAEAL,EAAA,GAGA,MAAAY,EAAA,GAGApC,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.oVG4b_5b.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,I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A,KAAA;AAAA,MACA;AAAA;AAAA,MAgEA,mBAtDA,OAAAoD,MAAA;;AACA,QAAAlB,EAAA,UAGAkB,EAAA,eAAA,GAEAL,EAAA,GAGA,MAAAY,EAAA,GAGApC,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;;;;;;;;;;;;;;;;;"}
@@ -2,22 +2,21 @@ import { reactive as se, defineComponent as Ae, computed as T, ref as w, onMount
2
2
  import { B as je } from "./divider.Cc4JFWG_.js";
3
3
  import { B as qe } from "./popover.DXo3nXew.js";
4
4
  import { B as Fe, d as Ke } from "./typography.J1v_SPG3.js";
5
+ import { D as ze } from "./dropdown-default-textbox.AUsF-RIc.js";
5
6
  import { r as V, t as J, g as De } from "./get-date-locale.BN8xEjY0.js";
6
7
  import { g as Z } from "./generate-uid.NJ8tVoha.js";
7
8
  import { u as me } from "./i18n.BQkEbtPM.js";
8
9
  import { t as fe, f as ee } from "./date.dYFFEunA.js";
9
- import { i as G, e as z, f as Re, g as ze, h as be, j as Je, s as Ie, k as Qe, l as Xe, a as B, u as Ze } from "./calendar.C0iatn5N.js";
10
- import { f as ke, v as et, D as k } from "./date-input.BqBdAO1E.js";
11
- import { u as tt } from "./use-form-layout-loading.D3lALhtC.js";
12
- import "./index.Cl4_42j5.js";
13
- import { B as at } from "./input-field.DgUkNPXo.js";
14
- import { B as nt } from "./dropdown.Qc6K5BzU.js";
15
- import { B as rt } from "./segmented-control.BQlmGv2x.js";
10
+ import { i as G, e as z, f as Re, g as Je, h as be, j as Qe, s as Ie, k as Xe, l as Ze, a as B, u as et } from "./calendar.C0iatn5N.js";
11
+ import { f as ke, v as tt, D as k } from "./date-input.BqBdAO1E.js";
12
+ import { u as at } from "./use-form-layout-loading.D3lALhtC.js";
13
+ import { B as nt } from "./input-field.rHXIJKN8.js";
14
+ import { B as rt } from "./dropdown.sRIb4drl.js";
15
+ import { B as st } from "./segmented-control.BQlmGv2x.js";
16
16
  import { d as ne } from "./debounce.DUTu11PS.js";
17
- import { u as st } from "./use-has-slot.C9lQZ6nz.js";
17
+ import { u as ot } from "./use-has-slot.C9lQZ6nz.js";
18
18
  import { e as N, a as Se } from "./index.BDuTpjD8.js";
19
19
  import { n as Ue } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
20
- import { D as ot } from "./dropdown-default-textbox.AUsF-RIc.js";
21
20
  import { B as it } from "./directive.Cbdox5VL.js";
22
21
  import { F as lt, E as ut } from "./error-message.JskAm-Td.js";
23
22
  import { B as dt, c as ct } from "./button-actions.DUn_iPDm.js";
@@ -72,13 +71,13 @@ const gt = ({
72
71
  m = z(d.earliest);
73
72
  else {
74
73
  const f = Re(m, { weekStartsOn: t });
75
- G(m, f) || (m = z(ze(be(m, { weekStartsOn: t }), 1)));
74
+ G(m, f) || (m = z(Je(be(m, { weekStartsOn: t }), 1)));
76
75
  }
77
76
  if (d.latest)
78
77
  n = N(d.latest);
79
78
  else {
80
79
  const f = be(n, { weekStartsOn: t });
81
- G(n, f) || (n = N(Je(Re(n, { weekStartsOn: t }), 1)));
80
+ G(n, f) || (n = N(Qe(Re(n, { weekStartsOn: t }), 1)));
82
81
  }
83
82
  }
84
83
  if ((d == null ? void 0 : d.type) === "monthly") {
@@ -86,13 +85,13 @@ const gt = ({
86
85
  m = z(d.earliest);
87
86
  else {
88
87
  const f = Ie(m);
89
- G(m, f) || (m = Ie(Qe(m, 1)));
88
+ G(m, f) || (m = Ie(Xe(m, 1)));
90
89
  }
91
90
  if (d.latest)
92
91
  n = N(d.latest);
93
92
  else {
94
93
  const f = Se(n);
95
- G(n, f) || (n = Se(Xe(n, 1)));
94
+ G(n, f) || (n = Se(Ze(n, 1)));
96
95
  }
97
96
  }
98
97
  return { min: m, max: n };
@@ -158,9 +157,9 @@ const Tt = /[\d]/, _t = /^\d{2}$/, Rt = /^\d{2}:\d{2}$/, bt = (t) => {
158
157
  i18n: { messages: It },
159
158
  name: "date-range-picker-calendar",
160
159
  components: {
161
- BentoDropdown: nt,
162
- BentoInputField: at,
163
- BentoSegmentedControl: rt,
160
+ BentoDropdown: rt,
161
+ BentoInputField: nt,
162
+ BentoSegmentedControl: st,
164
163
  BentoTypography: Fe,
165
164
  Calendar: B
166
165
  },
@@ -315,7 +314,7 @@ const Tt = /[\d]/, _t = /^\d{2}$/, Rt = /^\d{2}:\d{2}$/, bt = (t) => {
315
314
  adjustEndDateInputForWeekly: v,
316
315
  adjustStartDateInputForMonthly: W,
317
316
  adjustEndDateInputForMonthly: Q
318
- } = Ze(t.firstDayOfWeek), { savedRanges: R, saveRange: ie, resetSavedRanges: X } = yt(), b = (a) => a ? ee(a, k.NUMERIC_DATE_YEAR_FIRST, {
317
+ } = et(t.firstDayOfWeek), { savedRanges: R, saveRange: ie, resetSavedRanges: X } = yt(), b = (a) => a ? ee(a, k.NUMERIC_DATE_YEAR_FIRST, {
319
318
  locale: m[i.value.substring(0, 2)] || m.enUS
320
319
  }) : "", h = (a) => a ? ee(a, k.HOUR_MINUTE_SECONDS, {
321
320
  locale: m[i.value.substring(0, 2)] || m.enUS
@@ -427,7 +426,7 @@ const Tt = /[\d]/, _t = /^\d{2}$/, Rt = /^\d{2}:\d{2}$/, bt = (t) => {
427
426
  }, we), Be = (a) => {
428
427
  o.endDate = ke(a), Pe(o.endDate);
429
428
  }, Ne = (a) => {
430
- et(a);
429
+ tt(a);
431
430
  }, Le = ne((a) => {
432
431
  if (ae(a)) {
433
432
  U.value = !1, n.startDate = A(n.startDate, a);
@@ -537,7 +536,7 @@ const Tt = /[\d]/, _t = /^\d{2}$/, Rt = /^\d{2}:\d{2}$/, bt = (t) => {
537
536
  quickSelectRangeDefaultItems: te,
538
537
  formInputWrapperConditionalClasses: M,
539
538
  // Methods
540
- hasSlot: st(r),
539
+ hasSlot: ot(r),
541
540
  t: d,
542
541
  // Events
543
542
  onDateInput: pe,
@@ -645,7 +644,7 @@ const wt = {
645
644
  BentoTypography: Fe,
646
645
  BentoPopover: qe,
647
646
  DateRangePickerCalendar: x,
648
- DropdownInputDefault: ot,
647
+ DropdownInputDefault: ze,
649
648
  ErrorMessage: ut,
650
649
  FieldLabel: lt
651
650
  },
@@ -755,7 +754,7 @@ const wt = {
755
754
  setup(t, { emit: e }) {
756
755
  const { locale: r, t: i } = me(), d = De(), m = Z("bento-date-range-picker-container"), n = Z("bento-date-range-picker-label"), f = Z("bento-date-range-picker-description"), y = Z("bento-date-range-picker-error"), M = Z("bento-date-range-picker-date-error"), te = T(
757
756
  () => t.label || i("dateRangePicker", { name: m })
758
- ), g = w(!1), $ = w(null), _ = w(!1), { isReadOnly: H } = tt(ue(t, "readonly"));
757
+ ), g = w(!1), $ = w(null), _ = w(!1), { isReadOnly: H } = at(ue(t, "readonly"));
759
758
  de(
760
759
  () => t.disabled,
761
760
  () => {
@@ -895,12 +894,12 @@ var Ct = function() {
895
894
  null,
896
895
  "9cf2af81"
897
896
  );
898
- const na = xt.exports;
897
+ const aa = xt.exports;
899
898
  export {
900
- na as B,
899
+ aa as B,
901
900
  x as D,
902
901
  re as a,
903
902
  mt as b,
904
903
  Dt as i
905
904
  };
906
- //# sourceMappingURL=date-range-picker.CQNhNKK-.js.map
905
+ //# sourceMappingURL=date-range-picker.CbLz3jJx.js.map