@dialpad/dialtone 9.158.0 → 9.159.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/css/dialtone-default-theme.css +20 -1
  2. package/dist/css/dialtone-default-theme.min.css +1 -1
  3. package/dist/css/dialtone-docs.json +1 -1
  4. package/dist/css/dialtone.css +20 -1
  5. package/dist/css/dialtone.min.css +1 -1
  6. package/dist/tokens/doc.json +94613 -94613
  7. package/dist/vue3/component-documentation.json +1 -1
  8. package/dist/vue3/dialtone-vue.cjs +1 -1
  9. package/dist/vue3/dialtone-vue.js +155 -153
  10. package/dist/vue3/dialtone-vue.js.map +1 -1
  11. package/dist/vue3/lib/datepicker/datepicker.cjs +1 -1
  12. package/dist/vue3/lib/datepicker/datepicker.cjs.map +1 -1
  13. package/dist/vue3/lib/datepicker/datepicker.js +306 -242
  14. package/dist/vue3/lib/datepicker/datepicker.js.map +1 -1
  15. package/dist/vue3/lib/datepicker/utils.cjs +1 -1
  16. package/dist/vue3/lib/datepicker/utils.cjs.map +1 -1
  17. package/dist/vue3/lib/datepicker/utils.js +40 -40
  18. package/dist/vue3/lib/datepicker/utils.js.map +1 -1
  19. package/dist/vue3/lib/general-row/index.cjs +1 -1
  20. package/dist/vue3/lib/general-row/index.js +6 -4
  21. package/dist/vue3/lib/general-row/index.js.map +1 -1
  22. package/dist/vue3/lib/message-input/message-input.cjs +1 -1
  23. package/dist/vue3/lib/message-input/message-input.cjs.map +1 -1
  24. package/dist/vue3/lib/message-input/message-input.js +17 -16
  25. package/dist/vue3/lib/message-input/message-input.js.map +1 -1
  26. package/dist/vue3/types/components/datepicker/composables/useMonthYearPicker.d.ts +4 -0
  27. package/dist/vue3/types/components/datepicker/composables/useMonthYearPicker.d.ts.map +1 -1
  28. package/dist/vue3/types/components/datepicker/datepicker.vue.d.ts +8 -0
  29. package/dist/vue3/types/components/datepicker/datepicker.vue.d.ts.map +1 -1
  30. package/dist/vue3/types/components/datepicker/modules/month-year-picker.vue.d.ts +4 -0
  31. package/dist/vue3/types/components/datepicker/modules/month-year-picker.vue.d.ts.map +1 -1
  32. package/dist/vue3/types/components/datepicker/utils.d.ts +1 -1
  33. package/dist/vue3/types/components/datepicker/utils.d.ts.map +1 -1
  34. package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
  35. package/dist/vue3/types/recipes/leftbar/general_row/index.d.ts +1 -0
  36. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"datepicker.js","sources":["../../../components/datepicker/composables/useMonthYearPicker.js","../../../components/datepicker/modules/month-year-picker.vue","../../../components/datepicker/composables/useCalendar.js","../../../components/datepicker/modules/calendar.vue","../../../components/datepicker/datepicker.vue"],"sourcesContent":["import { computed, ref, watch } from 'vue';\nimport { addMonths, getDate, getMonth, getYear, set, subMonths } from 'date-fns';\nimport { formatMonth, getCalendarDays } from '../utils.js';\nimport { INTL_MONTH_FORMAT } from '../datepicker_constants';\nimport { returnFirstEl } from '@/common/utils';\nimport { DialtoneLocalization } from '@/localization';\n\nexport function useMonthYearPicker (props, emits) {\n const selectMonth = ref(getMonth(props.selectedDate));\n const selectYear = ref(getYear(props.selectedDate));\n const highlightedDay = ref(null);\n const focusPicker = ref(0);\n const focusRefs = ref([]);\n const i18n = new DialtoneLocalization();\n\n const calendarDays = computed(() => {\n return getCalendarDays(selectMonth.value, selectYear.value, highlightedDay.value);\n });\n\n watch(selectMonth, () => {\n highlightDay();\n emits('calendar-days', calendarDays.value);\n }, { immediate: true });\n\n watch(selectYear, () => {\n highlightDay();\n emits('calendar-days', calendarDays.value);\n }, { immediate: true });\n\n function formattedMonth (month) {\n return formatMonth(month, INTL_MONTH_FORMAT, i18n.currentLocale);\n }\n\n function setDayRef (el) {\n if (!focusRefs.value.includes(el)) {\n focusRefs.value.push(el);\n }\n }\n\n function focusMonthYearPicker () {\n returnFirstEl(focusRefs.value[0].$el).focus();\n }\n\n function handleKeyDown (event) {\n switch (event.key) {\n case 'ArrowLeft':\n event.preventDefault();\n if (focusPicker.value === 0) {\n focusPicker.value = 3;\n returnFirstEl(focusRefs.value[focusPicker.value].$el).focus();\n } else {\n focusPicker.value--;\n returnFirstEl(focusRefs.value[focusPicker.value].$el).focus();\n }\n break;\n\n case 'ArrowRight':\n event.preventDefault();\n if (focusPicker.value === 3) {\n focusPicker.value = 0;\n returnFirstEl(focusRefs.value[focusPicker.value].$el).focus();\n } else {\n focusPicker.value++;\n returnFirstEl(focusRefs.value[focusPicker.value].$el).focus();\n }\n break;\n\n case 'ArrowDown':\n event.preventDefault();\n emits('focus-first-day');\n break;\n\n case 'Tab':\n event.preventDefault();\n emits('focus-first-day');\n break;\n\n case 'Escape':\n emits('close-datepicker');\n break;\n }\n }\n\n function highlightDay () {\n const year = getYear(props.selectedDate);\n const month = getMonth(props.selectedDate);\n\n if (year !== selectYear.value || month !== selectMonth.value) {\n highlightedDay.value = null;\n } else {\n highlightedDay.value = getDate(props.selectedDate);\n }\n }\n\n function changeMonth (value) {\n // Adjust year when changing from January to December or vice versa\n if ((selectMonth.value === 0 && value === -1) || (selectMonth.value === 11 && value === 1)) {\n selectYear.value += value;\n }\n\n // Calculate the new date by adding or subtracting months\n const initialDate = set(props.selectedDate, { month: selectMonth.value, year: selectYear.value });\n const newDate = value === 1 ? addMonths(initialDate, 1) : subMonths(initialDate, 1);\n\n // Update the selected month\n selectMonth.value = getMonth(newDate);\n }\n\n function changeYear (value) {\n selectYear.value = selectYear.value + value;\n }\n\n function goToNextMonth () {\n changeMonth(1);\n }\n\n function goToPrevMonth () {\n changeMonth(-1);\n }\n\n function previousYearAriaLabel () {\n return `${i18n.$t('DIALTONE_DATEPICKER_CHANGE_TO')} ${i18n.$t('DIALTONE_DATEPICKER_PREVIOUS_YEAR')} ${selectYear.value - 1}`;\n }\n\n function previousMonthAriaLabel () {\n return `${i18n.$t('DIALTONE_DATEPICKER_CHANGE_TO')} ${i18n.$t('DIALTONE_DATEPICKER_PREVIOUS_MONTH')} ${formattedMonth(selectMonth.value - 1)}`;\n }\n\n function nextYearAriaLabel () {\n return `${i18n.$t('DIALTONE_DATEPICKER_CHANGE_TO')} ${i18n.$t('DIALTONE_DATEPICKER_NEXT_YEAR')} ${selectYear.value + 1}`;\n }\n\n function nextMonthAriaLabel () {\n return `${i18n.$t('DIALTONE_DATEPICKER_CHANGE_TO')} ${i18n.$t('DIALTONE_DATEPICKER_NEXT_MONTH')} ${formattedMonth(selectMonth.value + 1)}`;\n }\n\n return {\n selectMonth,\n selectYear,\n formattedMonth,\n setDayRef,\n focusMonthYearPicker,\n handleKeyDown,\n changeMonth,\n changeYear,\n goToNextMonth,\n goToPrevMonth,\n previousYearAriaLabel,\n previousMonthAriaLabel,\n nextYearAriaLabel,\n nextMonthAriaLabel,\n };\n}\n","<template>\n <dt-stack\n class=\"d-datepicker__month-year\"\n direction=\"row\"\n gap=\"300\"\n >\n <dt-stack\n as=\"nav\"\n class=\"d-datepicker__nav\"\n direction=\"row\"\n gap=\"200\"\n >\n <dt-tooltip\n :fallback-placements=\"['top-start', 'auto']\"\n :message=\"i18n.$t('DIALTONE_DATEPICKER_PREVIOUS_YEAR')\"\n placement=\"top\"\n >\n <template #anchor>\n <dt-button\n id=\"prevYearButton\"\n :ref=\"el => { if (el) setDayRef(el) }\"\n :aria-label=\"previousYearAriaLabel()\"\n :circle=\"true\"\n class=\"d-datepicker__nav-btn\"\n importance=\"clear\"\n kind=\"muted\"\n size=\"xs\"\n type=\"button\"\n @click=\"changeYear(-1)\"\n @keydown=\"handleKeyDown($event)\"\n >\n <dt-icon-chevrons-left\n size=\"200\"\n />\n </dt-button>\n </template>\n </dt-tooltip>\n <dt-tooltip\n :fallback-placements=\"['top-start', 'auto']\"\n :message=\"i18n.$t('DIALTONE_DATEPICKER_PREVIOUS_MONTH')\"\n placement=\"top\"\n >\n <template #anchor>\n <dt-button\n id=\"prevMonthButton\"\n :ref=\"el => { if (el) setDayRef(el) }\"\n :aria-label=\"previousMonthAriaLabel()\"\n :circle=\"true\"\n class=\"d-datepicker__nav-btn\"\n importance=\"clear\"\n kind=\"muted\"\n size=\"xs\"\n type=\"button\"\n @click=\"changeMonth(-1)\"\n @keydown=\"handleKeyDown($event)\"\n >\n <dt-icon-chevron-left\n size=\"200\"\n />\n </dt-button>\n </template>\n </dt-tooltip>\n </dt-stack>\n <div\n id=\"calendar-heading\"\n class=\"d-datepicker__month-year-title\"\n >\n {{ formattedMonth(selectMonth) }}\n\n {{ selectYear }}\n </div>\n <dt-stack\n as=\"nav\"\n class=\"d-datepicker__nav\"\n direction=\"row\"\n gap=\"200\"\n >\n <dt-tooltip\n :fallback-placements=\"['top-end', 'auto']\"\n :message=\"i18n.$t('DIALTONE_DATEPICKER_NEXT_MONTH')\"\n placement=\"top\"\n >\n <template #anchor>\n <dt-button\n id=\"nextMonthButton\"\n :ref=\"el => { if (el) setDayRef(el) }\"\n :aria-label=\"nextMonthAriaLabel()\"\n :circle=\"true\"\n class=\"d-datepicker__nav-btn\"\n importance=\"clear\"\n kind=\"muted\"\n size=\"xs\"\n type=\"button\"\n @click=\"changeMonth(1)\"\n @keydown=\"handleKeyDown($event)\"\n >\n <dt-icon-chevron-right\n size=\"200\"\n />\n </dt-button>\n </template>\n </dt-tooltip>\n <dt-tooltip\n :fallback-placements=\"['top-end', 'auto']\"\n :message=\"i18n.$t('DIALTONE_DATEPICKER_NEXT_YEAR')\"\n placement=\"top\"\n >\n <template #anchor>\n <dt-button\n id=\"nextYearButton\"\n :ref=\"el => { if (el) setDayRef(el) }\"\n :aria-label=\"nextYearAriaLabel()\"\n :circle=\"true\"\n class=\"d-datepicker__nav-btn\"\n importance=\"clear\"\n kind=\"muted\"\n size=\"xs\"\n type=\"button\"\n @click=\"changeYear(1)\"\n @keydown=\"handleKeyDown($event)\"\n >\n <dt-icon-chevrons-right\n size=\"200\"\n />\n </dt-button>\n </template>\n </dt-tooltip>\n </dt-stack>\n </dt-stack>\n</template>\n\n<script setup>\nimport {\n DtIconChevronLeft,\n DtIconChevronsLeft,\n DtIconChevronRight,\n DtIconChevronsRight,\n} from '@dialpad/dialtone-icons/vue3';\nimport { DtStack } from '@/components/stack';\nimport { DtButton } from '@/components/button';\nimport { DtTooltip } from '@/components/tooltip';\nimport { onMounted } from 'vue';\nimport { useMonthYearPicker } from '../composables/useMonthYearPicker.js';\nimport { DialtoneLocalization } from '@/localization';\n\nconst props = defineProps({\n selectedDate: {\n type: Date,\n required: true,\n },\n});\n\nconst emits = defineEmits([\n /**\n * Will retrieve the calendar days of the given date\n *\n * @event calendar-days\n * @type {Array}\n */\n 'calendar-days',\n\n /**\n * Will focus first day in calendar\n *\n * @event focus-first-day\n */\n 'focus-first-day',\n\n /**\n * Will focus last day in calendar\n *\n * @event focus-last-day\n */\n 'focus-last-day',\n\n /**\n * Will close the datepicker\n *\n * @event close-datepicker\n */\n 'close-datepicker',\n]);\n\nconst i18n = new DialtoneLocalization();\n\nconst {\n selectMonth,\n selectYear,\n formattedMonth,\n setDayRef,\n focusMonthYearPicker,\n handleKeyDown,\n changeMonth,\n changeYear,\n goToNextMonth,\n goToPrevMonth,\n previousYearAriaLabel,\n previousMonthAriaLabel,\n nextMonthAriaLabel,\n nextYearAriaLabel,\n} = useMonthYearPicker(props, emits);\n\nonMounted(() => {\n focusMonthYearPicker();\n});\n\ndefineExpose({\n focusMonthYearPicker,\n goToNextMonth,\n goToPrevMonth,\n});\n</script>\n","import { computed, ref, watch, nextTick } from 'vue';\nimport { getWeekDayNames, calculateNextFocusDate, calculatePrevFocusDate, formatDate } from '../utils.js';\nimport { INTL_MONTH_FORMAT, WEEK_START } from '../datepicker_constants.js';\nimport { returnFirstEl } from '@/common/utils';\nimport { DialtoneLocalization } from '@/localization';\n\nexport function useCalendar (props, emits) {\n const selectedDay = ref(null);\n const focusDay = ref(0);\n const daysRef = ref([]);\n const i18n = new DialtoneLocalization();\n\n const weekDays = computed(() => {\n return getWeekDayNames(props.locale, WEEK_START);\n });\n\n watch(() => props.calendarDays, () => {\n focusDay.value = 0;\n daysRef.value = [];\n selectedDay.value = null;\n });\n\n function dayAriaLabel (day) {\n return i18n.$t('DIALTONE_DATEPICKER_SELECT_DAY') + ` ${formatDate(day.value, INTL_MONTH_FORMAT, i18n.currentLocale)}`;\n }\n\n function setDayRef (el, day) {\n if (!daysRef.value.some(day => day.el === el) && day.currentMonth) {\n daysRef.value.push({ el, day });\n }\n }\n\n function handleKeyDown (event) {\n switch (event.key) {\n case 'ArrowUp':\n event.preventDefault();\n focusDay.value -= 7;\n try {\n returnFirstEl(daysRef.value[focusDay.value].el.$el).focus();\n } catch {\n const prevFocusDate = calculatePrevFocusDate(daysRef.value[focusDay.value + 7].day.value);\n emits('go-to-prev-month');\n\n nextTick(() => {\n returnFirstEl(daysRef.value[prevFocusDate - 1].el.$el).focus();\n focusDay.value += prevFocusDate - 1;\n });\n }\n break;\n\n case 'ArrowDown':\n event.preventDefault();\n focusDay.value += 7;\n try {\n returnFirstEl(daysRef.value[focusDay.value].el.$el).focus();\n } catch {\n const nextFocusDate = calculateNextFocusDate(daysRef.value[focusDay.value - 7].day.value);\n emits('go-to-next-month');\n\n nextTick(() => {\n returnFirstEl(daysRef.value[nextFocusDate - 1].el.$el).focus();\n focusDay.value += nextFocusDate - 1;\n });\n }\n break;\n\n case 'ArrowLeft':\n event.preventDefault();\n if (focusDay.value > 0) {\n focusDay.value -= 1;\n returnFirstEl(daysRef.value[focusDay.value].el.$el).focus();\n } else {\n // if we are on month first day, jump to last day of prev month\n emits('go-to-prev-month');\n focusLastDay();\n }\n break;\n\n case 'ArrowRight':\n event.preventDefault();\n if (focusDay.value < daysRef.value.length - 1) {\n focusDay.value += 1;\n returnFirstEl(daysRef.value[focusDay.value].el.$el).focus();\n } else {\n // if we are on month last day, jump to first day of next month\n emits('go-to-next-month');\n\n focusFirstDay();\n }\n break;\n\n case 'Tab':\n event.preventDefault();\n emits('focus-month-year-picker');\n break;\n\n case 'Escape':\n emits('close-datepicker');\n break;\n }\n }\n\n function focusFirstDay () {\n focusDay.value = 0;\n\n nextTick(() => {\n returnFirstEl(daysRef.value[focusDay.value].el.$el).focus();\n });\n }\n\n function focusLastDay () {\n nextTick(() => {\n focusDay.value = daysRef.value.length - 1;\n returnFirstEl(daysRef.value[focusDay.value].el.$el).focus();\n });\n }\n\n function selectDay (day) {\n if (!day.currentMonth) { return; }\n\n // local selectedDay is updated when a day is selected\n selectedDay.value = day.text;\n emits('select-date', day.value);\n }\n\n return {\n selectedDay,\n weekDays,\n dayAriaLabel,\n setDayRef,\n handleKeyDown,\n focusFirstDay,\n selectDay,\n };\n}\n","<template>\n <table\n class=\"d-datepicker__calendar\"\n aria-labelledby=\"calendar-heading\"\n >\n <thead>\n <tr>\n <th\n v-for=\"day in weekDays\"\n :key=\"day\"\n scope=\"col\"\n class=\"d-datepicker__cell d-datepicker__cell--header\"\n >\n <span\n class=\"d-datepicker__weekday\"\n :title=\"day\"\n :aria-label=\"day\"\n > {{ day }}</span>\n </th>\n </tr>\n </thead>\n <tbody>\n <tr\n v-for=\"(week, indexWeek) in calendarDays\"\n :key=\"indexWeek\"\n >\n <td\n v-for=\"(day, indexDays) in week.days\"\n :key=\"indexWeek + indexDays\"\n class=\"d-datepicker__cell\"\n role=\"listbox\"\n >\n <dt-button\n :ref=\"el => { if (el) setDayRef(el, day) }\"\n class=\"d-datepicker__day\"\n :circle=\"true\"\n size=\"sm\"\n importance=\"clear\"\n :disabled=\"!day.currentMonth\"\n :class=\"{\n 'd-datepicker__day--disabled': !day.currentMonth,\n 'd-datepicker__day--selected': selectedDay\n ? ((day.text === selectedDay) && day.currentMonth)\n : day.selected,\n }\"\n type=\"button\"\n :aria-selected=\"!!selectedDay ? ((day.text === selectedDay) && day.currentMonth) : day.selected\"\n :aria-label=\"dayAriaLabel(day)\"\n role=\"option\"\n @click=\"selectDay(day)\"\n @keydown=\"handleKeyDown($event)\"\n >\n {{ day.text }}\n </dt-button>\n </td>\n </tr>\n </tbody>\n </table>\n</template>\n\n<script setup>\nimport { useCalendar } from '../composables/useCalendar.js';\nimport { DtButton } from '@/components/button';\n\nconst props = defineProps({\n calendarDays: {\n type: Array,\n required: true,\n },\n});\n\nconst emits = defineEmits([\n /**\n * Event fired when a date is selected\n *\n * @event select-date\n * @type {Date}\n */\n 'select-date',\n\n /**\n * Will focus the month and year picker\n *\n * @event focus-month-year-picker\n */\n 'focus-month-year-picker',\n\n /**\n * Will close the datepicker\n *\n * @event close-datepicker\n */\n 'close-datepicker',\n\n /**\n * Will go to the next month\n *\n * @event go-to-next-month\n */\n 'go-to-next-month',\n\n /**\n * Will go to the previous month\n *\n * @event go-to-prev-month\n */\n 'go-to-prev-month',\n]);\n\nconst {\n selectedDay,\n weekDays,\n dayAriaLabel,\n setDayRef,\n handleKeyDown,\n focusFirstDay,\n selectDay,\n} = useCalendar(props, emits);\n\ndefineExpose({\n focusFirstDay,\n});\n</script>\n","<!-- eslint-disable vue/multi-word-component-names -->\n<template>\n <dt-stack\n class=\"d-datepicker\"\n gap=\"400\"\n >\n <div class=\"d-datepicker__hd\">\n <month-year-picker\n ref=\"monthYearPicker\"\n :selected-date=\"selectedDate\"\n @calendar-days=\"updateCalendarDays\"\n @focus-first-day=\"$refs.calendar.focusFirstDay()\"\n @focus-last-day=\"$refs.calendar.focusLastDay()\"\n @close-datepicker=\"$emit('close-datepicker')\"\n />\n </div>\n <div class=\"d-datepicker__bd\">\n <calendar\n ref=\"calendar\"\n :calendar-days=\"calendarDays\"\n @select-date=\"$emit('selected-date', $event)\"\n @focus-month-year-picker=\"$refs.monthYearPicker.focusMonthYearPicker()\"\n @close-datepicker=\"$emit('close-datepicker')\"\n @go-to-next-month=\"$refs.monthYearPicker.goToNextMonth()\"\n @go-to-prev-month=\"$refs.monthYearPicker.goToPrevMonth()\"\n />\n </div>\n </dt-stack>\n</template>\n\n<script setup>\nimport MonthYearPicker from './modules/month-year-picker.vue';\nimport Calendar from './modules/calendar.vue';\nimport { DtStack } from '@/components/stack';\nimport { returnFirstEl, warnIfUnmounted } from '@/common/utils';\nimport { onMounted, ref, getCurrentInstance } from 'vue';\n\ndefineProps({\n /**\n * Selected date\n *\n * @type {Date}\n */\n selectedDate: {\n type: Date,\n default: () => (new Date()),\n },\n});\n\ndefineEmits([\n /**\n * Event fired when a date is selected\n *\n * @event selected-date\n * @type {Date}\n */\n 'selected-date',\n\n /**\n * Event fired when user presses the esc key\n *\n * @event close-datepicker\n */\n 'close-datepicker',\n]);\n\nconst calendarDays = ref([]);\n\nfunction updateCalendarDays (days) {\n calendarDays.value = days;\n}\n\nonMounted(() => {\n const instance = getCurrentInstance();\n warnIfUnmounted(returnFirstEl(instance.proxy.$el), 'datepicker');\n});\n</script>\n"],"names":["useMonthYearPicker","props","emits","selectMonth","ref","getMonth","selectYear","getYear","highlightedDay","focusPicker","focusRefs","i18n","DialtoneLocalization","calendarDays","computed","getCalendarDays","watch","highlightDay","formattedMonth","month","formatMonth","INTL_MONTH_FORMAT","setDayRef","el","focusMonthYearPicker","returnFirstEl","handleKeyDown","event","year","getDate","changeMonth","value","initialDate","set","newDate","addMonths","subMonths","changeYear","goToNextMonth","goToPrevMonth","previousYearAriaLabel","previousMonthAriaLabel","nextYearAriaLabel","nextMonthAriaLabel","__props","__emit","onMounted","__expose","_createBlock","_unref","DtStack","_createVNode","DtTooltip","DtButton","_cache","$event","DtIconChevronsLeft","DtIconChevronLeft","_createElementVNode","_hoisted_1","_toDisplayString","DtIconChevronRight","DtIconChevronsRight","useCalendar","selectedDay","focusDay","daysRef","weekDays","getWeekDayNames","WEEK_START","dayAriaLabel","day","formatDate","prevFocusDate","calculatePrevFocusDate","nextTick","nextFocusDate","calculateNextFocusDate","focusLastDay","focusFirstDay","selectDay","_openBlock","_createElementBlock","_Fragment","_renderList","_hoisted_2","week","indexWeek","indexDays","_createTextVNode","updateCalendarDays","days","instance","getCurrentInstance","warnIfUnmounted","MonthYearPicker","$refs","$emit","Calendar"],"mappings":";;;;;;;;;;AAOO,SAASA,GAAoBC,GAA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A,MACN,KAAI;AAAA;iBAEJ,MASM;AAAA,QATNQ,EASM,OATNC,IASM;AAAA,UARJR,EAOE4C,IAAA;AAAA,YANA,KAAI;AAAA,YACH,iBAAenD,EAAA;AAAA,YACf,gBAAe8C;AAAA,YACf,iBAAepC,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAEyC,EAAAA,MAAM,SAAS,cAAa;AAAA,YAC7C,gBAAc1C,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAEyC,EAAAA,MAAM,SAAS,aAAY;AAAA,YAC3C,0CAAkBC,EAAAA,MAAK,kBAAA;AAAA;;QAG5BvC,EAUM,OAVN2B,IAUM;AAAA,UATJlC,EAQE+C,IAAA;AAAA,YAPA,KAAI;AAAA,YACH,iBAAerF,EAAA;AAAA,YACf,cAAWyC,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAE0C,EAAAA,MAAK,iBAAkB1C,CAAM;AAAA,YAC1C,wBAAuBD,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAEyC,EAAAA,MAAM,gBAAgB,qBAAoB;AAAA,YACnE,0CAAkBC,EAAAA,MAAK,kBAAA;AAAA,YACvB,iBAAgB3C,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAEyC,EAAAA,MAAM,gBAAgB,cAAa;AAAA,YACrD,iBAAgB1C,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAEyC,EAAAA,MAAM,gBAAgB,cAAa;AAAA;;;;;;;"}
1
+ {"version":3,"file":"datepicker.js","sources":["../../../components/datepicker/composables/useMonthYearPicker.js","../../../components/datepicker/modules/month-year-picker.vue","../../../components/datepicker/composables/useCalendar.js","../../../components/datepicker/modules/calendar.vue","../../../components/datepicker/datepicker.vue"],"sourcesContent":["import { computed, ref, watch } from 'vue';\nimport { addMonths, endOfMonth, getDate, getMonth, getYear, set, startOfDay, startOfMonth, subMonths } from 'date-fns';\nimport { formatMonth, getCalendarDays } from '../utils.js';\nimport { INTL_MONTH_FORMAT } from '../datepicker_constants';\nimport { returnFirstEl } from '@/common/utils';\nimport { DialtoneLocalization } from '@/localization';\n\nexport function useMonthYearPicker (props, emits) {\n const selectMonth = ref(getMonth(props.selectedDate));\n const selectYear = ref(getYear(props.selectedDate));\n const highlightedDay = ref(null);\n const focusPicker = ref(0);\n const focusRefs = ref([]);\n const i18n = new DialtoneLocalization();\n\n const calendarDays = computed(() => {\n return getCalendarDays(selectMonth.value, selectYear.value, highlightedDay.value, props.minDate, props.maxDate);\n });\n\n const isPrevMonthDisabled = computed(() => {\n if (!props.minDate) return false;\n const prevMonth = subMonths(new Date(selectYear.value, selectMonth.value, 1), 1);\n return endOfMonth(prevMonth) < startOfDay(props.minDate);\n });\n\n const isNextMonthDisabled = computed(() => {\n if (!props.maxDate) return false;\n const nextMonth = addMonths(new Date(selectYear.value, selectMonth.value, 1), 1);\n return startOfMonth(nextMonth) > startOfDay(props.maxDate);\n });\n\n const isPrevYearDisabled = computed(() => {\n if (!props.minDate) return false;\n const prevYearMonth = new Date(selectYear.value - 1, selectMonth.value, 1);\n return endOfMonth(prevYearMonth) < startOfDay(props.minDate);\n });\n\n const isNextYearDisabled = computed(() => {\n if (!props.maxDate) return false;\n const nextYearMonth = new Date(selectYear.value + 1, selectMonth.value, 1);\n return startOfMonth(nextYearMonth) > startOfDay(props.maxDate);\n });\n\n watch(selectMonth, () => {\n highlightDay();\n emits('calendar-days', calendarDays.value);\n }, { immediate: true });\n\n watch(selectYear, () => {\n highlightDay();\n emits('calendar-days', calendarDays.value);\n }, { immediate: true });\n\n watch(() => props.minDate, () => {\n emits('calendar-days', calendarDays.value);\n });\n\n watch(() => props.maxDate, () => {\n emits('calendar-days', calendarDays.value);\n });\n\n function formattedMonth (month) {\n return formatMonth(month, INTL_MONTH_FORMAT, i18n.currentLocale);\n }\n\n function setDayRef (el) {\n if (!focusRefs.value.includes(el)) {\n focusRefs.value.push(el);\n }\n }\n\n function focusMonthYearPicker () {\n returnFirstEl(focusRefs.value[0].$el).focus();\n }\n\n function handleKeyDown (event) {\n switch (event.key) {\n case 'ArrowLeft':\n event.preventDefault();\n if (focusPicker.value === 0) {\n focusPicker.value = 3;\n returnFirstEl(focusRefs.value[focusPicker.value].$el).focus();\n } else {\n focusPicker.value--;\n returnFirstEl(focusRefs.value[focusPicker.value].$el).focus();\n }\n break;\n\n case 'ArrowRight':\n event.preventDefault();\n if (focusPicker.value === 3) {\n focusPicker.value = 0;\n returnFirstEl(focusRefs.value[focusPicker.value].$el).focus();\n } else {\n focusPicker.value++;\n returnFirstEl(focusRefs.value[focusPicker.value].$el).focus();\n }\n break;\n\n case 'ArrowDown':\n event.preventDefault();\n emits('focus-first-day');\n break;\n\n case 'Tab':\n event.preventDefault();\n emits('focus-first-day');\n break;\n\n case 'Escape':\n emits('close-datepicker');\n break;\n }\n }\n\n function highlightDay () {\n const year = getYear(props.selectedDate);\n const month = getMonth(props.selectedDate);\n\n if (year !== selectYear.value || month !== selectMonth.value) {\n highlightedDay.value = null;\n } else {\n highlightedDay.value = getDate(props.selectedDate);\n }\n }\n\n function changeMonth (value) {\n if (value === -1 && isPrevMonthDisabled.value) return;\n if (value === 1 && isNextMonthDisabled.value) return;\n\n // Adjust year when changing from January to December or vice versa\n if ((selectMonth.value === 0 && value === -1) || (selectMonth.value === 11 && value === 1)) {\n selectYear.value += value;\n }\n\n // Calculate the new date by adding or subtracting months\n const initialDate = set(props.selectedDate, { month: selectMonth.value, year: selectYear.value });\n const newDate = value === 1 ? addMonths(initialDate, 1) : subMonths(initialDate, 1);\n\n // Update the selected month\n selectMonth.value = getMonth(newDate);\n }\n\n function changeYear (value) {\n if (value === -1 && isPrevYearDisabled.value) return;\n if (value === 1 && isNextYearDisabled.value) return;\n\n selectYear.value = selectYear.value + value;\n }\n\n function goToNextMonth () {\n changeMonth(1);\n }\n\n function goToPrevMonth () {\n changeMonth(-1);\n }\n\n function previousYearAriaLabel () {\n return `${i18n.$t('DIALTONE_DATEPICKER_CHANGE_TO')} ${i18n.$t('DIALTONE_DATEPICKER_PREVIOUS_YEAR')} ${selectYear.value - 1}`;\n }\n\n function previousMonthAriaLabel () {\n return `${i18n.$t('DIALTONE_DATEPICKER_CHANGE_TO')} ${i18n.$t('DIALTONE_DATEPICKER_PREVIOUS_MONTH')} ${formattedMonth(selectMonth.value - 1)}`;\n }\n\n function nextYearAriaLabel () {\n return `${i18n.$t('DIALTONE_DATEPICKER_CHANGE_TO')} ${i18n.$t('DIALTONE_DATEPICKER_NEXT_YEAR')} ${selectYear.value + 1}`;\n }\n\n function nextMonthAriaLabel () {\n return `${i18n.$t('DIALTONE_DATEPICKER_CHANGE_TO')} ${i18n.$t('DIALTONE_DATEPICKER_NEXT_MONTH')} ${formattedMonth(selectMonth.value + 1)}`;\n }\n\n return {\n selectMonth,\n selectYear,\n formattedMonth,\n setDayRef,\n focusMonthYearPicker,\n handleKeyDown,\n changeMonth,\n changeYear,\n goToNextMonth,\n goToPrevMonth,\n isPrevMonthDisabled,\n isNextMonthDisabled,\n isPrevYearDisabled,\n isNextYearDisabled,\n previousYearAriaLabel,\n previousMonthAriaLabel,\n nextYearAriaLabel,\n nextMonthAriaLabel,\n };\n}\n","<template>\n <dt-stack\n class=\"d-datepicker__month-year\"\n direction=\"row\"\n gap=\"300\"\n >\n <dt-stack\n as=\"nav\"\n class=\"d-datepicker__nav\"\n direction=\"row\"\n gap=\"200\"\n >\n <dt-tooltip\n :fallback-placements=\"['top-start', 'auto']\"\n :message=\"i18n.$t('DIALTONE_DATEPICKER_PREVIOUS_YEAR')\"\n placement=\"top\"\n >\n <template #anchor>\n <dt-button\n id=\"prevYearButton\"\n :ref=\"el => { if (el) setDayRef(el) }\"\n :aria-label=\"previousYearAriaLabel()\"\n :circle=\"true\"\n :disabled=\"isPrevYearDisabled\"\n class=\"d-datepicker__nav-btn\"\n importance=\"clear\"\n kind=\"muted\"\n size=\"xs\"\n type=\"button\"\n @click=\"changeYear(-1)\"\n @keydown=\"handleKeyDown($event)\"\n >\n <dt-icon-chevrons-left\n size=\"200\"\n />\n </dt-button>\n </template>\n </dt-tooltip>\n <dt-tooltip\n :fallback-placements=\"['top-start', 'auto']\"\n :message=\"i18n.$t('DIALTONE_DATEPICKER_PREVIOUS_MONTH')\"\n placement=\"top\"\n >\n <template #anchor>\n <dt-button\n id=\"prevMonthButton\"\n :ref=\"el => { if (el) setDayRef(el) }\"\n :aria-label=\"previousMonthAriaLabel()\"\n :circle=\"true\"\n :disabled=\"isPrevMonthDisabled\"\n class=\"d-datepicker__nav-btn\"\n importance=\"clear\"\n kind=\"muted\"\n size=\"xs\"\n type=\"button\"\n @click=\"changeMonth(-1)\"\n @keydown=\"handleKeyDown($event)\"\n >\n <dt-icon-chevron-left\n size=\"200\"\n />\n </dt-button>\n </template>\n </dt-tooltip>\n </dt-stack>\n <div\n id=\"calendar-heading\"\n class=\"d-datepicker__month-year-title\"\n >\n {{ formattedMonth(selectMonth) }}\n\n {{ selectYear }}\n </div>\n <dt-stack\n as=\"nav\"\n class=\"d-datepicker__nav\"\n direction=\"row\"\n gap=\"200\"\n >\n <dt-tooltip\n :fallback-placements=\"['top-end', 'auto']\"\n :message=\"i18n.$t('DIALTONE_DATEPICKER_NEXT_MONTH')\"\n placement=\"top\"\n >\n <template #anchor>\n <dt-button\n id=\"nextMonthButton\"\n :ref=\"el => { if (el) setDayRef(el) }\"\n :aria-label=\"nextMonthAriaLabel()\"\n :circle=\"true\"\n :disabled=\"isNextMonthDisabled\"\n class=\"d-datepicker__nav-btn\"\n importance=\"clear\"\n kind=\"muted\"\n size=\"xs\"\n type=\"button\"\n @click=\"changeMonth(1)\"\n @keydown=\"handleKeyDown($event)\"\n >\n <dt-icon-chevron-right\n size=\"200\"\n />\n </dt-button>\n </template>\n </dt-tooltip>\n <dt-tooltip\n :fallback-placements=\"['top-end', 'auto']\"\n :message=\"i18n.$t('DIALTONE_DATEPICKER_NEXT_YEAR')\"\n placement=\"top\"\n >\n <template #anchor>\n <dt-button\n id=\"nextYearButton\"\n :ref=\"el => { if (el) setDayRef(el) }\"\n :aria-label=\"nextYearAriaLabel()\"\n :circle=\"true\"\n :disabled=\"isNextYearDisabled\"\n class=\"d-datepicker__nav-btn\"\n importance=\"clear\"\n kind=\"muted\"\n size=\"xs\"\n type=\"button\"\n @click=\"changeYear(1)\"\n @keydown=\"handleKeyDown($event)\"\n >\n <dt-icon-chevrons-right\n size=\"200\"\n />\n </dt-button>\n </template>\n </dt-tooltip>\n </dt-stack>\n </dt-stack>\n</template>\n\n<script setup>\nimport {\n DtIconChevronLeft,\n DtIconChevronsLeft,\n DtIconChevronRight,\n DtIconChevronsRight,\n} from '@dialpad/dialtone-icons/vue3';\nimport { DtStack } from '@/components/stack';\nimport { DtButton } from '@/components/button';\nimport { DtTooltip } from '@/components/tooltip';\nimport { onMounted } from 'vue';\nimport { useMonthYearPicker } from '../composables/useMonthYearPicker.js';\nimport { DialtoneLocalization } from '@/localization';\n\nconst props = defineProps({\n selectedDate: {\n type: Date,\n required: true,\n },\n\n minDate: {\n type: Date,\n default: null,\n },\n\n maxDate: {\n type: Date,\n default: null,\n },\n});\n\nconst emits = defineEmits([\n /**\n * Will retrieve the calendar days of the given date\n *\n * @event calendar-days\n * @type {Array}\n */\n 'calendar-days',\n\n /**\n * Will focus first day in calendar\n *\n * @event focus-first-day\n */\n 'focus-first-day',\n\n /**\n * Will focus last day in calendar\n *\n * @event focus-last-day\n */\n 'focus-last-day',\n\n /**\n * Will close the datepicker\n *\n * @event close-datepicker\n */\n 'close-datepicker',\n]);\n\nconst i18n = new DialtoneLocalization();\n\nconst {\n selectMonth,\n selectYear,\n formattedMonth,\n setDayRef,\n focusMonthYearPicker,\n handleKeyDown,\n changeMonth,\n changeYear,\n goToNextMonth,\n goToPrevMonth,\n isPrevMonthDisabled,\n isNextMonthDisabled,\n isPrevYearDisabled,\n isNextYearDisabled,\n previousYearAriaLabel,\n previousMonthAriaLabel,\n nextMonthAriaLabel,\n nextYearAriaLabel,\n} = useMonthYearPicker(props, emits);\n\nonMounted(() => {\n focusMonthYearPicker();\n});\n\ndefineExpose({\n focusMonthYearPicker,\n goToNextMonth,\n goToPrevMonth,\n});\n</script>\n","import { computed, ref, watch, nextTick } from 'vue';\nimport { getWeekDayNames, calculateNextFocusDate, calculatePrevFocusDate, formatDate } from '../utils.js';\nimport { INTL_MONTH_FORMAT, WEEK_START } from '../datepicker_constants.js';\nimport { returnFirstEl } from '@/common/utils';\nimport { DialtoneLocalization } from '@/localization';\n\nexport function useCalendar (props, emits) {\n const selectedDay = ref(null);\n const focusDay = ref(0);\n const daysRef = ref([]);\n const i18n = new DialtoneLocalization();\n\n const weekDays = computed(() => {\n return getWeekDayNames(props.locale, WEEK_START);\n });\n\n watch(() => props.calendarDays, () => {\n focusDay.value = 0;\n daysRef.value = [];\n selectedDay.value = null;\n });\n\n function dayAriaLabel (day) {\n return i18n.$t('DIALTONE_DATEPICKER_SELECT_DAY') + ` ${formatDate(day.value, INTL_MONTH_FORMAT, i18n.currentLocale)}`;\n }\n\n function setDayRef (el, day) {\n if (!daysRef.value.some(day => day.el === el) && !day.disabled) {\n daysRef.value.push({ el, day });\n }\n }\n\n function handleKeyDown (event) {\n switch (event.key) {\n case 'ArrowUp':\n event.preventDefault();\n focusDay.value -= 7;\n try {\n returnFirstEl(daysRef.value[focusDay.value].el.$el).focus();\n } catch {\n const prevFocusDate = calculatePrevFocusDate(daysRef.value[focusDay.value + 7].day.value);\n emits('go-to-prev-month');\n\n nextTick(() => {\n returnFirstEl(daysRef.value[prevFocusDate - 1].el.$el).focus();\n focusDay.value += prevFocusDate - 1;\n });\n }\n break;\n\n case 'ArrowDown':\n event.preventDefault();\n focusDay.value += 7;\n try {\n returnFirstEl(daysRef.value[focusDay.value].el.$el).focus();\n } catch {\n const nextFocusDate = calculateNextFocusDate(daysRef.value[focusDay.value - 7].day.value);\n emits('go-to-next-month');\n\n nextTick(() => {\n returnFirstEl(daysRef.value[nextFocusDate - 1].el.$el).focus();\n focusDay.value += nextFocusDate - 1;\n });\n }\n break;\n\n case 'ArrowLeft':\n event.preventDefault();\n if (focusDay.value > 0) {\n focusDay.value -= 1;\n returnFirstEl(daysRef.value[focusDay.value].el.$el).focus();\n } else {\n // if we are on month first day, jump to last day of prev month\n emits('go-to-prev-month');\n focusLastDay();\n }\n break;\n\n case 'ArrowRight':\n event.preventDefault();\n if (focusDay.value < daysRef.value.length - 1) {\n focusDay.value += 1;\n returnFirstEl(daysRef.value[focusDay.value].el.$el).focus();\n } else {\n // if we are on month last day, jump to first day of next month\n emits('go-to-next-month');\n\n focusFirstDay();\n }\n break;\n\n case 'Tab':\n event.preventDefault();\n emits('focus-month-year-picker');\n break;\n\n case 'Escape':\n emits('close-datepicker');\n break;\n }\n }\n\n function focusFirstDay () {\n focusDay.value = 0;\n\n nextTick(() => {\n returnFirstEl(daysRef.value[focusDay.value].el.$el).focus();\n });\n }\n\n function focusLastDay () {\n nextTick(() => {\n focusDay.value = daysRef.value.length - 1;\n returnFirstEl(daysRef.value[focusDay.value].el.$el).focus();\n });\n }\n\n function selectDay (day) {\n if (day.disabled) { return; }\n\n // local selectedDay is updated when a day is selected\n selectedDay.value = day.text;\n emits('select-date', day.value);\n }\n\n return {\n selectedDay,\n weekDays,\n dayAriaLabel,\n setDayRef,\n handleKeyDown,\n focusFirstDay,\n selectDay,\n };\n}\n","<template>\n <table\n class=\"d-datepicker__calendar\"\n aria-labelledby=\"calendar-heading\"\n >\n <thead>\n <tr>\n <th\n v-for=\"day in weekDays\"\n :key=\"day\"\n scope=\"col\"\n class=\"d-datepicker__cell d-datepicker__cell--header\"\n >\n <span\n class=\"d-datepicker__weekday\"\n :title=\"day\"\n :aria-label=\"day\"\n > {{ day }}</span>\n </th>\n </tr>\n </thead>\n <tbody>\n <tr\n v-for=\"(week, indexWeek) in calendarDays\"\n :key=\"indexWeek\"\n >\n <td\n v-for=\"(day, indexDays) in week.days\"\n :key=\"indexWeek + indexDays\"\n class=\"d-datepicker__cell\"\n role=\"listbox\"\n >\n <dt-button\n :ref=\"el => { if (el) setDayRef(el, day) }\"\n class=\"d-datepicker__day\"\n :circle=\"true\"\n size=\"sm\"\n importance=\"clear\"\n :disabled=\"day.disabled\"\n :class=\"{\n 'd-datepicker__day--disabled': day.disabled,\n 'd-datepicker__day--selected': selectedDay\n ? ((day.text === selectedDay) && !day.disabled)\n : day.selected,\n }\"\n type=\"button\"\n :aria-selected=\"!!selectedDay ? ((day.text === selectedDay) && !day.disabled) : day.selected\"\n :aria-label=\"dayAriaLabel(day)\"\n role=\"option\"\n @click=\"selectDay(day)\"\n @keydown=\"handleKeyDown($event)\"\n >\n {{ day.text }}\n </dt-button>\n </td>\n </tr>\n </tbody>\n </table>\n</template>\n\n<script setup>\nimport { useCalendar } from '../composables/useCalendar.js';\nimport { DtButton } from '@/components/button';\n\nconst props = defineProps({\n calendarDays: {\n type: Array,\n required: true,\n },\n});\n\nconst emits = defineEmits([\n /**\n * Event fired when a date is selected\n *\n * @event select-date\n * @type {Date}\n */\n 'select-date',\n\n /**\n * Will focus the month and year picker\n *\n * @event focus-month-year-picker\n */\n 'focus-month-year-picker',\n\n /**\n * Will close the datepicker\n *\n * @event close-datepicker\n */\n 'close-datepicker',\n\n /**\n * Will go to the next month\n *\n * @event go-to-next-month\n */\n 'go-to-next-month',\n\n /**\n * Will go to the previous month\n *\n * @event go-to-prev-month\n */\n 'go-to-prev-month',\n]);\n\nconst {\n selectedDay,\n weekDays,\n dayAriaLabel,\n setDayRef,\n handleKeyDown,\n focusFirstDay,\n selectDay,\n} = useCalendar(props, emits);\n\ndefineExpose({\n focusFirstDay,\n});\n</script>\n","<!-- eslint-disable vue/multi-word-component-names -->\n<template>\n <dt-stack\n class=\"d-datepicker\"\n gap=\"400\"\n >\n <div class=\"d-datepicker__hd\">\n <month-year-picker\n ref=\"monthYearPicker\"\n :selected-date=\"selectedDate\"\n :min-date=\"minDate\"\n :max-date=\"maxDate\"\n @calendar-days=\"updateCalendarDays\"\n @focus-first-day=\"$refs.calendar.focusFirstDay()\"\n @focus-last-day=\"$refs.calendar.focusLastDay()\"\n @close-datepicker=\"$emit('close-datepicker')\"\n />\n </div>\n <div class=\"d-datepicker__bd\">\n <calendar\n ref=\"calendar\"\n :calendar-days=\"calendarDays\"\n @select-date=\"$emit('selected-date', $event)\"\n @focus-month-year-picker=\"$refs.monthYearPicker.focusMonthYearPicker()\"\n @close-datepicker=\"$emit('close-datepicker')\"\n @go-to-next-month=\"$refs.monthYearPicker.goToNextMonth()\"\n @go-to-prev-month=\"$refs.monthYearPicker.goToPrevMonth()\"\n />\n </div>\n </dt-stack>\n</template>\n\n<script setup>\nimport MonthYearPicker from './modules/month-year-picker.vue';\nimport Calendar from './modules/calendar.vue';\nimport { DtStack } from '@/components/stack';\nimport { returnFirstEl, warnIfUnmounted } from '@/common/utils';\nimport { onMounted, ref, getCurrentInstance } from 'vue';\n\ndefineProps({\n /**\n * Selected date\n *\n * @type {Date}\n */\n selectedDate: {\n type: Date,\n default: () => (new Date()),\n },\n\n /**\n * Minimum selectable date. Days before this date will be disabled.\n * Must be before or equal to maxDate when both are provided.\n *\n * @type {Date}\n */\n minDate: {\n type: Date,\n default: null,\n },\n\n /**\n * Maximum selectable date. Days after this date will be disabled.\n * Must be after or equal to minDate when both are provided.\n *\n * @type {Date}\n */\n maxDate: {\n type: Date,\n default: null,\n validator: (value, props) => {\n if (value && props.minDate && value < props.minDate) {\n console.warn('[DtDatepicker]: maxDate must be after or equal to minDate.');\n return false;\n }\n return true;\n },\n },\n});\n\ndefineEmits([\n /**\n * Event fired when a date is selected\n *\n * @event selected-date\n * @type {Date}\n */\n 'selected-date',\n\n /**\n * Event fired when user presses the esc key\n *\n * @event close-datepicker\n */\n 'close-datepicker',\n]);\n\nconst calendarDays = ref([]);\n\nfunction updateCalendarDays (days) {\n calendarDays.value = days;\n}\n\nonMounted(() => {\n const instance = getCurrentInstance();\n warnIfUnmounted(returnFirstEl(instance.proxy.$el), 'datepicker');\n});\n</script>\n"],"names":["useMonthYearPicker","props","emits","selectMonth","ref","getMonth","selectYear","getYear","highlightedDay","focusPicker","focusRefs","i18n","DialtoneLocalization","calendarDays","computed","getCalendarDays","isPrevMonthDisabled","prevMonth","subMonths","endOfMonth","startOfDay","isNextMonthDisabled","nextMonth","addMonths","startOfMonth","isPrevYearDisabled","prevYearMonth","isNextYearDisabled","nextYearMonth","watch","highlightDay","formattedMonth","month","formatMonth","INTL_MONTH_FORMAT","setDayRef","el","focusMonthYearPicker","returnFirstEl","handleKeyDown","event","year","getDate","changeMonth","value","initialDate","set","newDate","changeYear","goToNextMonth","goToPrevMonth","previousYearAriaLabel","previousMonthAriaLabel","nextYearAriaLabel","nextMonthAriaLabel","__props","__emit","onMounted","__expose","_createBlock","_unref","DtStack","_createVNode","DtTooltip","DtButton","_cache","$event","DtIconChevronsLeft","DtIconChevronLeft","_createElementVNode","_hoisted_1","_toDisplayString","DtIconChevronRight","DtIconChevronsRight","useCalendar","selectedDay","focusDay","daysRef","weekDays","getWeekDayNames","WEEK_START","dayAriaLabel","day","formatDate","prevFocusDate","calculatePrevFocusDate","nextTick","nextFocusDate","calculateNextFocusDate","focusLastDay","focusFirstDay","selectDay","_openBlock","_createElementBlock","_Fragment","_renderList","_hoisted_2","week","indexWeek","indexDays","_createTextVNode","updateCalendarDays","days","instance","getCurrentInstance","warnIfUnmounted","MonthYearPicker","$refs","$emit","Calendar"],"mappings":";;;;;;;;;;AAOO,SAASA,GAAoBC,GAAOC,GAAO;AAChD,QAAMC,IAAcC,EAAIC,EAASJ,EAAM,YAAY,CAAC,GAC9CK,IAAaF,EAAIG,EAAQN,EAAM,YAAY,CAAC,GAC5CO,IAAiBJ,EAAI,IAAI,GACzBK,IAAcL,EAAI,CAAC,GACnBM,IAAYN,EAAI,EAAE,GAClBO,IAAO,IAAIC,EAAoB,GAE/BC,IAAeC,EAAS,MACrBC,GAAgBZ,EAAY,OAAOG,EAAW,OAAOE,EAAe,OAAO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new Date(t):new Date,g=(t,e,a)=>{const o=u(JSON.parse(JSON.stringify(t))),s=[];for(let r=0;r<7;r++){const c=n.addDays(o,r),D=n.getMonth(c)!==e;s.push({text:c.getDate(),value:c,currentMonth:!D,isFirstDayOfMonth:c.getDate()===1&&!D,selected:a?c.getDate()===a&&!D:!1})}return s},h=(t,e)=>!t||!e?!1:n.isEqual(t,e),m=(t,e,a)=>{const o=[],s=u(new Date(e,t)),r=u(new Date(e,t+1,0)),c=y.WEEK_START,D=n.startOfWeek(s,{weekStartsOn:c}),d=i=>{const f=g(i,t,a);if(o.push({days:f}),!o[o.length-1].days.some(l=>h(l.value,r))){const l=n.addDays(i,7);d(l)}};return d(D),o},M=(t,e)=>{const a=[1,2,3,4,5,6,7].map(r=>new Intl.DateTimeFormat(t,{weekday:"short",timeZone:"UTC"}).format(new Date(`2017-01-0${r}T00:00:00+00:00`)).slice(0,2)),o=a.slice(0,e),s=a.slice(e+1,a.length);return[a[e]].concat(...s).concat(...o)},w=(t,e,a)=>new Intl.DateTimeFormat(a,{month:e}).format(new Date(2e3,t,1)),k=(t,e,a)=>new Intl.DateTimeFormat(a,{dateStyle:e}).format(new Date(t)),W=t=>{const e=new Date(t),a=n.getDay(e),o=n.addMonths(e,1),s=n.startOfMonth(o),r=n.getDay(s),c=(a-r+7)%7,D=n.addDays(s,c);return n.getDate(D)},O=t=>{const e=new Date(t),a=n.getDay(e);let s=n.endOfMonth(n.subMonths(e,1));for(;n.getDay(s)!==a;)s=n.addDays(s,-1);return n.getDate(s)};exports.calculateNextFocusDate=W;exports.calculatePrevFocusDate=O;exports.formatDate=k;exports.formatMonth=w;exports.getCalendarDays=m;exports.getWeekDayNames=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("date-fns"),h=require("./datepicker-constants.cjs"),g=t=>t?new Date(t):new Date,m=(t,e,n,c=null,s=null)=>{const o=g(JSON.parse(JSON.stringify(t))),D=c?a.startOfDay(c):null,l=s?a.startOfDay(s):null,i=[];for(let d=0;d<7;d++){const r=a.addDays(o,d),u=a.getMonth(r)!==e,f=u||D&&a.startOfDay(r)<D||l&&a.startOfDay(r)>l;i.push({text:r.getDate(),value:r,currentMonth:!u,disabled:!!f,isFirstDayOfMonth:r.getDate()===1&&!u,selected:n?r.getDate()===n&&!f:!1})}return i},M=(t,e)=>!t||!e?!1:a.isEqual(t,e),w=(t,e,n,c=null,s=null)=>{const o=[],D=g(new Date(e,t)),l=g(new Date(e,t+1,0)),i=h.WEEK_START,d=a.startOfWeek(D,{weekStartsOn:i}),r=u=>{const f=m(u,t,n,c,s);if(o.push({days:f}),!o[o.length-1].days.some(y=>M(y.value,l))){const y=a.addDays(u,7);r(y)}};return r(d),o},O=(t,e)=>{const n=[1,2,3,4,5,6,7].map(o=>new Intl.DateTimeFormat(t,{weekday:"short",timeZone:"UTC"}).format(new Date(`2017-01-0${o}T00:00:00+00:00`)).slice(0,2)),c=n.slice(0,e),s=n.slice(e+1,n.length);return[n[e]].concat(...s).concat(...c)},k=(t,e,n)=>new Intl.DateTimeFormat(n,{month:e}).format(new Date(2e3,t,1)),W=(t,e,n)=>new Intl.DateTimeFormat(n,{dateStyle:e}).format(new Date(t)),x=t=>{const e=new Date(t),n=a.getDay(e),c=a.addMonths(e,1),s=a.startOfMonth(c),o=a.getDay(s),D=(n-o+7)%7,l=a.addDays(s,D);return a.getDate(l)},F=t=>{const e=new Date(t),n=a.getDay(e);let s=a.endOfMonth(a.subMonths(e,1));for(;a.getDay(s)!==n;)s=a.addDays(s,-1);return a.getDate(s)};exports.calculateNextFocusDate=x;exports.calculatePrevFocusDate=F;exports.formatDate=W;exports.formatMonth=k;exports.getCalendarDays=w;exports.getWeekDayNames=O;
2
2
  //# sourceMappingURL=utils.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.cjs","sources":["../../../components/datepicker/utils.js"],"sourcesContent":["import {\n startOfWeek, addDays, getMonth, isEqual,\n addMonths, startOfMonth, getDay, getDate,\n subMonths, endOfMonth,\n} from 'date-fns';\nimport { WEEK_START } from '@/components/datepicker/datepicker_constants.js';\n\nconst _parsedGetDate = (value) => (value ? new Date(value) : new Date());\n\n/**\n * Get 7 days from the provided start date, month is used to check\n * whether the date is from the specified month or in the offset\n */\nconst getWeekDays = (startDay, month, selectedDay) => {\n const startDate = _parsedGetDate(JSON.parse(JSON.stringify(startDay)));\n const dates = [];\n for (let i = 0; i < 7; i++) {\n const next = addDays(startDate, i);\n const isNext = getMonth(next) !== month;\n dates.push({\n text: next.getDate(),\n value: next,\n currentMonth: !isNext,\n isFirstDayOfMonth: next.getDate() === 1 && !isNext,\n // will be selected if the date is the same as the selected day and is from the current month\n selected: selectedDay ? (next.getDate() === selectedDay && !isNext) : false,\n });\n }\n return dates;\n};\n\nconst isDateEqual = (date, dateToCompare) => {\n if (!date || !dateToCompare) {\n return false;\n }\n return isEqual(date, dateToCompare);\n};\n\n/**\n * Get days for the calendar to be displayed in a table grouped by weeks\n */\nexport const getCalendarDays = (month, year, selectedDay) => {\n const weeks = [];\n const firstDate = _parsedGetDate(new Date(year, month));\n const lastDate = _parsedGetDate(new Date(year, month + 1, 0));\n\n const weekStartsOn = WEEK_START;\n\n const firstDateInCalendar = startOfWeek(firstDate, { weekStartsOn });\n\n const addDaysToWeek = (date) => {\n const days = getWeekDays(date, month, selectedDay);\n\n weeks.push({ days });\n\n if (\n !weeks[weeks.length - 1].days.some((day) =>\n isDateEqual(day.value, lastDate),\n )\n ) {\n const nextDate = addDays(date, 7);\n addDaysToWeek(nextDate);\n }\n };\n\n addDaysToWeek(firstDateInCalendar);\n\n return weeks;\n};\n\n/**\n * Generate week day names based on locale and in order specified in week start\n */\nexport const getWeekDayNames = (locale, weekStart) => {\n // Get list in order from sun ... sat\n const days = [1, 2, 3, 4, 5, 6, 7].map((day) => {\n return new Intl.DateTimeFormat(locale, { weekday: 'short', timeZone: 'UTC' })\n .format(new Date(`2017-01-0${day}T00:00:00+00:00`))\n .slice(0, 2);\n });\n\n // Get days that are in order before specified week start\n const beforeWeekStart = days.slice(0, weekStart);\n // Get days that are in order after specified week start\n const afterWeekStart = days.slice(weekStart + 1, days.length);\n\n // return them in correct order\n return [days[weekStart]].concat(...afterWeekStart).concat(...beforeWeekStart);\n};\n\nexport const formatMonth = (month, monthFormat, locale) => {\n return new Intl.DateTimeFormat(locale, { month: monthFormat }).format(new Date(2000, month, 1));\n};\n\nexport const formatDate = (date, dateFormat, locale) => {\n return new Intl.DateTimeFormat(locale, { dateStyle: dateFormat }).format(new Date(date));\n};\n\nexport const calculateNextFocusDate = (currentDate) => {\n const date = new Date(currentDate);\n const currentWeekday = getDay(date);\n const nextMonthDate = addMonths(date, 1);\n const nextMonthStart = startOfMonth(nextMonthDate);\n const nextMonthStartWeekday = getDay(nextMonthStart);\n\n const dayDifference = (currentWeekday - nextMonthStartWeekday + 7) % 7;\n\n // Add the difference in days to the first day of the next month\n const focusDate = addDays(nextMonthStart, dayDifference);\n\n // Returns only the day of the month\n return getDate(focusDate);\n};\n\nexport const calculatePrevFocusDate = (currentDate) => {\n const date = new Date(currentDate);\n const currentWeekday = getDay(date);\n\n // Move to the last day of the previous month\n const lastDayOfPrevMonth = endOfMonth(subMonths(date, 1));\n let focusDate = lastDayOfPrevMonth;\n\n // Adjust to the same weekday in the last week of the previous month\n while (getDay(focusDate) !== currentWeekday) {\n focusDate = addDays(focusDate, -1);\n }\n\n // Returns only the day of the month\n return getDate(focusDate);\n};\n"],"names":["_parsedGetDate","value","getWeekDays","startDay","month","selectedDay","startDate","dates","i","next","addDays","isNext","getMonth","isDateEqual","date","dateToCompare","isEqual","getCalendarDays","year","weeks","firstDate","lastDate","weekStartsOn","WEEK_START","firstDateInCalendar","startOfWeek","addDaysToWeek","days","day","nextDate","getWeekDayNames","locale","weekStart","beforeWeekStart","afterWeekStart","formatMonth","monthFormat","formatDate","dateFormat","calculateNextFocusDate","currentDate","currentWeekday","getDay","nextMonthDate","addMonths","nextMonthStart","startOfMonth","nextMonthStartWeekday","d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EAC3BC,EAAiBC,EAAAA,OAAO5B,CAAI,EAIlC,IAAImC,EADuBG,EAAAA,WAAWC,EAAAA,UAAUvC,EAAM,CAAC,CAAC,EAIxD,KAAO4B,EAAAA,OAAOO,CAAS,IAAMR,GAC3BQ,EAAYvC,EAAAA,QAAQuC,EAAW,EAAE,EAInC,OAAOC,EAAAA,QAAQD,CAAS,CAC1B"}
1
+ {"version":3,"file":"utils.cjs","sources":["../../../components/datepicker/utils.js"],"sourcesContent":["import {\n startOfWeek, startOfDay, addDays, getMonth, isEqual,\n addMonths, startOfMonth, getDay, getDate,\n subMonths, endOfMonth,\n} from 'date-fns';\nimport { WEEK_START } from '@/components/datepicker/datepicker_constants.js';\n\nconst _parsedGetDate = (value) => (value ? new Date(value) : new Date());\n\n/**\n * Get 7 days from the provided start date, month is used to check\n * whether the date is from the specified month or in the offset\n */\nconst getWeekDays = (startDay, month, selectedDay, minDate = null, maxDate = null) => {\n const startDate = _parsedGetDate(JSON.parse(JSON.stringify(startDay)));\n const normalizedMin = minDate ? startOfDay(minDate) : null;\n const normalizedMax = maxDate ? startOfDay(maxDate) : null;\n const dates = [];\n for (let i = 0; i < 7; i++) {\n const next = addDays(startDate, i);\n const isNext = getMonth(next) !== month;\n const disabled = isNext\n || (normalizedMin && startOfDay(next) < normalizedMin)\n || (normalizedMax && startOfDay(next) > normalizedMax);\n dates.push({\n text: next.getDate(),\n value: next,\n currentMonth: !isNext,\n disabled: !!disabled,\n isFirstDayOfMonth: next.getDate() === 1 && !isNext,\n selected: selectedDay ? (next.getDate() === selectedDay && !disabled) : false,\n });\n }\n return dates;\n};\n\nconst isDateEqual = (date, dateToCompare) => {\n if (!date || !dateToCompare) {\n return false;\n }\n return isEqual(date, dateToCompare);\n};\n\n/**\n * Get days for the calendar to be displayed in a table grouped by weeks\n */\nexport const getCalendarDays = (month, year, selectedDay, minDate = null, maxDate = null) => {\n const weeks = [];\n const firstDate = _parsedGetDate(new Date(year, month));\n const lastDate = _parsedGetDate(new Date(year, month + 1, 0));\n\n const weekStartsOn = WEEK_START;\n\n const firstDateInCalendar = startOfWeek(firstDate, { weekStartsOn });\n\n const addDaysToWeek = (date) => {\n const days = getWeekDays(date, month, selectedDay, minDate, maxDate);\n\n weeks.push({ days });\n\n if (\n !weeks[weeks.length - 1].days.some((day) =>\n isDateEqual(day.value, lastDate),\n )\n ) {\n const nextDate = addDays(date, 7);\n addDaysToWeek(nextDate);\n }\n };\n\n addDaysToWeek(firstDateInCalendar);\n\n return weeks;\n};\n\n/**\n * Generate week day names based on locale and in order specified in week start\n */\nexport const getWeekDayNames = (locale, weekStart) => {\n // Get list in order from sun ... sat\n const days = [1, 2, 3, 4, 5, 6, 7].map((day) => {\n return new Intl.DateTimeFormat(locale, { weekday: 'short', timeZone: 'UTC' })\n .format(new Date(`2017-01-0${day}T00:00:00+00:00`))\n .slice(0, 2);\n });\n\n // Get days that are in order before specified week start\n const beforeWeekStart = days.slice(0, weekStart);\n // Get days that are in order after specified week start\n const afterWeekStart = days.slice(weekStart + 1, days.length);\n\n // return them in correct order\n return [days[weekStart]].concat(...afterWeekStart).concat(...beforeWeekStart);\n};\n\nexport const formatMonth = (month, monthFormat, locale) => {\n return new Intl.DateTimeFormat(locale, { month: monthFormat }).format(new Date(2000, month, 1));\n};\n\nexport const formatDate = (date, dateFormat, locale) => {\n return new Intl.DateTimeFormat(locale, { dateStyle: dateFormat }).format(new Date(date));\n};\n\nexport const calculateNextFocusDate = (currentDate) => {\n const date = new Date(currentDate);\n const currentWeekday = getDay(date);\n const nextMonthDate = addMonths(date, 1);\n const nextMonthStart = startOfMonth(nextMonthDate);\n const nextMonthStartWeekday = getDay(nextMonthStart);\n\n const dayDifference = (currentWeekday - nextMonthStartWeekday + 7) % 7;\n\n // Add the difference in days to the first day of the next month\n const focusDate = addDays(nextMonthStart, dayDifference);\n\n // Returns only the day of the month\n return getDate(focusDate);\n};\n\nexport const calculatePrevFocusDate = (currentDate) => {\n const date = new Date(currentDate);\n const currentWeekday = getDay(date);\n\n // Move to the last day of the previous month\n const lastDayOfPrevMonth = endOfMonth(subMonths(date, 1));\n let focusDate = lastDayOfPrevMonth;\n\n // Adjust to the same weekday in the last week of the previous month\n while (getDay(focusDate) !== currentWeekday) {\n focusDate = addDays(focusDate, -1);\n }\n\n // Returns only the day of the month\n return getDate(focusDate);\n};\n"],"names":["_parsedGetDate","value","getWeekDays","startDay","month","selectedDay","minDate","maxDate","startDate","normalizedMin","startOfDay","normalizedMax","dates","i","next","addDays","isNext","getMonth","disabled","isDateEqual","date","dateToCompare","isEqual","getCalendarDays","year","weeks","firstDate","lastDate","weekStartsOn","WEEK_START","firstDateInCalendar","startOfWeek","addDaysToWeek","days","day","nextDate","getWeekDayNames","locale","weekStart","beforeWeekStart","afterWeekStart","formatMonth","monthFormat","formatDate","dateFormat","calculateNextFocusDate","currentDate","currentWeekday","getDay","nextMonthDate","addMonths","nextMonthStart","startOfMonth","nextMonthStartWeekday","dayDifference","focusDate","getDate","calculatePrevFocusDate","endOfMonth","subMonths"],"mappings":"oJAOMA,EAAkBC,GAAWA,EAAQ,IAAI,KAAKA,CAAK,EAAI,IAAI,KAM3DC,EAAc,CAACC,EAAUC,EAAOC,EAAaC,EAAU,KAAMC,EAAU,OAAS,CACpF,MAAMC,EAAYR,EAAe,KAAK,MAAM,KAAK,UAAUG,CAAQ,CAAC,CAAC,EAC/DM,EAAgBH,EAAUI,aAAWJ,CAAO,EAAI,KAChDK,EAAgBJ,EAAUG,aAAWH,CAAO,EAAI,KAChDK,EAAQ,CAAA,EACd,QAASC,EAAI,EAAGA,EAAI,EAAGA,IAAK,CAC1B,MAAMC,EAAOC,EAAAA,QAAQP,EAAWK,CAAC,EAC3BG,EAASC,EAAAA,SAASH,CAAI,IAAMV,EAC5Bc,EAAWF,GACXP,GAAiBC,EAAAA,WAAWI,CAAI,EAAIL,GACpCE,GAAiBD,EAAAA,WAAWI,CAAI,EAAIH,EAC1CC,EAAM,KAAK,CACT,KAAME,EAAK,QAAO,EA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AAK,MAAM,EAAGK,CAAS,EAEzCE,EAAiBP,EAAK,MAAMK,EAAY,EAAGL,EAAK,MAAM,EAG5D,MAAO,CAACA,EAAKK,CAAS,CAAC,EAAE,OAAO,GAAGE,CAAc,EAAE,OAAO,GAAGD,CAAe,CAC9E,EAEaE,EAAc,CAACrC,EAAOsC,EAAaL,IACvC,IAAI,KAAK,eAAeA,EAAQ,CAAE,MAAOK,CAAW,CAAE,EAAE,OAAO,IAAI,KAAK,IAAMtC,EAAO,CAAC,CAAC,EAGnFuC,EAAa,CAACvB,EAAMwB,EAAYP,IACpC,IAAI,KAAK,eAAeA,EAAQ,CAAE,UAAWO,CAAU,CAAE,EAAE,OAAO,IAAI,KAAKxB,CAAI,CAAC,EAG5EyB,EAA0BC,GAAgB,CACrD,MAAM1B,EAAO,IAAI,KAAK0B,CAAW,EAC3BC,EAAiBC,EAAAA,OAAO5B,CAAI,EAC5B6B,EAAgBC,EAAAA,UAAU9B,EAAM,CAAC,EACjC+B,EAAiBC,EAAAA,aAAaH,CAAa,EAC3CI,EAAwBL,EAAAA,OAAOG,CAAc,EAE7CG,GAAiBP,EAAiBM,EAAwB,GAAK,EAG/DE,EAAYxC,EAAAA,QAAQoC,EAAgBG,CAAa,EAGvD,OAAOE,EAAAA,QAAQD,CAAS,CAC1B,EAEaE,EAA0BX,GAAgB,CACrD,MAAM1B,EAAO,IAAI,KAAK0B,CAAW,EAC3BC,EAAiBC,EAAAA,OAAO5B,CAAI,EAIlC,IAAImC,EADuBG,EAAAA,WAAWC,EAAAA,UAAUvC,EAAM,CAAC,CAAC,EAIxD,KAAO4B,EAAAA,OAAOO,CAAS,IAAMR,GAC3BQ,EAAYxC,EAAAA,QAAQwC,EAAW,EAAE,EAInC,OAAOC,EAAAA,QAAQD,CAAS,CAC1B"}
@@ -1,49 +1,49 @@
1
- import { getDay as D, addMonths as y, startOfMonth as w, addDays as f, getDate as h, endOfMonth as M, subMonths as g, startOfWeek as k, getMonth as O, isEqual as W } from "date-fns";
2
- import { WEEK_START as x } from "./datepicker-constants.js";
3
- const u = (t) => t ? new Date(t) : /* @__PURE__ */ new Date(), S = (t, e, n) => {
4
- const s = u(JSON.parse(JSON.stringify(t))), a = [];
5
- for (let o = 0; o < 7; o++) {
6
- const r = f(s, o), c = O(r) !== e;
7
- a.push({
8
- text: r.getDate(),
9
- value: r,
10
- currentMonth: !c,
11
- isFirstDayOfMonth: r.getDate() === 1 && !c,
12
- // will be selected if the date is the same as the selected day and is from the current month
13
- selected: n ? r.getDate() === n && !c : !1
1
+ import { getDay as d, addMonths as g, startOfMonth as k, addDays as h, getDate as M, endOfMonth as O, subMonths as W, startOfWeek as x, startOfDay as i, getMonth as S, isEqual as p } from "date-fns";
2
+ import { WEEK_START as T } from "./datepicker-constants.js";
3
+ const w = (t) => t ? new Date(t) : /* @__PURE__ */ new Date(), F = (t, e, n, r = null, a = null) => {
4
+ const s = w(JSON.parse(JSON.stringify(t))), c = r ? i(r) : null, l = a ? i(a) : null, y = [];
5
+ for (let u = 0; u < 7; u++) {
6
+ const o = h(s, u), D = S(o) !== e, f = D || c && i(o) < c || l && i(o) > l;
7
+ y.push({
8
+ text: o.getDate(),
9
+ value: o,
10
+ currentMonth: !D,
11
+ disabled: !!f,
12
+ isFirstDayOfMonth: o.getDate() === 1 && !D,
13
+ selected: n ? o.getDate() === n && !f : !1
14
14
  });
15
15
  }
16
- return a;
17
- }, p = (t, e) => !t || !e ? !1 : W(t, e), N = (t, e, n) => {
18
- const s = [], a = u(new Date(e, t)), o = u(new Date(e, t + 1, 0)), c = k(a, { weekStartsOn: x }), i = (d) => {
19
- const m = S(d, t, n);
20
- if (s.push({ days: m }), !s[s.length - 1].days.some(
21
- (l) => p(l.value, o)
16
+ return y;
17
+ }, N = (t, e) => !t || !e ? !1 : p(t, e), E = (t, e, n, r = null, a = null) => {
18
+ const s = [], c = w(new Date(e, t)), l = w(new Date(e, t + 1, 0)), u = x(c, { weekStartsOn: T }), o = (D) => {
19
+ const f = F(D, t, n, r, a);
20
+ if (s.push({ days: f }), !s[s.length - 1].days.some(
21
+ (m) => N(m.value, l)
22
22
  )) {
23
- const l = f(d, 7);
24
- i(l);
23
+ const m = h(D, 7);
24
+ o(m);
25
25
  }
26
26
  };
27
- return i(c), s;
28
- }, v = (t, e) => {
29
- const n = [1, 2, 3, 4, 5, 6, 7].map((o) => new Intl.DateTimeFormat(t, { weekday: "short", timeZone: "UTC" }).format(/* @__PURE__ */ new Date(`2017-01-0${o}T00:00:00+00:00`)).slice(0, 2)), s = n.slice(0, e), a = n.slice(e + 1, n.length);
30
- return [n[e]].concat(...a).concat(...s);
31
- }, E = (t, e, n) => new Intl.DateTimeFormat(n, { month: e }).format(new Date(2e3, t, 1)), I = (t, e, n) => new Intl.DateTimeFormat(n, { dateStyle: e }).format(new Date(t)), P = (t) => {
32
- const e = new Date(t), n = D(e), s = y(e, 1), a = w(s), o = D(a), r = (n - o + 7) % 7, c = f(a, r);
33
- return h(c);
34
- }, b = (t) => {
35
- const e = new Date(t), n = D(e);
36
- let a = M(g(e, 1));
37
- for (; D(a) !== n; )
38
- a = f(a, -1);
39
- return h(a);
27
+ return o(u), s;
28
+ }, I = (t, e) => {
29
+ const n = [1, 2, 3, 4, 5, 6, 7].map((s) => new Intl.DateTimeFormat(t, { weekday: "short", timeZone: "UTC" }).format(/* @__PURE__ */ new Date(`2017-01-0${s}T00:00:00+00:00`)).slice(0, 2)), r = n.slice(0, e), a = n.slice(e + 1, n.length);
30
+ return [n[e]].concat(...a).concat(...r);
31
+ }, P = (t, e, n) => new Intl.DateTimeFormat(n, { month: e }).format(new Date(2e3, t, 1)), q = (t, e, n) => new Intl.DateTimeFormat(n, { dateStyle: e }).format(new Date(t)), z = (t) => {
32
+ const e = new Date(t), n = d(e), r = g(e, 1), a = k(r), s = d(a), c = (n - s + 7) % 7, l = h(a, c);
33
+ return M(l);
34
+ }, C = (t) => {
35
+ const e = new Date(t), n = d(e);
36
+ let a = O(W(e, 1));
37
+ for (; d(a) !== n; )
38
+ a = h(a, -1);
39
+ return M(a);
40
40
  };
41
41
  export {
42
- P as calculateNextFocusDate,
43
- b as calculatePrevFocusDate,
44
- I as formatDate,
45
- E as formatMonth,
46
- N as getCalendarDays,
47
- v as getWeekDayNames
42
+ z as calculateNextFocusDate,
43
+ C as calculatePrevFocusDate,
44
+ q as formatDate,
45
+ P as formatMonth,
46
+ E as getCalendarDays,
47
+ I as getWeekDayNames
48
48
  };
49
49
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../components/datepicker/utils.js"],"sourcesContent":["import {\n startOfWeek, addDays, getMonth, isEqual,\n addMonths, startOfMonth, getDay, getDate,\n subMonths, endOfMonth,\n} from 'date-fns';\nimport { WEEK_START } from '@/components/datepicker/datepicker_constants.js';\n\nconst _parsedGetDate = (value) => (value ? new Date(value) : new Date());\n\n/**\n * Get 7 days from the provided start date, month is used to check\n * whether the date is from the specified month or in the offset\n */\nconst getWeekDays = (startDay, month, selectedDay) => {\n const startDate = _parsedGetDate(JSON.parse(JSON.stringify(startDay)));\n const dates = [];\n for (let i = 0; i < 7; i++) {\n const next = addDays(startDate, i);\n const isNext = getMonth(next) !== month;\n dates.push({\n text: next.getDate(),\n value: next,\n currentMonth: !isNext,\n isFirstDayOfMonth: next.getDate() === 1 && !isNext,\n // will be selected if the date is the same as the selected day and is from the current month\n selected: selectedDay ? (next.getDate() === selectedDay && !isNext) : false,\n });\n }\n return dates;\n};\n\nconst isDateEqual = (date, dateToCompare) => {\n if (!date || !dateToCompare) {\n return false;\n }\n return isEqual(date, dateToCompare);\n};\n\n/**\n * Get days for the calendar to be displayed in a table grouped by weeks\n */\nexport const getCalendarDays = (month, year, selectedDay) => {\n const weeks = [];\n const firstDate = _parsedGetDate(new Date(year, month));\n const lastDate = _parsedGetDate(new Date(year, month + 1, 0));\n\n const weekStartsOn = WEEK_START;\n\n const firstDateInCalendar = startOfWeek(firstDate, { weekStartsOn });\n\n const addDaysToWeek = (date) => {\n const days = getWeekDays(date, month, selectedDay);\n\n weeks.push({ days });\n\n if (\n !weeks[weeks.length - 1].days.some((day) =>\n isDateEqual(day.value, lastDate),\n )\n ) {\n const nextDate = addDays(date, 7);\n addDaysToWeek(nextDate);\n }\n };\n\n addDaysToWeek(firstDateInCalendar);\n\n return weeks;\n};\n\n/**\n * Generate week day names based on locale and in order specified in week start\n */\nexport const getWeekDayNames = (locale, weekStart) => {\n // Get list in order from sun ... sat\n const days = [1, 2, 3, 4, 5, 6, 7].map((day) => {\n return new Intl.DateTimeFormat(locale, { weekday: 'short', timeZone: 'UTC' })\n .format(new Date(`2017-01-0${day}T00:00:00+00:00`))\n .slice(0, 2);\n });\n\n // Get days that are in order before specified week start\n const beforeWeekStart = days.slice(0, weekStart);\n // Get days that are in order after specified week start\n const afterWeekStart = days.slice(weekStart + 1, days.length);\n\n // return them in correct order\n return [days[weekStart]].concat(...afterWeekStart).concat(...beforeWeekStart);\n};\n\nexport const formatMonth = (month, monthFormat, locale) => {\n return new Intl.DateTimeFormat(locale, { month: monthFormat }).format(new Date(2000, month, 1));\n};\n\nexport const formatDate = (date, dateFormat, locale) => {\n return new Intl.DateTimeFormat(locale, { dateStyle: dateFormat }).format(new Date(date));\n};\n\nexport const calculateNextFocusDate = (currentDate) => {\n const date = new Date(currentDate);\n const currentWeekday = getDay(date);\n const nextMonthDate = addMonths(date, 1);\n const nextMonthStart = startOfMonth(nextMonthDate);\n const nextMonthStartWeekday = getDay(nextMonthStart);\n\n const dayDifference = (currentWeekday - nextMonthStartWeekday + 7) % 7;\n\n // Add the difference in days to the first day of the next month\n const focusDate = addDays(nextMonthStart, dayDifference);\n\n // Returns only the day of the month\n return getDate(focusDate);\n};\n\nexport const calculatePrevFocusDate = (currentDate) => {\n const date = new Date(currentDate);\n const currentWeekday = getDay(date);\n\n // Move to the last day of the previous month\n const lastDayOfPrevMonth = endOfMonth(subMonths(date, 1));\n let focusDate = lastDayOfPrevMonth;\n\n // Adjust to the same weekday in the last week of the previous month\n while (getDay(focusDate) !== currentWeekday) {\n focusDate = addDays(focusDate, -1);\n }\n\n // Returns only the day of the month\n return getDate(focusDate);\n};\n"],"names":["_parsedGetDate","value","getWeekDays","startDay","month","selectedDay","startDate","dates","i","next","addDays","isNext","getMonth","isDateEqual","date","dateToCompare","isEqual","getCalendarDays","year","weeks","firstDate","lastDate","firstDateInCalendar","startOfWeek","WEEK_START","addDaysToWeek","days","day","nextDate","getWeekDayNames","locale","weekStart","beforeWeekStart","afterWeekStart","formatMonth","monthFormat","formatDate","dateFormat","calculateNextFocusDate","currentDate","currentWeekday","getDay","nextMonthDate","addMonths","nextMonthStart","startOfMonth","nextMonthStartWeekday","dayDifference","focusDate","getDate","calculatePrevFocusDate","endOfMonth","subMonths"],"mappings":";;AAOA,MAAMA,IAAiB,CAACC,MAAWA,IAAQ,IAAI,KAAKA,CAAK,IAAI,oBAAI,QAM3DC,IAAc,CAACC,GAAUC,GAAOC,MAAgB;AACpD,QAAMC,IAAYN,EAAe,KAAK,MAAM,KAAK,UAAUG,CAAQ,CAAC,CAAC,GAC/DI,IAAQ,CAAA;AACd,WAASC,IAAI,GAAGA,IAAI,GAAGA,KAAK;AAC1B,UAAMC,IAAOC,EAAQJ,GAAWE,CAAC,GAC3BG,IAASC,EAASH,CAAI,MAAML;AAClC,IAAAG,EAAM,KAAK;AAAA,MACT,MAAME,EAAK,QAAO;AAAA,MAClB,OAAOA;AAAA,MACP,cAAc,CAACE;AAAA,MACf,mBAAmBF,EAAK,cAAc,KAAK,CAACE;AAAA;AAAA,MAE5C,UAAUN,IAAeI,EAAK,QAAO,MAAOJ,KAAe,CAACM,IAAU;AAAA,IAC5E,CAAK;AAAA,EACH;AACA,SAAOJ;AACT,GAEMM,IAAc,CAACC,GAAMC,MACrB,CAACD,KAAQ,CAACC,IACL,KAEFC,EAAQF,GAAMC,CAAa,GAMvBE,IAAkB,CAACb,GAAOc,GAAMb,MAAgB;AAC3D,QAAMc,IAAQ,CAAA,GACRC,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AAE,WAAWO,EAAU,CAAE,EAAE,OAAO,IAAI,KAAKvB,CAAI,CAAC,GAG5EwB,IAAyB,CAACC,MAAgB;AACrD,QAAMzB,IAAO,IAAI,KAAKyB,CAAW,GAC3BC,IAAiBC,EAAO3B,CAAI,GAC5B4B,IAAgBC,EAAU7B,GAAM,CAAC,GACjC8B,IAAiBC,EAAaH,CAAa,GAC3CI,IAAwBL,EAAOG,CAAc,GAE7CG,KAAiBP,IAAiBM,IAAwB,KAAK,GAG/DE,IAAYtC,EAAQkC,GAAgBG,CAAa;AAGvD,SAAOE,EAAQD,CAAS;AAC1B,GAEaE,IAAyB,CAACX,MAAgB;AACrD,QAAMzB,IAAO,IAAI,KAAKyB,CAAW,GAC3BC,IAAiBC,EAAO3B,CAAI;AAIlC,MAAIkC,IADuBG,EAAWC,EAAUtC,GAAM,CAAC,CAAC;AAIxD,SAAO2B,EAAOO,CAAS,MAAMR;AAC3B,IAAAQ,IAAYtC,EAAQsC,GAAW,EAAE;AAInC,SAAOC,EAAQD,CAAS;AAC1B;"}
1
+ {"version":3,"file":"utils.js","sources":["../../../components/datepicker/utils.js"],"sourcesContent":["import {\n startOfWeek, startOfDay, addDays, getMonth, isEqual,\n addMonths, startOfMonth, getDay, getDate,\n subMonths, endOfMonth,\n} from 'date-fns';\nimport { WEEK_START } from '@/components/datepicker/datepicker_constants.js';\n\nconst _parsedGetDate = (value) => (value ? new Date(value) : new Date());\n\n/**\n * Get 7 days from the provided start date, month is used to check\n * whether the date is from the specified month or in the offset\n */\nconst getWeekDays = (startDay, month, selectedDay, minDate = null, maxDate = null) => {\n const startDate = _parsedGetDate(JSON.parse(JSON.stringify(startDay)));\n const normalizedMin = minDate ? startOfDay(minDate) : null;\n const normalizedMax = maxDate ? startOfDay(maxDate) : null;\n const dates = [];\n for (let i = 0; i < 7; i++) {\n const next = addDays(startDate, i);\n const isNext = getMonth(next) !== month;\n const disabled = isNext\n || (normalizedMin && startOfDay(next) < normalizedMin)\n || (normalizedMax && startOfDay(next) > normalizedMax);\n dates.push({\n text: next.getDate(),\n value: next,\n currentMonth: !isNext,\n disabled: !!disabled,\n isFirstDayOfMonth: next.getDate() === 1 && !isNext,\n selected: selectedDay ? (next.getDate() === selectedDay && !disabled) : false,\n });\n }\n return dates;\n};\n\nconst isDateEqual = (date, dateToCompare) => {\n if (!date || !dateToCompare) {\n return false;\n }\n return isEqual(date, dateToCompare);\n};\n\n/**\n * Get days for the calendar to be displayed in a table grouped by weeks\n */\nexport const getCalendarDays = (month, year, selectedDay, minDate = null, maxDate = null) => {\n const weeks = [];\n const firstDate = _parsedGetDate(new Date(year, month));\n const lastDate = _parsedGetDate(new Date(year, month + 1, 0));\n\n const weekStartsOn = WEEK_START;\n\n const firstDateInCalendar = startOfWeek(firstDate, { weekStartsOn });\n\n const addDaysToWeek = (date) => {\n const days = getWeekDays(date, month, selectedDay, minDate, maxDate);\n\n weeks.push({ days });\n\n if (\n !weeks[weeks.length - 1].days.some((day) =>\n isDateEqual(day.value, lastDate),\n )\n ) {\n const nextDate = addDays(date, 7);\n addDaysToWeek(nextDate);\n }\n };\n\n addDaysToWeek(firstDateInCalendar);\n\n return weeks;\n};\n\n/**\n * Generate week day names based on locale and in order specified in week start\n */\nexport const getWeekDayNames = (locale, weekStart) => {\n // Get list in order from sun ... sat\n const days = [1, 2, 3, 4, 5, 6, 7].map((day) => {\n return new Intl.DateTimeFormat(locale, { weekday: 'short', timeZone: 'UTC' })\n .format(new Date(`2017-01-0${day}T00:00:00+00:00`))\n .slice(0, 2);\n });\n\n // Get days that are in order before specified week start\n const beforeWeekStart = days.slice(0, weekStart);\n // Get days that are in order after specified week start\n const afterWeekStart = days.slice(weekStart + 1, days.length);\n\n // return them in correct order\n return [days[weekStart]].concat(...afterWeekStart).concat(...beforeWeekStart);\n};\n\nexport const formatMonth = (month, monthFormat, locale) => {\n return new Intl.DateTimeFormat(locale, { month: monthFormat }).format(new Date(2000, month, 1));\n};\n\nexport const formatDate = (date, dateFormat, locale) => {\n return new Intl.DateTimeFormat(locale, { dateStyle: dateFormat }).format(new Date(date));\n};\n\nexport const calculateNextFocusDate = (currentDate) => {\n const date = new Date(currentDate);\n const currentWeekday = getDay(date);\n const nextMonthDate = addMonths(date, 1);\n const nextMonthStart = startOfMonth(nextMonthDate);\n const nextMonthStartWeekday = getDay(nextMonthStart);\n\n const dayDifference = (currentWeekday - nextMonthStartWeekday + 7) % 7;\n\n // Add the difference in days to the first day of the next month\n const focusDate = addDays(nextMonthStart, dayDifference);\n\n // Returns only the day of the month\n return getDate(focusDate);\n};\n\nexport const calculatePrevFocusDate = (currentDate) => {\n const date = new Date(currentDate);\n const currentWeekday = getDay(date);\n\n // Move to the last day of the previous month\n const lastDayOfPrevMonth = endOfMonth(subMonths(date, 1));\n let focusDate = lastDayOfPrevMonth;\n\n // Adjust to the same weekday in the last week of the previous month\n while (getDay(focusDate) !== currentWeekday) {\n focusDate = addDays(focusDate, -1);\n }\n\n // Returns only the day of the month\n return getDate(focusDate);\n};\n"],"names":["_parsedGetDate","value","getWeekDays","startDay","month","selectedDay","minDate","maxDate","startDate","normalizedMin","startOfDay","normalizedMax","dates","i","next","addDays","isNext","getMonth","disabled","isDateEqual","date","dateToCompare","isEqual","getCalendarDays","year","weeks","firstDate","lastDate","firstDateInCalendar","startOfWeek","WEEK_START","addDaysToWeek","days","day","nextDate","getWeekDayNames","locale","weekStart","beforeWeekStart","afterWeekStart","formatMonth","monthFormat","formatDate","dateFormat","calculateNextFocusDate","currentDate","currentWeekday","getDay","nextMonthDate","addMonths","nextMonthStart","startOfMonth","nextMonthStartWeekday","dayDifference","focusDate","getDate","calculatePrevFocusDate","endOfMonth","subMonths"],"mappings":";;AAOA,MAAMA,IAAiB,CAACC,MAAWA,IAAQ,IAAI,KAAKA,CAAK,IAAI,oBAAI,QAM3DC,IAAc,CAACC,GAAUC,GAAOC,GAAaC,IAAU,MAAMC,IAAU,SAAS;AACpF,QAAMC,IAAYR,EAAe,KAAK,MAAM,KAAK,UAAUG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AACrD,QAAMzB,IAAO,IAAI,KAAKyB,CAAW,GAC3BC,IAAiBC,EAAO3B,CAAI;AAIlC,MAAIkC,IADuBG,EAAWC,EAAUtC,GAAM,CAAC,CAAC;AAIxD,SAAO2B,EAAOO,CAAS,MAAMR;AAC3B,IAAAQ,IAAYvC,EAAQuC,GAAW,EAAE;AAInC,SAAOC,EAAQD,CAAS;AAC1B;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./general-row.cjs"),R=require("./general-row-constants.cjs");exports.DtRecipeGeneralRow=_.default;exports.LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS=R.LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS;exports.LEFTBAR_GENERAL_ROW_CONTACT_CENTER_VALIDATION_ERROR=R.LEFTBAR_GENERAL_ROW_CONTACT_CENTER_VALIDATION_ERROR;exports.LEFTBAR_GENERAL_ROW_ICON_SIZES=R.LEFTBAR_GENERAL_ROW_ICON_SIZES;exports.LEFTBAR_GENERAL_ROW_TYPES=R.LEFTBAR_GENERAL_ROW_TYPES;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./general-row.cjs"),E=require("./leftbar-general-row-icon.cjs"),R=require("./general-row-constants.cjs");exports.DtRecipeGeneralRow=_.default;exports.DtRecipeLeftbarGeneralRowIcon=E.default;exports.LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS=R.LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS;exports.LEFTBAR_GENERAL_ROW_CONTACT_CENTER_VALIDATION_ERROR=R.LEFTBAR_GENERAL_ROW_CONTACT_CENTER_VALIDATION_ERROR;exports.LEFTBAR_GENERAL_ROW_ICON_SIZES=R.LEFTBAR_GENERAL_ROW_ICON_SIZES;exports.LEFTBAR_GENERAL_ROW_TYPES=R.LEFTBAR_GENERAL_ROW_TYPES;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,10 +1,12 @@
1
1
  import { default as _ } from "./general-row.js";
2
- import { LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS as T, LEFTBAR_GENERAL_ROW_CONTACT_CENTER_VALIDATION_ERROR as O, LEFTBAR_GENERAL_ROW_ICON_SIZES as L, LEFTBAR_GENERAL_ROW_TYPES as N } from "./general-row-constants.js";
2
+ import { default as A } from "./leftbar-general-row-icon.js";
3
+ import { LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS as L, LEFTBAR_GENERAL_ROW_CONTACT_CENTER_VALIDATION_ERROR as O, LEFTBAR_GENERAL_ROW_ICON_SIZES as N, LEFTBAR_GENERAL_ROW_TYPES as o } from "./general-row-constants.js";
3
4
  export {
4
5
  _ as DtRecipeGeneralRow,
5
- T as LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS,
6
+ A as DtRecipeLeftbarGeneralRowIcon,
7
+ L as LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS,
6
8
  O as LEFTBAR_GENERAL_ROW_CONTACT_CENTER_VALIDATION_ERROR,
7
- L as LEFTBAR_GENERAL_ROW_ICON_SIZES,
8
- N as LEFTBAR_GENERAL_ROW_TYPES
9
+ N as LEFTBAR_GENERAL_ROW_ICON_SIZES,
10
+ o as LEFTBAR_GENERAL_ROW_TYPES
9
11
  };
10
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const P=require("./last-active-nodes.cjs"),k=require("../../common/utils/index.cjs"),f=require("@tiptap/core"),b=require("../../node_modules/@tiptap/vue-3.cjs"),d=require("@dialpad/dialtone-icons/vue3"),T=require("../../localization/index.cjs"),e=require("vue"),v=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),B=require("../button/button.cjs"),V=require("../item-layout/item-layout.cjs"),j=require("./message-input-topbar.cjs"),N=require("./message-input-link.cjs"),S=require("../editor/editor-constants.cjs"),A=require("../stack/stack.cjs"),M=require("../tooltip/tooltip.cjs"),q=require("../rich-text-editor/rich-text-editor.cjs"),F=require("../popover/popover.cjs"),R=require("../input/input.cjs"),z=require("../emoji-picker/emoji-picker.cjs"),C=require("../rich-text-editor/rich-text-editor-constants.cjs"),U={name:"MeetingPill",components:{NodeViewWrapper:b.NodeViewWrapper,DtItemLayout:V.default,DtIconClose:d.DtIconClose,DtButton:B.default,DtIconVideo:d.DtIconVideo},props:b.nodeViewProps,emits:["meeting-pill-close"],data(){return{i18n:new T.DialtoneLocalization}},computed:{closeButtonTitle(){return this.i18n.$t("DIALTONE_CLOSE_BUTTON")}},methods:{close(i){var o,r,l;const t=(l=(r=(o=this.editor)==null?void 0:o.storage)==null?void 0:r.meetingPill)==null?void 0:l.onClose;t&&typeof t=="function"&&t(i)}}},H={class:"d-recipe-message-input-meeting-pill__icon"},G={class:"d-recipe-message-input-meeting-pill__close"};function W(i,t,o,r,l,n){const m=e.resolveComponent("dt-icon-video"),p=e.resolveComponent("dt-icon-close"),h=e.resolveComponent("dt-button"),g=e.resolveComponent("dt-item-layout"),c=e.resolveComponent("node-view-wrapper");return e.openBlock(),e.createBlock(c,{class:"d-recipe-message-input-meeting-pill"},{default:e.withCtx(()=>[e.createVNode(g,{class:"d-recipe-message-input-meeting-pill__layout",unstyled:""},{left:e.withCtx(()=>[e.createElementVNode("div",H,[e.createVNode(m,{size:"400"})])]),right:e.withCtx(()=>[e.createElementVNode("div",G,[e.createVNode(h,{circle:"",importance:"clear",size:"xs","aria-label":n.closeButtonTitle,title:n.closeButtonTitle,onClick:n.close},{icon:e.withCtx(()=>[e.createVNode(p,{size:"300"})]),_:1},8,["aria-label","title","onClick"])])]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(i.node.attrs.text)+" ",1)]),_:1})]),_:1})}const K=v._(U,[["render",W]]),X=f.Node.create({name:"meetingPill",atom:!0,group:"inline",inline:!0,addOptions(){return{onClose:()=>{}}},addStorage(){return{onClose:this.options.onClose}},addNodeView(){return b.VueNodeViewRenderer(K)},addAttributes(){return{text:{default:'Please pass in "text" attribute'}}},parseHTML(){return[{tag:"meeting-pill"}]},renderText(){return"/dpm"},renderHTML({HTMLAttributes:i}){return["meeting-pill",f.mergeAttributes(i)]}}),Q={compatConfig:{MODE:3},name:"DtRecipeMessageInput",components:{DtButton:B.default,DtEmojiPicker:z.default,DtInput:R.default,DtPopover:F.default,DtRecipeMessageInputTopbar:j.default,DtRecipeMessageInputLink:N.default,DtRichTextEditor:q.default,DtTooltip:M.default,DtStack:A.default,DtIconImage:d.DtIconImage,DtIconVerySatisfied:d.DtIconVerySatisfied,DtIconSatisfied:d.DtIconSatisfied,DtIconSend:d.DtIconSend},inheritAttrs:!1,props:{richText:{type:Boolean,default:!0},modelValue:{type:[Object,String],default:""},editable:{type:Boolean,default:!0},inputAriaLabel:{type:String,required:!0,default:""},preventTyping:{type:Boolean,default:!1},inputClass:{type:String,default:""},autoFocus:{type:[Boolean,String,Number],default:!1,validator(i){return typeof i=="string"?C.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(i):!0}},outputFormat:{type:String,default:"json",validator(i){return C.RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(i)}},placeholder:{type:String,default:""},disableSend:{type:Boolean,default:!1},maxHeight:{type:String,default:"unset"},showEmojiPicker:{type:Boolean,default:!0},emojiPickerProps:{type:Object,default:()=>({})},showCharacterLimit:{type:[Boolean,Object],default:()=>({count:1500,warning:500,message:""})},showImagePicker:{type:[Boolean,Object],default:()=>({})},showSend:{type:[Boolean,Object],default:()=>({})},showCancel:{type:[Boolean,Object],default:()=>({})},mentionSuggestion:{type:Object,default:null},channelSuggestion:{type:Object,default:null},slashCommandSuggestion:{type:Object,default:null},boldButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + B"})},italicButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + I"})},strikeButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + Shift + S"})},linkButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + K",linkPlaceholder:"e.g. https://www.dialpad.com"})},bulletListButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + Shift + 8"})},orderedListButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + Shift + 7"})},blockQuoteButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + Shift + B"})},codeButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + E"})},codeBlockButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + Alt + C"})}},emits:["submit","select-media","add-media","paste-media","cancel","skin-tone","selected-emoji","selected-command","meeting-pill-close","update:modelValue","text-input","markdown-input","add-emoji","emoji-scroll-bottom-reached"],data(){return{lastActiveNodes:P.default,additionalExtensions:[X.configure({onClose:i=>{this.$emit("meeting-pill-close",i)}})],internalInputValue:this.modelValue,imagePickerFocus:!1,emojiPickerFocus:!1,emojiPickerOpened:!1,isFocused:!1,linkOptions:{class:"d-link d-c-text d-d-inline-block"},linkDialogOpen:!1,selectedText:"",text:"",hideLinkBubbleMenu:!1,i18n:new T.DialtoneLocalization}},computed:{showSendIcon(){return!this.showSend.text},inputLength(){return this.text.length},displayCharacterLimitWarning(){return!!this.showCharacterLimit&&this.showCharacterLimit.count-this.inputLength<=this.showCharacterLimit.warning},characterLimitTooltipEnabled(){return this.showCharacterLimit.message&&this.showCharacterLimit.count-this.inputLength<0},isSendDisabled(){return this.disableSend||this.showCharacterLimit&&this.inputLength>this.showCharacterLimit.count},emojiPickerHovered(){return this.emojiPickerFocus||this.emojiPickerOpened},sendIconSize(){return"300"},sendButtonLabel(){return this.i18n.$t("DIALTONE_MESSAGE_INPUT_SEND_BUTTON_ARIA_LABEL")},imagePickerButtonLabel(){return this.i18n.$t("DIALTONE_MESSAGE_INPUT_IMAGE_PICKER_BUTTON_ARIA_LABEL")},emojiPickerButtonLabel(){return this.i18n.$t("DIALTONE_MESSAGE_INPUT_EMOJI_PICKER_BUTTON_ARIA_LABEL")},cancelButtonLabel(){return this.i18n.$t("DIALTONE_MESSAGE_INPUT_CANCEL_BUTTON_ARIA_LABEL")}},watch:{modelValue(i){this.internalInputValue=i},emojiPickerOpened(i){var t;i||(t=this.$refs.richTextEditor)==null||t.focusEditor()}},created(){this.modelValue&&this.outputFormat==="text"?this.internalInputValue=this.modelValue.replace(/\n/g,"<br>"):this.internalInputValue=this.modelValue},methods:{removeClassStyleAttrs:k.removeClassStyleAttrs,addClassStyleAttrs:k.addClassStyleAttrs,linkDialogOpened(i){var t;this.linkDialogOpen=i,i===!0?this.initLinkDialog():(this.hideLinkBubbleMenu=!1,(t=this.$refs.richTextEditor)==null||t.focusEditor())},handleTopbarClick(i){var r;const t=(r=this.$refs.richTextEditor)==null?void 0:r.editor,o={bold:()=>t==null?void 0:t.chain().focus().toggleBold().run(),italic:()=>t==null?void 0:t.chain().focus().toggleItalic().run(),strike:()=>t==null?void 0:t.chain().focus().toggleStrike().run(),bulletList:()=>t==null?void 0:t.chain().focus().toggleBulletList().run(),orderedList:()=>t==null?void 0:t.chain().focus().toggleOrderedList().run(),blockquote:()=>t==null?void 0:t.chain().focus().toggleBlockquote().run(),code:()=>t==null?void 0:t.chain().focus().toggleCode().run(),codeBlock:()=>t==null?void 0:t.chain().focus().toggleCodeBlock().run()};t&&o[i]&&o[i]()},isSelectionActive(i){var t,o,r,l;return["bulletList","orderedList"].includes(i)?this.lastActiveNodes((o=(t=this.$refs.richTextEditor)==null?void 0:t.editor)==null?void 0:o.state,[{type:"bulletList"},{type:"orderedList"}]).includes(i)&&this.isFocused:((l=(r=this.$refs.richTextEditor)==null?void 0:r.editor)==null?void 0:l.isActive(i))&&this.isFocused},initLinkDialog(){var i,t,o;this.$refs.link.setInitialValues(this.selectedText,(o=(t=(i=this.$refs.richTextEditor)==null?void 0:i.editor)==null?void 0:t.getAttributes("link"))==null?void 0:o.href),this.hideLinkBubbleMenu=!0,this.linkDialogOpen=!0},removeLink(){var i;(i=this.$refs.richTextEditor)==null||i.removeLink(),this.linkDialogOpen=!1},setLink(i,t){this.$refs.richTextEditor.setLink(t,i,this.linkOptions,S.EDITOR_SUPPORTED_LINK_PROTOCOLS,S.EDITOR_DEFAULT_LINK_PREFIX),this.linkDialogOpen=!1},onMousedown(i){k.returnFirstEl(this.$refs.richTextEditor.$el).querySelector(".tiptap").contains(i.target)||(i.preventDefault(),this.$refs.richTextEditor.focusEditor())},onDrop(i){const t=i.dataTransfer,o=Array.from(t.files);this.$emit("add-media",o)},onPaste(i){if(i.clipboardData.files.length){i.stopPropagation(),i.preventDefault();const t=[...i.clipboardData.files];this.$emit("paste-media",t)}},onSkinTone(i){this.$emit("skin-tone",i)},onSelectEmoji(i,t){i&&(i.shift_key||t(),this.$refs.richTextEditor.editor.commands.insertContent({type:"emoji",attrs:{code:i.shortname,image:i.image,name:i.name}}),this.$emit("selected-emoji",i))},onSelectImage(){this.$refs.messageInputImageUpload.$refs.input.click()},onImageUpload(){this.$emit("select-media",this.$refs.messageInputImageUpload.$refs.input.files)},toggleEmojiPicker(){this.emojiPickerOpened=!this.emojiPickerOpened},onSend(){this.isSendDisabled||this.$emit("submit",this.internalInputValue)},onCancel(){this.$emit("cancel")},onInput(i){this.$emit("update:modelValue",i)},onTextInput(i){this.text=i,this.$emit("text-input",i)},onMarkdownInput(i){this.$emit("markdown-input",i)}}},J={class:"d-recipe-message-input__bottom-section"},Y={class:"d-recipe-message-input__bottom-section-left"},Z={class:"d-recipe-message-input__bottom-section-right"},$={class:"d-recipe-message-input__schedule-message"},ee={class:"d-recipe-message-input__sms-count"},te={key:0};function ie(i,t,o,r,l,n){const m=e.resolveComponent("dt-recipe-message-input-link"),p=e.resolveComponent("dt-recipe-message-input-topbar"),h=e.resolveComponent("dt-rich-text-editor"),g=e.resolveComponent("dt-icon-image"),c=e.resolveComponent("dt-button"),I=e.resolveComponent("dt-input"),w=e.resolveComponent("dt-icon-very-satisfied"),L=e.resolveComponent("dt-icon-satisfied"),y=e.resolveComponent("dt-emoji-picker"),E=e.resolveComponent("dt-popover"),_=e.resolveComponent("dt-stack"),O=e.resolveComponent("dt-tooltip"),x=e.resolveComponent("dt-icon-send"),D=e.resolveDirective("dt-scrollbar"),u=e.resolveDirective("dt-tooltip");return e.openBlock(),e.createElementBlock("div",e.mergeProps({"data-qa":"dt-recipe-message-input",role:"presentation",class:"d-recipe-message-input"},n.addClassStyleAttrs(i.$attrs),{onDragover:t[15]||(t[15]=e.withModifiers(()=>{},["prevent"])),onDrop:t[16]||(t[16]=e.withModifiers((...s)=>n.onDrop&&n.onDrop(...s),["prevent"])),onPaste:t[17]||(t[17]=(...s)=>n.onPaste&&n.onPaste(...s)),onMousedown:t[18]||(t[18]=(...s)=>n.onMousedown&&n.onMousedown(...s))}),[e.renderSlot(i.$slots,"top"),o.richText?(e.openBlock(),e.createBlock(p,{key:l.selectedText,"bold-button-options":o.boldButtonOptions,"italic-button-options":o.italicButtonOptions,"strike-button-options":o.strikeButtonOptions,"bullet-list-button-options":o.bulletListButtonOptions,"ordered-list-button-options":o.orderedListButtonOptions,"block-quote-button-options":o.blockQuoteButtonOptions,"code-button-options":o.codeButtonOptions,"code-block-button-options":o.codeBlockButtonOptions,"is-selection-active":n.isSelectionActive,onClick:n.handleTopbarClick},{link:e.withCtx(()=>[e.createVNode(m,{ref:"link",open:l.linkDialogOpen,"link-button-options":o.linkButtonOptions,"is-selection-active":n.isSelectionActive,onOpened:n.linkDialogOpened,onSetLink:n.setLink,onRemoveLink:n.removeLink},null,8,["open","link-button-options","is-selection-active","onOpened","onSetLink","onRemoveLink"])]),_:1},8,["bold-button-options","italic-button-options","strike-button-options","bullet-list-button-options","ordered-list-button-options","block-quote-button-options","code-button-options","code-block-button-options","is-selection-active","onClick"])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"d-recipe-message-input__editor-wrapper",style:e.normalizeStyle({"max-height":o.maxHeight})},[e.createVNode(h,e.mergeProps({ref:"richTextEditor",modelValue:l.internalInputValue,"onUpdate:modelValue":t[0]||(t[0]=s=>l.internalInputValue=s),"allow-blockquote":o.richText,"allow-bold":o.richText,"allow-bullet-list":o.richText,"allow-code":o.richText,"allow-codeblock":o.richText,"allow-italic":o.richText,"allow-strike":o.richText,"allow-underline":o.richText,"paste-rich-text":o.richText,editable:o.editable,"input-aria-label":o.inputAriaLabel,"input-class":o.inputClass,"output-format":o.outputFormat,"auto-focus":o.autoFocus,link:o.richText,placeholder:o.placeholder,"prevent-typing":o.preventTyping,"mention-suggestion":o.mentionSuggestion,"channel-suggestion":o.channelSuggestion,"slash-command-suggestion":o.slashCommandSuggestion,"additional-extensions":l.additionalExtensions,"hide-link-bubble-menu":l.hideLinkBubbleMenu},n.removeClassStyleAttrs(i.$attrs),{onInput:n.onInput,onTextInput:n.onTextInput,onMarkdownInput:n.onMarkdownInput,onEnter:n.onSend,onSelected:t[1]||(t[1]=s=>l.selectedText=s),onSelectedCommand:t[2]||(t[2]=s=>i.$emit("selected-command",s)),onEditLink:n.initLinkDialog,onFocus:t[3]||(t[3]=s=>l.isFocused=!0),onBlur:t[4]||(t[4]=s=>l.isFocused=!1)}),null,16,["modelValue","allow-blockquote","allow-bold","allow-bullet-list","allow-code","allow-codeblock","allow-italic","allow-strike","allow-underline","paste-rich-text","editable","input-aria-label","input-class","output-format","auto-focus","link","placeholder","prevent-typing","mention-suggestion","channel-suggestion","slash-command-suggestion","additional-extensions","hide-link-bubble-menu","onInput","onTextInput","onMarkdownInput","onEnter","onEditLink"])],4)),[[D]]),e.renderSlot(i.$slots,"middle"),e.createElementVNode("section",J,[e.createElementVNode("div",Y,[e.createVNode(_,{gap:"200",direction:"row"},{default:e.withCtx(()=>[o.showImagePicker?e.withDirectives((e.openBlock(),e.createBlock(c,{key:0,"data-qa":"dt-recipe-message-input-image-btn",size:"sm",class:"d-recipe-message-input__button",kind:"muted",importance:"clear","aria-label":n.imagePickerButtonLabel,onClick:n.onSelectImage,onMouseenter:t[5]||(t[5]=s=>l.imagePickerFocus=!0),onMouseleave:t[6]||(t[6]=s=>l.imagePickerFocus=!1),onFocus:t[7]||(t[7]=s=>l.imagePickerFocus=!0),onBlur:t[8]||(t[8]=s=>l.imagePickerFocus=!1)},{icon:e.withCtx(()=>[e.createVNode(g,{size:"300"})]),_:1},8,["aria-label","onClick"])),[[u,n.imagePickerButtonLabel,"top-start"]]):e.createCommentVNode("",!0),e.createVNode(I,{ref:"messageInputImageUpload","data-qa":"dt-recipe-message-input-image-input",accept:"image/*, video/*",type:"file",class:"d-recipe-message-input__image-input",multiple:"",hidden:"",onInput:n.onImageUpload},null,8,["onInput"]),o.showEmojiPicker?(e.openBlock(),e.createBlock(E,{key:1,"open.sync":"emojiPickerOpened","data-qa":"dt-recipe-message-input-emoji-picker-popover","initial-focus-element":"#searchInput",padding:"none"},{anchor:e.withCtx(({attrs:s})=>[e.withDirectives((e.openBlock(),e.createBlock(c,e.mergeProps(s,{"data-qa":"dt-recipe-message-input-emoji-picker-btn",size:"sm",class:"d-recipe-message-input__button",kind:"muted",importance:"clear","aria-label":n.emojiPickerButtonLabel,onClick:n.toggleEmojiPicker,onMouseenter:t[9]||(t[9]=a=>l.emojiPickerFocus=!0),onMouseleave:t[10]||(t[10]=a=>l.emojiPickerFocus=!1),onFocus:t[11]||(t[11]=a=>l.emojiPickerFocus=!0),onBlur:t[12]||(t[12]=a=>l.emojiPickerFocus=!1)}),{icon:e.withCtx(()=>[n.emojiPickerHovered?(e.openBlock(),e.createBlock(w,{key:0,size:"300"})):(e.openBlock(),e.createBlock(L,{key:1,size:"300"}))]),_:1},16,["aria-label","onClick"])),[[u,n.emojiPickerButtonLabel]])]),content:e.withCtx(({close:s})=>[e.createVNode(y,e.mergeProps(o.emojiPickerProps,{onAddEmoji:t[13]||(t[13]=a=>i.$emit("add-emoji")),onSkinTone:n.onSkinTone,onSelectedEmoji:a=>n.onSelectEmoji(a,s),onScrollBottomReached:t[14]||(t[14]=a=>i.$emit("emoji-scroll-bottom-reached"))}),null,16,["onSkinTone","onSelectedEmoji"])]),_:1})):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"emojiGiphyPicker"),e.renderSlot(i.$slots,"customActionIcons")]),_:3})]),e.createElementVNode("div",Z,[e.createVNode(_,{direction:"row",gap:"300"},{default:e.withCtx(()=>[e.createElementVNode("div",$,[e.renderSlot(i.$slots,"scheduleMessage")]),e.createElementVNode("div",ee,[e.renderSlot(i.$slots,"smsCount")]),o.showCharacterLimit?(e.openBlock(),e.createBlock(O,{key:0,class:"d-recipe-message-input__remaining-char-tooltip",placement:"top-end",enabled:n.characterLimitTooltipEnabled,message:o.showCharacterLimit.message,offset:[10,8]},{anchor:e.withCtx(()=>[e.withDirectives(e.createElementVNode("p",{class:"d-recipe-message-input__remaining-char","data-qa":"dt-recipe-message-input-character-limit"},e.toDisplayString(o.showCharacterLimit.count-n.inputLength),513),[[e.vShow,n.displayCharacterLimitWarning]])]),_:1},8,["enabled","message"])):e.createCommentVNode("",!0),o.showCancel?e.withDirectives((e.openBlock(),e.createBlock(c,{key:1,"data-qa":"dt-recipe-message-input-cancel-button",class:"d-recipe-message-input__button d-recipe-message-input__cancel-button",size:"sm",kind:"muted",importance:"clear","aria-label":n.cancelButtonLabel,onClick:n.onCancel},{default:e.withCtx(()=>[e.createElementVNode("p",null,e.toDisplayString(n.cancelButtonLabel),1)]),_:1},8,["aria-label","onClick"])),[[u,n.cancelButtonLabel]]):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"sendButton",{},()=>[o.showSend?e.withDirectives((e.openBlock(),e.createBlock(c,{key:0,"data-qa":"dt-recipe-message-input-send-btn",size:"sm",kind:"default",importance:"primary",class:e.normalizeClass(["d-recipe-message-input__button d-recipe-message-input__send-button",{"d-recipe-message-input__send-button--disabled":n.isSendDisabled,"d-btn--icon-only":n.showSendIcon}]),"aria-label":n.sendButtonLabel,"aria-disabled":n.isSendDisabled,onClick:n.onSend},e.createSlots({default:e.withCtx(()=>[o.showSend.text?(e.openBlock(),e.createElementBlock("p",te,e.toDisplayString(o.showSend.text),1)):e.createCommentVNode("",!0)]),_:2},[n.showSendIcon?{name:"icon",fn:e.withCtx(()=>[e.renderSlot(i.$slots,"sendIcon",{iconSize:n.sendIconSize},()=>[e.createVNode(x,{size:n.sendIconSize},null,8,["size"])])]),key:"0"}:void 0]),1032,["class","aria-label","aria-disabled","onClick"])),[[u,n.sendButtonLabel,"top-end"]]):e.createCommentVNode("",!0)])]),_:3})])])],16)}const oe=v._(Q,[["render",ie]]);exports.default=oe;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const P=require("./last-active-nodes.cjs"),k=require("../../common/utils/index.cjs"),f=require("@tiptap/core"),b=require("../../node_modules/@tiptap/vue-3.cjs"),d=require("@dialpad/dialtone-icons/vue3"),T=require("../../localization/index.cjs"),e=require("vue"),v=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),B=require("../button/button.cjs"),V=require("../item-layout/item-layout.cjs"),j=require("./message-input-topbar.cjs"),N=require("./message-input-link.cjs"),S=require("../editor/editor-constants.cjs"),A=require("../stack/stack.cjs"),M=require("../tooltip/tooltip.cjs"),q=require("../rich-text-editor/rich-text-editor.cjs"),F=require("../popover/popover.cjs"),R=require("../input/input.cjs"),z=require("../emoji-picker/emoji-picker.cjs"),C=require("../rich-text-editor/rich-text-editor-constants.cjs"),U={name:"MeetingPill",components:{NodeViewWrapper:b.NodeViewWrapper,DtItemLayout:V.default,DtIconClose:d.DtIconClose,DtButton:B.default,DtIconVideo:d.DtIconVideo},props:b.nodeViewProps,emits:["meeting-pill-close"],data(){return{i18n:new T.DialtoneLocalization}},computed:{closeButtonTitle(){return this.i18n.$t("DIALTONE_CLOSE_BUTTON")}},methods:{close(i){var o,r,l;const t=(l=(r=(o=this.editor)==null?void 0:o.storage)==null?void 0:r.meetingPill)==null?void 0:l.onClose;t&&typeof t=="function"&&t(i)}}},H={class:"d-recipe-message-input-meeting-pill__icon"},G={class:"d-recipe-message-input-meeting-pill__close"};function W(i,t,o,r,l,n){const m=e.resolveComponent("dt-icon-video"),p=e.resolveComponent("dt-icon-close"),h=e.resolveComponent("dt-button"),g=e.resolveComponent("dt-item-layout"),c=e.resolveComponent("node-view-wrapper");return e.openBlock(),e.createBlock(c,{class:"d-recipe-message-input-meeting-pill"},{default:e.withCtx(()=>[e.createVNode(g,{class:"d-recipe-message-input-meeting-pill__layout",unstyled:""},{left:e.withCtx(()=>[e.createElementVNode("div",H,[e.createVNode(m,{size:"400"})])]),right:e.withCtx(()=>[e.createElementVNode("div",G,[e.createVNode(h,{circle:"",importance:"clear",size:"xs","aria-label":n.closeButtonTitle,title:n.closeButtonTitle,onClick:n.close},{icon:e.withCtx(()=>[e.createVNode(p,{size:"300"})]),_:1},8,["aria-label","title","onClick"])])]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(i.node.attrs.text)+" ",1)]),_:1})]),_:1})}const K=v._(U,[["render",W]]),X=f.Node.create({name:"meetingPill",atom:!0,group:"inline",inline:!0,addOptions(){return{onClose:()=>{}}},addStorage(){return{onClose:this.options.onClose}},addNodeView(){return b.VueNodeViewRenderer(K)},addAttributes(){return{text:{default:'Please pass in "text" attribute'}}},parseHTML(){return[{tag:"meeting-pill"}]},renderText(){return"/dpm"},renderHTML({HTMLAttributes:i}){return["meeting-pill",f.mergeAttributes(i)]}}),Q={compatConfig:{MODE:3},name:"DtRecipeMessageInput",components:{DtButton:B.default,DtEmojiPicker:z.default,DtInput:R.default,DtPopover:F.default,DtRecipeMessageInputTopbar:j.default,DtRecipeMessageInputLink:N.default,DtRichTextEditor:q.default,DtTooltip:M.default,DtStack:A.default,DtIconImage:d.DtIconImage,DtIconVerySatisfied:d.DtIconVerySatisfied,DtIconSatisfied:d.DtIconSatisfied,DtIconSend:d.DtIconSend},inheritAttrs:!1,props:{richText:{type:Boolean,default:!0},modelValue:{type:[Object,String],default:""},editable:{type:Boolean,default:!0},inputAriaLabel:{type:String,required:!0,default:""},preventTyping:{type:Boolean,default:!1},inputClass:{type:String,default:""},autoFocus:{type:[Boolean,String,Number],default:!1,validator(i){return typeof i=="string"?C.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(i):!0}},outputFormat:{type:String,default:"json",validator(i){return C.RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(i)}},placeholder:{type:String,default:""},disableSend:{type:Boolean,default:!1},maxHeight:{type:String,default:"unset"},showEmojiPicker:{type:Boolean,default:!0},emojiPickerProps:{type:Object,default:()=>({})},showCharacterLimit:{type:[Boolean,Object],default:()=>({count:1500,warning:500,message:""})},showImagePicker:{type:[Boolean,Object],default:()=>({})},showSend:{type:[Boolean,Object],default:()=>({})},showCancel:{type:[Boolean,Object],default:()=>({})},mentionSuggestion:{type:Object,default:null},channelSuggestion:{type:Object,default:null},slashCommandSuggestion:{type:Object,default:null},boldButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + B"})},italicButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + I"})},strikeButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + Shift + S"})},linkButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + K",linkPlaceholder:"e.g. https://www.dialpad.com"})},bulletListButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + Shift + 8"})},orderedListButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + Shift + 7"})},blockQuoteButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + Shift + B"})},codeButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + E"})},codeBlockButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + Alt + C"})}},emits:["submit","select-media","add-media","paste-media","cancel","skin-tone","selected-emoji","selected-command","meeting-pill-close","update:modelValue","text-input","markdown-input","add-emoji","emoji-scroll-bottom-reached"],data(){return{lastActiveNodes:P.default,additionalExtensions:[X.configure({onClose:i=>{this.$emit("meeting-pill-close",i)}})],internalInputValue:this.modelValue,imagePickerFocus:!1,emojiPickerFocus:!1,emojiPickerOpened:!1,isFocused:!1,linkOptions:{class:"d-link d-c-text d-d-inline-block"},linkDialogOpen:!1,selectedText:"",text:"",hideLinkBubbleMenu:!1,i18n:new T.DialtoneLocalization}},computed:{showSendIcon(){return!this.showSend.text},inputLength(){return this.text.length},displayCharacterLimitWarning(){return!!this.showCharacterLimit&&this.showCharacterLimit.count-this.inputLength<=this.showCharacterLimit.warning},characterLimitTooltipEnabled(){return this.showCharacterLimit.message&&this.showCharacterLimit.count-this.inputLength<0},isSendDisabled(){return this.disableSend||this.showCharacterLimit&&this.inputLength>this.showCharacterLimit.count},emojiPickerHovered(){return this.emojiPickerFocus||this.emojiPickerOpened},sendIconSize(){return"300"},sendButtonLabel(){return this.i18n.$t("DIALTONE_MESSAGE_INPUT_SEND_BUTTON_ARIA_LABEL")},imagePickerButtonLabel(){return this.i18n.$t("DIALTONE_MESSAGE_INPUT_IMAGE_PICKER_BUTTON_ARIA_LABEL")},emojiPickerButtonLabel(){return this.i18n.$t("DIALTONE_MESSAGE_INPUT_EMOJI_PICKER_BUTTON_ARIA_LABEL")},cancelButtonLabel(){return this.i18n.$t("DIALTONE_MESSAGE_INPUT_CANCEL_BUTTON_ARIA_LABEL")}},watch:{modelValue(i){this.internalInputValue=i},emojiPickerOpened(i){var t;i||(t=this.$refs.richTextEditor)==null||t.focusEditor()}},created(){this.modelValue&&this.outputFormat==="text"?this.internalInputValue=this.modelValue.replace(/\n/g,"<br>"):this.internalInputValue=this.modelValue},methods:{removeClassStyleAttrs:k.removeClassStyleAttrs,addClassStyleAttrs:k.addClassStyleAttrs,linkDialogOpened(i){var t;this.linkDialogOpen=i,i===!0?this.initLinkDialog():(this.hideLinkBubbleMenu=!1,(t=this.$refs.richTextEditor)==null||t.focusEditor())},handleTopbarClick(i){var r;const t=(r=this.$refs.richTextEditor)==null?void 0:r.editor,o={bold:()=>t==null?void 0:t.chain().focus().toggleBold().run(),italic:()=>t==null?void 0:t.chain().focus().toggleItalic().run(),strike:()=>t==null?void 0:t.chain().focus().toggleStrike().run(),bulletList:()=>t==null?void 0:t.chain().focus().toggleBulletList().run(),orderedList:()=>t==null?void 0:t.chain().focus().toggleOrderedList().run(),blockquote:()=>t==null?void 0:t.chain().focus().toggleBlockquote().run(),code:()=>t==null?void 0:t.chain().focus().toggleCode().run(),codeBlock:()=>t==null?void 0:t.chain().focus().toggleCodeBlock().run()};t&&o[i]&&o[i]()},isSelectionActive(i){var t,o,r,l;return["bulletList","orderedList"].includes(i)?this.richText?this.lastActiveNodes((o=(t=this.$refs.richTextEditor)==null?void 0:t.editor)==null?void 0:o.state,[{type:"bulletList"},{type:"orderedList"}]).includes(i)&&this.isFocused:!1:((l=(r=this.$refs.richTextEditor)==null?void 0:r.editor)==null?void 0:l.isActive(i))&&this.isFocused},initLinkDialog(){var i,t,o;this.$refs.link.setInitialValues(this.selectedText,(o=(t=(i=this.$refs.richTextEditor)==null?void 0:i.editor)==null?void 0:t.getAttributes("link"))==null?void 0:o.href),this.hideLinkBubbleMenu=!0,this.linkDialogOpen=!0},removeLink(){var i;(i=this.$refs.richTextEditor)==null||i.removeLink(),this.linkDialogOpen=!1},setLink(i,t){this.$refs.richTextEditor.setLink(t,i,this.linkOptions,S.EDITOR_SUPPORTED_LINK_PROTOCOLS,S.EDITOR_DEFAULT_LINK_PREFIX),this.linkDialogOpen=!1},onMousedown(i){k.returnFirstEl(this.$refs.richTextEditor.$el).querySelector(".tiptap").contains(i.target)||(i.preventDefault(),this.$refs.richTextEditor.focusEditor())},onDrop(i){const t=i.dataTransfer,o=Array.from(t.files);this.$emit("add-media",o)},onPaste(i){if(i.clipboardData.files.length){i.stopPropagation(),i.preventDefault();const t=[...i.clipboardData.files];this.$emit("paste-media",t)}},onSkinTone(i){this.$emit("skin-tone",i)},onSelectEmoji(i,t){i&&(i.shift_key||t(),this.$refs.richTextEditor.editor.commands.insertContent({type:"emoji",attrs:{code:i.shortname,image:i.image,name:i.name}}),this.$emit("selected-emoji",i))},onSelectImage(){this.$refs.messageInputImageUpload.$refs.input.click()},onImageUpload(){this.$emit("select-media",this.$refs.messageInputImageUpload.$refs.input.files)},toggleEmojiPicker(){this.emojiPickerOpened=!this.emojiPickerOpened},onSend(){this.isSendDisabled||this.$emit("submit",this.internalInputValue)},onCancel(){this.$emit("cancel")},onInput(i){this.$emit("update:modelValue",i)},onTextInput(i){this.text=i,this.$emit("text-input",i)},onMarkdownInput(i){this.$emit("markdown-input",i)}}},J={class:"d-recipe-message-input__bottom-section"},Y={class:"d-recipe-message-input__bottom-section-left"},Z={class:"d-recipe-message-input__bottom-section-right"},$={class:"d-recipe-message-input__schedule-message"},ee={class:"d-recipe-message-input__sms-count"},te={key:0};function ie(i,t,o,r,l,n){const m=e.resolveComponent("dt-recipe-message-input-link"),p=e.resolveComponent("dt-recipe-message-input-topbar"),h=e.resolveComponent("dt-rich-text-editor"),g=e.resolveComponent("dt-icon-image"),c=e.resolveComponent("dt-button"),I=e.resolveComponent("dt-input"),w=e.resolveComponent("dt-icon-very-satisfied"),L=e.resolveComponent("dt-icon-satisfied"),y=e.resolveComponent("dt-emoji-picker"),E=e.resolveComponent("dt-popover"),_=e.resolveComponent("dt-stack"),O=e.resolveComponent("dt-tooltip"),x=e.resolveComponent("dt-icon-send"),D=e.resolveDirective("dt-scrollbar"),u=e.resolveDirective("dt-tooltip");return e.openBlock(),e.createElementBlock("div",e.mergeProps({"data-qa":"dt-recipe-message-input",role:"presentation",class:"d-recipe-message-input"},n.addClassStyleAttrs(i.$attrs),{onDragover:t[15]||(t[15]=e.withModifiers(()=>{},["prevent"])),onDrop:t[16]||(t[16]=e.withModifiers((...s)=>n.onDrop&&n.onDrop(...s),["prevent"])),onPaste:t[17]||(t[17]=(...s)=>n.onPaste&&n.onPaste(...s)),onMousedown:t[18]||(t[18]=(...s)=>n.onMousedown&&n.onMousedown(...s))}),[e.renderSlot(i.$slots,"top"),o.richText?(e.openBlock(),e.createBlock(p,{key:l.selectedText,"bold-button-options":o.boldButtonOptions,"italic-button-options":o.italicButtonOptions,"strike-button-options":o.strikeButtonOptions,"bullet-list-button-options":o.bulletListButtonOptions,"ordered-list-button-options":o.orderedListButtonOptions,"block-quote-button-options":o.blockQuoteButtonOptions,"code-button-options":o.codeButtonOptions,"code-block-button-options":o.codeBlockButtonOptions,"is-selection-active":n.isSelectionActive,onClick:n.handleTopbarClick},{link:e.withCtx(()=>[e.createVNode(m,{ref:"link",open:l.linkDialogOpen,"link-button-options":o.linkButtonOptions,"is-selection-active":n.isSelectionActive,onOpened:n.linkDialogOpened,onSetLink:n.setLink,onRemoveLink:n.removeLink},null,8,["open","link-button-options","is-selection-active","onOpened","onSetLink","onRemoveLink"])]),_:1},8,["bold-button-options","italic-button-options","strike-button-options","bullet-list-button-options","ordered-list-button-options","block-quote-button-options","code-button-options","code-block-button-options","is-selection-active","onClick"])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"d-recipe-message-input__editor-wrapper",style:e.normalizeStyle({"max-height":o.maxHeight})},[e.createVNode(h,e.mergeProps({ref:"richTextEditor",modelValue:l.internalInputValue,"onUpdate:modelValue":t[0]||(t[0]=s=>l.internalInputValue=s),"allow-blockquote":o.richText,"allow-bold":o.richText,"allow-bullet-list":o.richText,"allow-code":o.richText,"allow-codeblock":o.richText,"allow-italic":o.richText,"allow-strike":o.richText,"allow-underline":o.richText,"paste-rich-text":o.richText,editable:o.editable,"input-aria-label":o.inputAriaLabel,"input-class":o.inputClass,"output-format":o.outputFormat,"auto-focus":o.autoFocus,link:o.richText,placeholder:o.placeholder,"prevent-typing":o.preventTyping,"mention-suggestion":o.mentionSuggestion,"channel-suggestion":o.channelSuggestion,"slash-command-suggestion":o.slashCommandSuggestion,"additional-extensions":l.additionalExtensions,"hide-link-bubble-menu":l.hideLinkBubbleMenu},n.removeClassStyleAttrs(i.$attrs),{onInput:n.onInput,onTextInput:n.onTextInput,onMarkdownInput:n.onMarkdownInput,onEnter:n.onSend,onSelected:t[1]||(t[1]=s=>l.selectedText=s),onSelectedCommand:t[2]||(t[2]=s=>i.$emit("selected-command",s)),onEditLink:n.initLinkDialog,onFocus:t[3]||(t[3]=s=>l.isFocused=!0),onBlur:t[4]||(t[4]=s=>l.isFocused=!1)}),null,16,["modelValue","allow-blockquote","allow-bold","allow-bullet-list","allow-code","allow-codeblock","allow-italic","allow-strike","allow-underline","paste-rich-text","editable","input-aria-label","input-class","output-format","auto-focus","link","placeholder","prevent-typing","mention-suggestion","channel-suggestion","slash-command-suggestion","additional-extensions","hide-link-bubble-menu","onInput","onTextInput","onMarkdownInput","onEnter","onEditLink"])],4)),[[D]]),e.renderSlot(i.$slots,"middle"),e.createElementVNode("section",J,[e.createElementVNode("div",Y,[e.createVNode(_,{gap:"200",direction:"row"},{default:e.withCtx(()=>[o.showImagePicker?e.withDirectives((e.openBlock(),e.createBlock(c,{key:0,"data-qa":"dt-recipe-message-input-image-btn",size:"sm",class:"d-recipe-message-input__button",kind:"muted",importance:"clear","aria-label":n.imagePickerButtonLabel,onClick:n.onSelectImage,onMouseenter:t[5]||(t[5]=s=>l.imagePickerFocus=!0),onMouseleave:t[6]||(t[6]=s=>l.imagePickerFocus=!1),onFocus:t[7]||(t[7]=s=>l.imagePickerFocus=!0),onBlur:t[8]||(t[8]=s=>l.imagePickerFocus=!1)},{icon:e.withCtx(()=>[e.createVNode(g,{size:"300"})]),_:1},8,["aria-label","onClick"])),[[u,n.imagePickerButtonLabel,"top-start"]]):e.createCommentVNode("",!0),e.createVNode(I,{ref:"messageInputImageUpload","data-qa":"dt-recipe-message-input-image-input",accept:"image/*, video/*",type:"file",class:"d-recipe-message-input__image-input",multiple:"",hidden:"",onInput:n.onImageUpload},null,8,["onInput"]),o.showEmojiPicker?(e.openBlock(),e.createBlock(E,{key:1,"open.sync":"emojiPickerOpened","data-qa":"dt-recipe-message-input-emoji-picker-popover","initial-focus-element":"#searchInput",padding:"none"},{anchor:e.withCtx(({attrs:s})=>[e.withDirectives((e.openBlock(),e.createBlock(c,e.mergeProps(s,{"data-qa":"dt-recipe-message-input-emoji-picker-btn",size:"sm",class:"d-recipe-message-input__button",kind:"muted",importance:"clear","aria-label":n.emojiPickerButtonLabel,onClick:n.toggleEmojiPicker,onMouseenter:t[9]||(t[9]=a=>l.emojiPickerFocus=!0),onMouseleave:t[10]||(t[10]=a=>l.emojiPickerFocus=!1),onFocus:t[11]||(t[11]=a=>l.emojiPickerFocus=!0),onBlur:t[12]||(t[12]=a=>l.emojiPickerFocus=!1)}),{icon:e.withCtx(()=>[n.emojiPickerHovered?(e.openBlock(),e.createBlock(w,{key:0,size:"300"})):(e.openBlock(),e.createBlock(L,{key:1,size:"300"}))]),_:1},16,["aria-label","onClick"])),[[u,n.emojiPickerButtonLabel]])]),content:e.withCtx(({close:s})=>[e.createVNode(y,e.mergeProps(o.emojiPickerProps,{onAddEmoji:t[13]||(t[13]=a=>i.$emit("add-emoji")),onSkinTone:n.onSkinTone,onSelectedEmoji:a=>n.onSelectEmoji(a,s),onScrollBottomReached:t[14]||(t[14]=a=>i.$emit("emoji-scroll-bottom-reached"))}),null,16,["onSkinTone","onSelectedEmoji"])]),_:1})):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"emojiGiphyPicker"),e.renderSlot(i.$slots,"customActionIcons")]),_:3})]),e.createElementVNode("div",Z,[e.createVNode(_,{direction:"row",gap:"300"},{default:e.withCtx(()=>[e.createElementVNode("div",$,[e.renderSlot(i.$slots,"scheduleMessage")]),e.createElementVNode("div",ee,[e.renderSlot(i.$slots,"smsCount")]),o.showCharacterLimit?(e.openBlock(),e.createBlock(O,{key:0,class:"d-recipe-message-input__remaining-char-tooltip",placement:"top-end",enabled:n.characterLimitTooltipEnabled,message:o.showCharacterLimit.message,offset:[10,8]},{anchor:e.withCtx(()=>[e.withDirectives(e.createElementVNode("p",{class:"d-recipe-message-input__remaining-char","data-qa":"dt-recipe-message-input-character-limit"},e.toDisplayString(o.showCharacterLimit.count-n.inputLength),513),[[e.vShow,n.displayCharacterLimitWarning]])]),_:1},8,["enabled","message"])):e.createCommentVNode("",!0),o.showCancel?e.withDirectives((e.openBlock(),e.createBlock(c,{key:1,"data-qa":"dt-recipe-message-input-cancel-button",class:"d-recipe-message-input__button d-recipe-message-input__cancel-button",size:"sm",kind:"muted",importance:"clear","aria-label":n.cancelButtonLabel,onClick:n.onCancel},{default:e.withCtx(()=>[e.createElementVNode("p",null,e.toDisplayString(n.cancelButtonLabel),1)]),_:1},8,["aria-label","onClick"])),[[u,n.cancelButtonLabel]]):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"sendButton",{},()=>[o.showSend?e.withDirectives((e.openBlock(),e.createBlock(c,{key:0,"data-qa":"dt-recipe-message-input-send-btn",size:"sm",kind:"default",importance:"primary",class:e.normalizeClass(["d-recipe-message-input__button d-recipe-message-input__send-button",{"d-recipe-message-input__send-button--disabled":n.isSendDisabled,"d-btn--icon-only":n.showSendIcon}]),"aria-label":n.sendButtonLabel,"aria-disabled":n.isSendDisabled,onClick:n.onSend},e.createSlots({default:e.withCtx(()=>[o.showSend.text?(e.openBlock(),e.createElementBlock("p",te,e.toDisplayString(o.showSend.text),1)):e.createCommentVNode("",!0)]),_:2},[n.showSendIcon?{name:"icon",fn:e.withCtx(()=>[e.renderSlot(i.$slots,"sendIcon",{iconSize:n.sendIconSize},()=>[e.createVNode(x,{size:n.sendIconSize},null,8,["size"])])]),key:"0"}:void 0]),1032,["class","aria-label","aria-disabled","onClick"])),[[u,n.sendButtonLabel,"top-end"]]):e.createCommentVNode("",!0)])]),_:3})])])],16)}const oe=v._(Q,[["render",ie]]);exports.default=oe;
2
2
  //# sourceMappingURL=message-input.cjs.map