@elliemae/ds-form-date-time-picker 3.60.0-next.4 → 3.60.0-next.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/config/useFocusTracker.js +23 -12
- package/dist/cjs/config/useFocusTracker.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/Day.js +17 -6
- package/dist/cjs/parts/Pickers/Calendar/Day.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +3 -0
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/utils/constants.js +9 -9
- package/dist/cjs/utils/constants.js.map +1 -1
- package/dist/esm/config/useFocusTracker.js +23 -12
- package/dist/esm/config/useFocusTracker.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/Day.js +17 -6
- package/dist/esm/parts/Pickers/Calendar/Day.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js +3 -0
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/utils/constants.js +9 -9
- package/dist/esm/utils/constants.js.map +1 -1
- package/dist/types/config/useFocusTracker.d.ts +1 -1
- package/dist/types/react-desc-prop-types.d.ts +2 -0
- package/dist/types/tests/playwright-tests/full/ControlledTestRenderer.d.ts +2 -0
- package/dist/types/utils/constants.d.ts +9 -9
- package/package.json +31 -32
- /package/dist/types/tests/{date-time-picker.calendar-navigation-days.test.d.ts → playwright-tests/full/DSControlledDateTimePicker.full.navigation.test.playwright.d.ts} +0 -0
|
@@ -37,7 +37,7 @@ const useFocusTracker = ({ DOMRefs, flags }) => {
|
|
|
37
37
|
const [latestInteractionRegion, setLatestInteractionRegion] = (0, import_react.useState)("");
|
|
38
38
|
const [currFocusDescriber, setCurrFocusDescriber] = (0, import_react.useState)("");
|
|
39
39
|
const { firstSegment, lastSegment } = DOMRefs;
|
|
40
|
-
const { isDateSelector, isTimeSelector } = flags;
|
|
40
|
+
const { isDateSelector, isTimeSelector, isControllerOnly } = flags;
|
|
41
41
|
const trackFocusPicker = (0, import_react.useCallback)(() => {
|
|
42
42
|
let picker = "datetime-picker-icon";
|
|
43
43
|
if (isDateSelector) picker = "date-picker-icon";
|
|
@@ -68,17 +68,28 @@ const useFocusTracker = ({ DOMRefs, flags }) => {
|
|
|
68
68
|
if (latestInteractionRegion !== "") setLatestInteractionRegion("");
|
|
69
69
|
if (currFocusDescriber !== "") setCurrFocusDescriber("");
|
|
70
70
|
}, [currFocusDescriber, latestInteractionRegion]);
|
|
71
|
-
const handleComponentBlurs = (0, import_react.useCallback)(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
71
|
+
const handleComponentBlurs = (0, import_react.useCallback)(
|
|
72
|
+
(e) => {
|
|
73
|
+
if (isControllerOnly) {
|
|
74
|
+
const relatedTarget = e.relatedTarget;
|
|
75
|
+
if (relatedTarget && e.currentTarget.contains(relatedTarget)) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
trackFocusResetter();
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
let shouldShortCircuit = false;
|
|
82
|
+
if (latestInteractionRegion === "calendar-days" && currFocusDescriber === "calendar-metafocused-day")
|
|
83
|
+
shouldShortCircuit = true;
|
|
84
|
+
if (latestInteractionRegion === "calendar-head" && currFocusDescriber === "calendar-prev-month")
|
|
85
|
+
shouldShortCircuit = true;
|
|
86
|
+
if (latestInteractionRegion === "timewheel" && currFocusDescriber === "timewheel-curr-hour")
|
|
87
|
+
shouldShortCircuit = true;
|
|
88
|
+
if (shouldShortCircuit) return;
|
|
89
|
+
trackFocusResetter();
|
|
90
|
+
},
|
|
91
|
+
[currFocusDescriber, isControllerOnly, latestInteractionRegion, trackFocusResetter]
|
|
92
|
+
);
|
|
82
93
|
return (0, import_react.useMemo)(
|
|
83
94
|
() => ({
|
|
84
95
|
latestInteractionRegion,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useFocusTracker.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-lines */\n/* eslint-disable indent */\n/* eslint-disable max-params */\n/* eslint-disable max-statements */\nimport { useCallback, useMemo, useState } from 'react';\nimport type { useGetReferences } from './useGetReferences.js';\nimport type { useGetFlags } from './useGetFlags.js';\n\ntype LatestInteractionRegion =\n | 'calendar-days'\n | 'calendar-head'\n | 'timewheel'\n | 'date-inputs'\n | 'time-inputs'\n | 'clear-btn'\n | 'picker-icon'\n | '';\ntype CurrFocusDescriber =\n | 'first-segment'\n | 'month-input'\n | 'day-input'\n | 'year-input'\n | 'hour-input'\n | 'minute-input'\n | 'meridiem-input'\n | 'last-segment'\n | 'clear-btn'\n | 'date-picker-icon'\n | 'time-picker-icon'\n | 'datetime-picker-icon'\n | 'calendar-prev-month'\n | 'calendar-next-month'\n | 'calendar-prev-year'\n | 'calendar-next-year'\n | 'calendar-metafocused-day'\n | 'timewheel-curr-hour'\n | 'timewheel-curr-minute'\n | 'timewheel-curr-meridiem'\n | '';\n\ninterface Config {\n DOMRefs: ReturnType<typeof useGetReferences>;\n flags: ReturnType<typeof useGetFlags>;\n}\nexport const useFocusTracker = ({ DOMRefs, flags }: Config) => {\n const [latestInteractionRegion, setLatestInteractionRegion] = useState<LatestInteractionRegion>('');\n const [currFocusDescriber, setCurrFocusDescriber] = useState<CurrFocusDescriber>('');\n const { firstSegment, lastSegment } = DOMRefs;\n const { isDateSelector, isTimeSelector } = flags;\n\n const trackFocusPicker = useCallback(() => {\n let picker = 'datetime-picker-icon' as CurrFocusDescriber;\n if (isDateSelector) picker = 'date-picker-icon';\n if (isTimeSelector) picker = 'time-picker-icon';\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (picker !== currFocusDescriber) setCurrFocusDescriber(picker);\n }, [currFocusDescriber, isDateSelector, isTimeSelector, latestInteractionRegion]);\n\n /*\n depending on the polymorphic props, the first segment can be:\n - month-input (when date inputs are present)\n - hour-input (when ONLY time inputs are present)\n - datetime-picker-icon (when picker is present and we are selecting both date and time)\n - date-picker-icon (when picker is present and no time selection is involved)\n - time-picker-icon (when picker is present and no date selection is involved)\n */\n const trackFocusFirstSegment = useCallback(() => {\n let region = 'date-inputs' as LatestInteractionRegion;\n if (firstSegment === 'hour-input') region = 'time-inputs';\n if (firstSegment === 'date-picker-icon') region = 'picker-icon';\n if (firstSegment === 'time-picker-icon') region = 'picker-icon';\n if (firstSegment === 'datetime-picker-icon') region = 'picker-icon';\n if (region !== latestInteractionRegion) setLatestInteractionRegion(region);\n if (firstSegment !== currFocusDescriber) setCurrFocusDescriber(firstSegment);\n }, [currFocusDescriber, firstSegment, latestInteractionRegion]);\n\n /*\n depending on the polymorphic props, the last segment can be:\n - year-input (when ONLY date inputs are present)\n - meridiem-input (when time inputs are present)\n - clear-btn (when clearable is true and there is no picker)\n - datetime-picker-icon (when picker is present and we are selecting both date and time)\n - date-picker-icon (when picker is present and no time selection is involved)\n - time-picker-icon (when picker is present and no date selection is involved)\n */\n const trackFocusLastSegment = useCallback(() => {\n let region = 'date-inputs' as LatestInteractionRegion;\n if (lastSegment === 'meridiem-input') region = 'time-inputs';\n if (lastSegment === 'clear-btn') region = 'clear-btn';\n if (lastSegment === 'date-picker-icon') region = 'picker-icon';\n if (lastSegment === 'time-picker-icon') region = 'picker-icon';\n if (lastSegment === 'datetime-picker-icon') region = 'picker-icon';\n if (region !== latestInteractionRegion) setLatestInteractionRegion(region);\n if (lastSegment !== currFocusDescriber) setCurrFocusDescriber(lastSegment);\n }, [currFocusDescriber, lastSegment, latestInteractionRegion]);\n\n const trackFocusResetter = useCallback(() => {\n if (latestInteractionRegion !== '') setLatestInteractionRegion('');\n if (currFocusDescriber !== '') setCurrFocusDescriber('');\n }, [currFocusDescriber, latestInteractionRegion]);\n\n const handleComponentBlurs = useCallback(() => {\n /* our code base is trying to avoid side-effects and we also try to be imperative\n due to how \"portals\" work, when we open a portal the \"blur\" event is triggered\n we need to distinguish between\n - a blur that is caused by a portal opening\n vs\n - a blur that is caused by a user moving focus to another element\n we can do this by checking the currFocusDescriber and latestInteractionRegion\n we know that blur is triggered by portal opening when:\n - latestInteractionRegion === 'calendar-days' && currFocusDescriber === 'calendar-metafocused-day'\n (this is the case when we open the calendar or calendarWithTimeWheel with a preselected date)\n - latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-prev-month'\n (this is the case when we open the calendar or calendarWithTimeWheel without a preselected date)\n - latestInteractionRegion === 'timewheel' && currFocusDescriber === 'timewheel-curr-hour'\n (this is the case when we open any timewheel ONLY)\n */\n let shouldShortCircuit = false;\n // preselected date OR filled date value OR onCalendarOpenFocusedDay is present\n if (latestInteractionRegion === 'calendar-days' && currFocusDescriber === 'calendar-metafocused-day')\n shouldShortCircuit = true;\n // empty date value AND no onCalendarOpenFocusedDay is present\n if (latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-prev-month')\n shouldShortCircuit = true;\n\n // only time wheel is present in the contextual region\n if (latestInteractionRegion === 'timewheel' && currFocusDescriber === 'timewheel-curr-hour')\n shouldShortCircuit = true;\n\n if (shouldShortCircuit) return;\n trackFocusResetter();\n }, [currFocusDescriber, latestInteractionRegion, trackFocusResetter]);\n\n return useMemo(\n () => ({\n latestInteractionRegion,\n setLatestInteractionRegion,\n currFocusDescriber,\n setCurrFocusDescriber,\n trackFocusResetter,\n trackFocusMonthInput: () => {\n if (latestInteractionRegion !== 'date-inputs') setLatestInteractionRegion('date-inputs');\n if (currFocusDescriber !== 'month-input') setCurrFocusDescriber('month-input');\n },\n trackFocusDayInput: () => {\n if (latestInteractionRegion !== 'date-inputs') setLatestInteractionRegion('date-inputs');\n if (currFocusDescriber !== 'day-input') setCurrFocusDescriber('day-input');\n },\n trackFocusYearInput: () => {\n if (latestInteractionRegion !== 'date-inputs') setLatestInteractionRegion('date-inputs');\n if (currFocusDescriber !== 'year-input') setCurrFocusDescriber('year-input');\n },\n trackFocusHourInput: () => {\n if (latestInteractionRegion !== 'time-inputs') setLatestInteractionRegion('time-inputs');\n if (currFocusDescriber !== 'hour-input') setCurrFocusDescriber('hour-input');\n },\n trackFocusMinuteInput: () => {\n if (latestInteractionRegion !== 'time-inputs') setLatestInteractionRegion('time-inputs');\n if (currFocusDescriber !== 'minute-input') setCurrFocusDescriber('minute-input');\n },\n trackFocusMeridiemInput: () => {\n if (latestInteractionRegion !== 'time-inputs') setLatestInteractionRegion('time-inputs');\n if (currFocusDescriber !== 'meridiem-input') setCurrFocusDescriber('meridiem-input');\n },\n trackFocusClearBtn: () => {\n if (latestInteractionRegion !== 'clear-btn') setLatestInteractionRegion('clear-btn');\n if (currFocusDescriber !== 'clear-btn') setCurrFocusDescriber('clear-btn');\n },\n trackFocusDatePickerIcon: () => {\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (currFocusDescriber !== 'date-picker-icon') setCurrFocusDescriber('date-picker-icon');\n },\n trackFocusTimePickerIcon: () => {\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (currFocusDescriber !== 'time-picker-icon') setCurrFocusDescriber('time-picker-icon');\n },\n trackFocusDatetimePickerIcon: () => {\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (currFocusDescriber !== 'datetime-picker-icon') setCurrFocusDescriber('datetime-picker-icon');\n },\n trackFocusCalendarPrevMonth: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-prev-month') setCurrFocusDescriber('calendar-prev-month');\n },\n trackFocusCalendarNextMonth: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-next-month') setCurrFocusDescriber('calendar-next-month');\n },\n trackFocusCalendarPrevYear: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-prev-year') setCurrFocusDescriber('calendar-prev-year');\n },\n trackFocusCalendarNextYear: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-next-year') setCurrFocusDescriber('calendar-next-year');\n },\n trackFocusCalendarMetafocusedDay: () => {\n if (latestInteractionRegion !== 'calendar-days') setLatestInteractionRegion('calendar-days');\n if (currFocusDescriber !== 'calendar-metafocused-day') setCurrFocusDescriber('calendar-metafocused-day');\n },\n trackFocusTimewheelCurrHour: () => {\n if (latestInteractionRegion !== 'timewheel') setLatestInteractionRegion('timewheel');\n if (currFocusDescriber !== 'timewheel-curr-hour') setCurrFocusDescriber('timewheel-curr-hour');\n },\n trackFocusTimewheelCurrMinute: () => {\n if (latestInteractionRegion !== 'timewheel') setLatestInteractionRegion('timewheel');\n if (currFocusDescriber !== 'timewheel-curr-minute') setCurrFocusDescriber('timewheel-curr-minute');\n },\n trackFocusTimewheelCurrMeridiem: () => {\n if (latestInteractionRegion !== 'timewheel') setLatestInteractionRegion('timewheel');\n if (currFocusDescriber !== 'timewheel-curr-meridiem') setCurrFocusDescriber('timewheel-curr-meridiem');\n },\n trackFocusPicker,\n trackFocusFirstSegment,\n trackFocusLastSegment,\n handleComponentBlurs,\n }),\n [\n latestInteractionRegion,\n currFocusDescriber,\n trackFocusResetter,\n trackFocusPicker,\n trackFocusFirstSegment,\n trackFocusLastSegment,\n handleComponentBlurs,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADKvB,mBAA+C;AAwCxC,MAAM,kBAAkB,CAAC,EAAE,SAAS,MAAM,MAAc;AAC7D,QAAM,CAAC,yBAAyB,0BAA0B,QAAI,uBAAkC,EAAE;AAClG,QAAM,CAAC,oBAAoB,qBAAqB,QAAI,uBAA6B,EAAE;AACnF,QAAM,EAAE,cAAc,YAAY,IAAI;AACtC,QAAM,EAAE,gBAAgB,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-lines */\n/* eslint-disable indent */\n/* eslint-disable max-params */\n/* eslint-disable max-statements */\nimport { useCallback, useMemo, useState } from 'react';\nimport type { useGetReferences } from './useGetReferences.js';\nimport type { useGetFlags } from './useGetFlags.js';\n\ntype LatestInteractionRegion =\n | 'calendar-days'\n | 'calendar-head'\n | 'timewheel'\n | 'date-inputs'\n | 'time-inputs'\n | 'clear-btn'\n | 'picker-icon'\n | '';\ntype CurrFocusDescriber =\n | 'first-segment'\n | 'month-input'\n | 'day-input'\n | 'year-input'\n | 'hour-input'\n | 'minute-input'\n | 'meridiem-input'\n | 'last-segment'\n | 'clear-btn'\n | 'date-picker-icon'\n | 'time-picker-icon'\n | 'datetime-picker-icon'\n | 'calendar-prev-month'\n | 'calendar-next-month'\n | 'calendar-prev-year'\n | 'calendar-next-year'\n | 'calendar-metafocused-day'\n | 'timewheel-curr-hour'\n | 'timewheel-curr-minute'\n | 'timewheel-curr-meridiem'\n | '';\n\ninterface Config {\n DOMRefs: ReturnType<typeof useGetReferences>;\n flags: ReturnType<typeof useGetFlags>;\n}\nexport const useFocusTracker = ({ DOMRefs, flags }: Config) => {\n const [latestInteractionRegion, setLatestInteractionRegion] = useState<LatestInteractionRegion>('');\n const [currFocusDescriber, setCurrFocusDescriber] = useState<CurrFocusDescriber>('');\n const { firstSegment, lastSegment } = DOMRefs;\n const { isDateSelector, isTimeSelector, isControllerOnly } = flags;\n\n const trackFocusPicker = useCallback(() => {\n let picker = 'datetime-picker-icon' as CurrFocusDescriber;\n if (isDateSelector) picker = 'date-picker-icon';\n if (isTimeSelector) picker = 'time-picker-icon';\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (picker !== currFocusDescriber) setCurrFocusDescriber(picker);\n }, [currFocusDescriber, isDateSelector, isTimeSelector, latestInteractionRegion]);\n\n /*\n depending on the polymorphic props, the first segment can be:\n - month-input (when date inputs are present)\n - hour-input (when ONLY time inputs are present)\n - datetime-picker-icon (when picker is present and we are selecting both date and time)\n - date-picker-icon (when picker is present and no time selection is involved)\n - time-picker-icon (when picker is present and no date selection is involved)\n */\n const trackFocusFirstSegment = useCallback(() => {\n let region = 'date-inputs' as LatestInteractionRegion;\n if (firstSegment === 'hour-input') region = 'time-inputs';\n if (firstSegment === 'date-picker-icon') region = 'picker-icon';\n if (firstSegment === 'time-picker-icon') region = 'picker-icon';\n if (firstSegment === 'datetime-picker-icon') region = 'picker-icon';\n if (region !== latestInteractionRegion) setLatestInteractionRegion(region);\n if (firstSegment !== currFocusDescriber) setCurrFocusDescriber(firstSegment);\n }, [currFocusDescriber, firstSegment, latestInteractionRegion]);\n\n /*\n depending on the polymorphic props, the last segment can be:\n - year-input (when ONLY date inputs are present)\n - meridiem-input (when time inputs are present)\n - clear-btn (when clearable is true and there is no picker)\n - datetime-picker-icon (when picker is present and we are selecting both date and time)\n - date-picker-icon (when picker is present and no time selection is involved)\n - time-picker-icon (when picker is present and no date selection is involved)\n */\n const trackFocusLastSegment = useCallback(() => {\n let region = 'date-inputs' as LatestInteractionRegion;\n if (lastSegment === 'meridiem-input') region = 'time-inputs';\n if (lastSegment === 'clear-btn') region = 'clear-btn';\n if (lastSegment === 'date-picker-icon') region = 'picker-icon';\n if (lastSegment === 'time-picker-icon') region = 'picker-icon';\n if (lastSegment === 'datetime-picker-icon') region = 'picker-icon';\n if (region !== latestInteractionRegion) setLatestInteractionRegion(region);\n if (lastSegment !== currFocusDescriber) setCurrFocusDescriber(lastSegment);\n }, [currFocusDescriber, lastSegment, latestInteractionRegion]);\n\n const trackFocusResetter = useCallback(() => {\n if (latestInteractionRegion !== '') setLatestInteractionRegion('');\n if (currFocusDescriber !== '') setCurrFocusDescriber('');\n }, [currFocusDescriber, latestInteractionRegion]);\n\n const handleComponentBlurs = useCallback(\n (e: React.FocusEvent<HTMLElement>) => {\n /**\n * In controller only mode, we want to reset the focus tracker when the user moves focus outside of the component\n * this is because in controller only mode we don't have a portal that we need to account for,\n * so any blur event that happens when we are in controller only mode should be treated as a user moving focus outside of the component\n */\n if (isControllerOnly) {\n const relatedTarget = e.relatedTarget as HTMLElement | null;\n if (relatedTarget && (e.currentTarget as HTMLElement).contains(relatedTarget)) {\n return;\n }\n trackFocusResetter();\n return;\n }\n /* our code base is trying to avoid side-effects and we also try to be imperative\n due to how \"portals\" work, when we open a portal the \"blur\" event is triggered\n we need to distinguish between\n - a blur that is caused by a portal opening\n vs\n - a blur that is caused by a user moving focus to another element\n we can do this by checking the currFocusDescriber and latestInteractionRegion\n we know that blur is triggered by portal opening when:\n - latestInteractionRegion === 'calendar-days' && currFocusDescriber === 'calendar-metafocused-day'\n (this is the case when we open the calendar or calendarWithTimeWheel with a preselected date)\n - latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-prev-month'\n (this is the case when we open the calendar or calendarWithTimeWheel without a preselected date)\n - latestInteractionRegion === 'timewheel' && currFocusDescriber === 'timewheel-curr-hour'\n (this is the case when we open any timewheel ONLY)\n */\n let shouldShortCircuit = false;\n // preselected date OR filled date value OR onCalendarOpenFocusedDay is present\n if (latestInteractionRegion === 'calendar-days' && currFocusDescriber === 'calendar-metafocused-day')\n shouldShortCircuit = true;\n // empty date value AND no onCalendarOpenFocusedDay is present\n if (latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-prev-month')\n shouldShortCircuit = true;\n\n // only time wheel is present in the contextual region\n if (latestInteractionRegion === 'timewheel' && currFocusDescriber === 'timewheel-curr-hour')\n shouldShortCircuit = true;\n\n if (shouldShortCircuit) return;\n trackFocusResetter();\n },\n [currFocusDescriber, isControllerOnly, latestInteractionRegion, trackFocusResetter],\n );\n\n return useMemo(\n () => ({\n latestInteractionRegion,\n setLatestInteractionRegion,\n currFocusDescriber,\n setCurrFocusDescriber,\n trackFocusResetter,\n trackFocusMonthInput: () => {\n if (latestInteractionRegion !== 'date-inputs') setLatestInteractionRegion('date-inputs');\n if (currFocusDescriber !== 'month-input') setCurrFocusDescriber('month-input');\n },\n trackFocusDayInput: () => {\n if (latestInteractionRegion !== 'date-inputs') setLatestInteractionRegion('date-inputs');\n if (currFocusDescriber !== 'day-input') setCurrFocusDescriber('day-input');\n },\n trackFocusYearInput: () => {\n if (latestInteractionRegion !== 'date-inputs') setLatestInteractionRegion('date-inputs');\n if (currFocusDescriber !== 'year-input') setCurrFocusDescriber('year-input');\n },\n trackFocusHourInput: () => {\n if (latestInteractionRegion !== 'time-inputs') setLatestInteractionRegion('time-inputs');\n if (currFocusDescriber !== 'hour-input') setCurrFocusDescriber('hour-input');\n },\n trackFocusMinuteInput: () => {\n if (latestInteractionRegion !== 'time-inputs') setLatestInteractionRegion('time-inputs');\n if (currFocusDescriber !== 'minute-input') setCurrFocusDescriber('minute-input');\n },\n trackFocusMeridiemInput: () => {\n if (latestInteractionRegion !== 'time-inputs') setLatestInteractionRegion('time-inputs');\n if (currFocusDescriber !== 'meridiem-input') setCurrFocusDescriber('meridiem-input');\n },\n trackFocusClearBtn: () => {\n if (latestInteractionRegion !== 'clear-btn') setLatestInteractionRegion('clear-btn');\n if (currFocusDescriber !== 'clear-btn') setCurrFocusDescriber('clear-btn');\n },\n trackFocusDatePickerIcon: () => {\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (currFocusDescriber !== 'date-picker-icon') setCurrFocusDescriber('date-picker-icon');\n },\n trackFocusTimePickerIcon: () => {\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (currFocusDescriber !== 'time-picker-icon') setCurrFocusDescriber('time-picker-icon');\n },\n trackFocusDatetimePickerIcon: () => {\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (currFocusDescriber !== 'datetime-picker-icon') setCurrFocusDescriber('datetime-picker-icon');\n },\n trackFocusCalendarPrevMonth: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-prev-month') setCurrFocusDescriber('calendar-prev-month');\n },\n trackFocusCalendarNextMonth: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-next-month') setCurrFocusDescriber('calendar-next-month');\n },\n trackFocusCalendarPrevYear: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-prev-year') setCurrFocusDescriber('calendar-prev-year');\n },\n trackFocusCalendarNextYear: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-next-year') setCurrFocusDescriber('calendar-next-year');\n },\n trackFocusCalendarMetafocusedDay: () => {\n if (latestInteractionRegion !== 'calendar-days') setLatestInteractionRegion('calendar-days');\n if (currFocusDescriber !== 'calendar-metafocused-day') setCurrFocusDescriber('calendar-metafocused-day');\n },\n trackFocusTimewheelCurrHour: () => {\n if (latestInteractionRegion !== 'timewheel') setLatestInteractionRegion('timewheel');\n if (currFocusDescriber !== 'timewheel-curr-hour') setCurrFocusDescriber('timewheel-curr-hour');\n },\n trackFocusTimewheelCurrMinute: () => {\n if (latestInteractionRegion !== 'timewheel') setLatestInteractionRegion('timewheel');\n if (currFocusDescriber !== 'timewheel-curr-minute') setCurrFocusDescriber('timewheel-curr-minute');\n },\n trackFocusTimewheelCurrMeridiem: () => {\n if (latestInteractionRegion !== 'timewheel') setLatestInteractionRegion('timewheel');\n if (currFocusDescriber !== 'timewheel-curr-meridiem') setCurrFocusDescriber('timewheel-curr-meridiem');\n },\n trackFocusPicker,\n trackFocusFirstSegment,\n trackFocusLastSegment,\n handleComponentBlurs,\n }),\n [\n latestInteractionRegion,\n currFocusDescriber,\n trackFocusResetter,\n trackFocusPicker,\n trackFoc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AAsB,uBAAsB,oBAAoB;AAAA,MAC7F;AAAA,MACA,4BAA4B,MAAM;AAChC,YAAI,4BAA4B,gBAAiB,4BAA2B,eAAe;AAC3F,YAAI,uBAAuB,qBAAsB,uBAAsB,oBAAoB;AAAA,MAC7F;AAAA,MACA,kCAAkC,MAAM;AACtC,YAAI,4BAA4B,gBAAiB,4BAA2B,eAAe;AAC3F,YAAI,uBAAuB,2BAA4B,uBAAsB,0BAA0B;AAAA,MACzG;AAAA,MACA,6BAA6B,MAAM;AACjC,YAAI,4BAA4B,YAAa,4BAA2B,WAAW;AACnF,YAAI,uBAAuB,sBAAuB,uBAAsB,qBAAqB;AAAA,MAC/F;AAAA,MACA,+BAA+B,MAAM;AACnC,YAAI,4BAA4B,YAAa,4BAA2B,WAAW;AACnF,YAAI,uBAAuB,wBAAyB,uBAAsB,uBAAuB;AAAA,MACnG;AAAA,MACA,iCAAiC,MAAM;AACrC,YAAI,4BAA4B,YAAa,4BAA2B,WAAW;AACnF,YAAI,uBAAuB,0BAA2B,uBAAsB,yBAAyB;AAAA,MACvG;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -49,7 +49,7 @@ const Day = ({ metaDay, colIndex, isInvisible }) => {
|
|
|
49
49
|
handleChangeComposedDateString,
|
|
50
50
|
dateStringFromProps,
|
|
51
51
|
getProps,
|
|
52
|
-
props: { preventCloseOnSelection, readOnly, applyAriaDisabled },
|
|
52
|
+
props: { preventCloseOnSelection, readOnly, applyAriaDisabled, lastElementRef },
|
|
53
53
|
getIsDisabledDay,
|
|
54
54
|
getIsOutOfRangeDay,
|
|
55
55
|
getIsStartRangeDay,
|
|
@@ -62,16 +62,24 @@ const Day = ({ metaDay, colIndex, isInvisible }) => {
|
|
|
62
62
|
isWithTimeWheelToo,
|
|
63
63
|
trackFocusCalendarMetafocusedDay,
|
|
64
64
|
fromDate,
|
|
65
|
-
toDate
|
|
65
|
+
toDate,
|
|
66
|
+
isControllerOnly
|
|
66
67
|
} = (0, import_react.useContext)(import_ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
67
68
|
const { read, LiveRegion } = (0, import_ds_accessibility.useLiveRegion)({});
|
|
68
|
-
const { focusedDay, handleDayOnKeyDown, handleFocusMetaDayByDay, closeCalendar } = (0, import_react.useContext)(import_CalendarContext.CalendarContext);
|
|
69
|
+
const { focusedDay, daysArray, handleDayOnKeyDown, handleFocusMetaDayByDay, closeCalendar } = (0, import_react.useContext)(import_CalendarContext.CalendarContext);
|
|
69
70
|
const isFocusedMetaDay = focusedDay?.day ? (0, import_dateHelpers.compareTwoDatesDayEquality)(metaDay?.day, focusedDay?.day) : false;
|
|
71
|
+
const firstCurrMonthDay = (0, import_react.useMemo)(() => daysArray.find((metaMonthDay) => metaMonthDay.isCurrMonthDay), [daysArray]);
|
|
72
|
+
const isFirstCurrMonthFallback = (0, import_react.useMemo)(() => {
|
|
73
|
+
if (!isControllerOnly) return false;
|
|
74
|
+
if (focusedDay?.day) return false;
|
|
75
|
+
if (!firstCurrMonthDay?.day) return false;
|
|
76
|
+
return (0, import_dateHelpers.compareTwoDatesDayEquality)(day, firstCurrMonthDay.day);
|
|
77
|
+
}, [isControllerOnly, focusedDay?.day, firstCurrMonthDay?.day, day]);
|
|
70
78
|
const isSelected = (0, import_react.useMemo)(() => {
|
|
71
79
|
const selectedDate = (0, import_dateHelpers.getDayFromDateString)(dateStringFromProps);
|
|
72
80
|
return selectedDate ? (0, import_dateHelpers.isSameDateMoment)(day, selectedDate) : false;
|
|
73
81
|
}, [dateStringFromProps, day]);
|
|
74
|
-
const isFocused = latestInteractionRegion === "calendar-days" && isFocusedMetaDay;
|
|
82
|
+
const isFocused = latestInteractionRegion === "calendar-days" && (isFocusedMetaDay || isFirstCurrMonthFallback);
|
|
75
83
|
const isDisabled = getIsDisabledDay(metaDay.dayAsString);
|
|
76
84
|
const isOutOfRange = getIsOutOfRangeDay(metaDay.dayAsString);
|
|
77
85
|
const isStartRangeDay = getIsStartRangeDay(metaDay.dayAsString);
|
|
@@ -130,9 +138,12 @@ const Day = ({ metaDay, colIndex, isInvisible }) => {
|
|
|
130
138
|
window.requestAnimationFrame(() => {
|
|
131
139
|
dayBtnRef.current = ButtonDomNode;
|
|
132
140
|
if (isFocused) ButtonDomNode?.focus?.();
|
|
141
|
+
if (lastElementRef && isControllerOnly && (isFocusedMetaDay || isFirstCurrMonthFallback)) {
|
|
142
|
+
lastElementRef.current = ButtonDomNode;
|
|
143
|
+
}
|
|
133
144
|
});
|
|
134
145
|
},
|
|
135
|
-
[dayBtnRef, isFocused]
|
|
146
|
+
[dayBtnRef, lastElementRef, isFocused, isFocusedMetaDay, isControllerOnly, isFirstCurrMonthFallback]
|
|
136
147
|
);
|
|
137
148
|
const handleOnDayFocus = (0, import_react.useCallback)(() => {
|
|
138
149
|
trackFocusCalendarMetafocusedDay();
|
|
@@ -190,7 +201,7 @@ const Day = ({ metaDay, colIndex, isInvisible }) => {
|
|
|
190
201
|
handleDayOnKeyDown(e, metaDay);
|
|
191
202
|
},
|
|
192
203
|
innerRef: handleInnerRef,
|
|
193
|
-
tabIndex: -1,
|
|
204
|
+
tabIndex: isControllerOnly && (isFocusedMetaDay || isFirstCurrMonthFallback) ? 0 : -1,
|
|
194
205
|
"data-isfocused": isFocused,
|
|
195
206
|
"data-testid": dataTestid,
|
|
196
207
|
type: "button",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Pickers/Calendar/Day.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport { useLiveRegion } from '@elliemae/ds-accessibility';\nimport React, { useCallback, useContext, useMemo } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../constants/index.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport type { DSControlledDateTimePickerT } from '../../../react-desc-prop-types.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../../sharedTypes.js';\nimport { defaultMetaInfo, weekDays } from '../../../utils/constants.js';\nimport {\n compareTwoDatesDayEquality,\n getDateStringFromDay,\n getDateValuesFromDate,\n getDayFromDateString,\n isSameDateMoment,\n} from '../../../utils/dateHelpers.js';\nimport { getAriaDayFromDateString } from '../../../utils/stringHelpers.js';\nimport { CalendarContext } from './CalendarContext.js';\nimport { StyledDayBtn } from './Styleds.js';\n\ninterface CalendarDayPropsT {\n metaDay: DSControlledDateTimePickerInternalsT.MetaMonthDay;\n colIndex?: number;\n isInvisible?: boolean;\n}\nconst displayNone = { display: 'none' };\n\nexport const Day = ({ metaDay, colIndex, isInvisible }: CalendarDayPropsT): JSX.Element => {\n const { day, isCurrMonthDay, isHidden, dayBtnRef, dayAsString } = metaDay;\n const {\n handleChangeComposedDateString,\n dateStringFromProps,\n getProps,\n props: { preventCloseOnSelection, readOnly, applyAriaDisabled },\n getIsDisabledDay,\n getIsOutOfRangeDay,\n getIsStartRangeDay,\n getIsDayInRange,\n getIsEndRangeDay,\n appOnMonthChange,\n appOnDayChange,\n appOnYearChange,\n latestInteractionRegion,\n isWithTimeWheelToo,\n trackFocusCalendarMetafocusedDay,\n fromDate,\n toDate,\n } = useContext(ControlledDateTimePickerContext);\n const { read, LiveRegion } = useLiveRegion({});\n\n const { focusedDay, handleDayOnKeyDown, handleFocusMetaDayByDay, closeCalendar } = useContext(CalendarContext);\n const isFocusedMetaDay = focusedDay?.day ? compareTwoDatesDayEquality(metaDay?.day, focusedDay?.day) : false;\n const isSelected = useMemo(() => {\n const selectedDate = getDayFromDateString(dateStringFromProps);\n return selectedDate ? isSameDateMoment(day, selectedDate) : false;\n }, [dateStringFromProps, day]);\n const isFocused = latestInteractionRegion === 'calendar-days' && isFocusedMetaDay;\n const isDisabled = getIsDisabledDay(metaDay.dayAsString);\n const isOutOfRange = getIsOutOfRangeDay(metaDay.dayAsString);\n const isStartRangeDay = getIsStartRangeDay(metaDay.dayAsString);\n const isEndRangeDay = getIsEndRangeDay(metaDay.dayAsString);\n const isDayInRangeImproper = getIsDayInRange(metaDay.dayAsString);\n const isDayInRange = !isStartRangeDay && !isEndRangeDay && isDayInRangeImproper;\n\n const dayAriaLabel = useMemo(\n () => `${getAriaDayFromDateString(dayAsString)}, ${weekDays[metaDay.day.getDay()]}`,\n [dayAsString, metaDay],\n );\n\n const rangeSelectionAnnouncement = useMemo(() => {\n if (fromDate && toDate) {\n if (fromDate === toDate) return `Please select another day to complete range selection.`;\n return `Range from ${fromDate} to ${toDate} selected.`;\n }\n if (fromDate && !toDate) return `Please select another day to complete range selection.`;\n return '';\n }, [fromDate, toDate]);\n\n const handleOnDayClick = useCallback(\n (e: DSControlledDateTimePickerT.OnInternalValuesChangeEvent) => {\n handleFocusMetaDayByDay(day);\n if (!isDisabled && !isOutOfRange && !readOnly && !applyAriaDisabled) {\n const newDateString = getDateStringFromDay(day);\n const metaInfo = { ...defaultMetaInfo, newDateString };\n const { month, day: dayNumber, year } = getDateValuesFromDate(day);\n appOnMonthChange(`${month + 1}`, e, metaInfo);\n if (dayNumber) appOnDayChange(`${dayNumber}`, e, metaInfo);\n appOnYearChange(`${year}`, e, metaInfo);\n handleChangeComposedDateString(newDateString, metaInfo);\n trackFocusCalendarMetafocusedDay();\n if (!isWithTimeWheelToo && !preventCloseOnSelection) closeCalendar();\n read(`${dayAriaLabel} selected.`, {});\n }\n },\n [\n handleFocusMetaDayByDay,\n day,\n isDisabled,\n isOutOfRange,\n readOnly,\n applyAriaDisabled,\n appOnMonthChange,\n appOnDayChange,\n appOnYearChange,\n handleChangeComposedDateString,\n trackFocusCalendarMetafocusedDay,\n isWithTimeWheelToo,\n preventCloseOnSelection,\n closeCalendar,\n read,\n dayAriaLabel,\n ],\n );\n\n const handleInnerRef = useCallback(\n (ButtonDomNode: HTMLButtonElement) => {\n window.requestAnimationFrame(() => {\n dayBtnRef.current = ButtonDomNode;\n if (isFocused) ButtonDomNode?.focus?.();\n });\n },\n [dayBtnRef, isFocused],\n );\n\n const handleOnDayFocus = useCallback(() => {\n trackFocusCalendarMetafocusedDay();\n }, [trackFocusCalendarMetafocusedDay]);\n\n const dayClassModifiers = useMemo(\n () =>\n `dayWrapper ${isSelected ? 'selectedDay ' : ''}${isDisabled ? 'disabledDay ' : ''}${\n isOutOfRange ? 'outOfRangeDay ' : ''\n }${isFocused ? 'focusedDay ' : ''}${isStartRangeDay ? 'startRangeDay ' : ''}${\n isDayInRangeImproper ? 'inRangeImproperDay ' : ''\n }${isDayInRange ? 'inRangeDay ' : ''}${isEndRangeDay ? 'endRangeDay ' : ''}${\n isCurrMonthDay ? '' : 'notCurrentMonth'\n }\n ${readOnly || applyAriaDisabled ? 'readOnly' : ''}`,\n [\n isSelected,\n isDisabled,\n isOutOfRange,\n isFocused,\n isStartRangeDay,\n isDayInRangeImproper,\n isDayInRange,\n isEndRangeDay,\n isCurrMonthDay,\n readOnly,\n applyAriaDisabled,\n ],\n );\n\n let dataTestid: (typeof ControlledDateTimePickerDatatestid)['CALENDAR'][keyof (typeof ControlledDateTimePickerDatatestid)['CALENDAR']] =\n ControlledDateTimePickerDatatestid.CALENDAR.DAY;\n\n if (isSelected) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.SELECTED_DAY;\n if (isFocused) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.FOCUSED_DAY;\n if (isFocused && isSelected) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.SELECTED_FOCUSED_DAY;\n if (isStartRangeDay) {\n dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.START_RANGE_DAY;\n if (isFocused) read(`${dayAriaLabel} selected. ${rangeSelectionAnnouncement}`, {});\n }\n if (isEndRangeDay) {\n dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.END_RANGE_DAY;\n if (isFocused) read(`${dayAriaLabel} selected. ${rangeSelectionAnnouncement}`, {});\n }\n if (isDayInRange) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.IN_RANGE_DAY;\n\n return (\n <div\n className={dayClassModifiers}\n style={isHidden ? displayNone : undefined}\n role=\"gridcell\"\n {...(Number.isInteger(colIndex) && { 'aria-colindex': colIndex })}\n >\n <StyledDayBtn\n aria-label={dayAriaLabel}\n aria-disabled={isOutOfRange || isDisabled || readOnly || applyAriaDisabled}\n applyAriaDisabled={applyAriaDisabled}\n aria-hidden={!!isInvisible}\n buttonType=\"raw\"\n size=\"m\"\n onClick={handleOnDayClick} // DSButton triggers this with \"spacebar\" and \"enter\" too...\n onFocus={handleOnDayFocus}\n onKeyDown={(e: React.KeyboardEvent<Element>) => {\n handleDayOnKeyDown(e, metaDay);\n }}\n innerRef={handleInnerRef}\n tabIndex={-1}\n data-isfocused={isFocused}\n data-testid={dataTestid}\n type=\"button\"\n getOwnerProps={getProps}\n readOnlyStyles={readOnly || applyAriaDisabled}\n >\n {`${day.getDate()}`}\n </StyledDayBtn>\n <LiveRegion />\n </div>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport { useLiveRegion } from '@elliemae/ds-accessibility';\nimport React, { useCallback, useContext, useMemo } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../constants/index.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport type { DSControlledDateTimePickerT } from '../../../react-desc-prop-types.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../../sharedTypes.js';\nimport { defaultMetaInfo, weekDays } from '../../../utils/constants.js';\nimport {\n compareTwoDatesDayEquality,\n getDateStringFromDay,\n getDateValuesFromDate,\n getDayFromDateString,\n isSameDateMoment,\n} from '../../../utils/dateHelpers.js';\nimport { getAriaDayFromDateString } from '../../../utils/stringHelpers.js';\nimport { CalendarContext } from './CalendarContext.js';\nimport { StyledDayBtn } from './Styleds.js';\n\ninterface CalendarDayPropsT {\n metaDay: DSControlledDateTimePickerInternalsT.MetaMonthDay;\n colIndex?: number;\n isInvisible?: boolean;\n}\nconst displayNone = { display: 'none' };\n\nexport const Day = ({ metaDay, colIndex, isInvisible }: CalendarDayPropsT): JSX.Element => {\n const { day, isCurrMonthDay, isHidden, dayBtnRef, dayAsString } = metaDay;\n const {\n handleChangeComposedDateString,\n dateStringFromProps,\n getProps,\n props: { preventCloseOnSelection, readOnly, applyAriaDisabled, lastElementRef },\n getIsDisabledDay,\n getIsOutOfRangeDay,\n getIsStartRangeDay,\n getIsDayInRange,\n getIsEndRangeDay,\n appOnMonthChange,\n appOnDayChange,\n appOnYearChange,\n latestInteractionRegion,\n isWithTimeWheelToo,\n trackFocusCalendarMetafocusedDay,\n fromDate,\n toDate,\n isControllerOnly,\n } = useContext(ControlledDateTimePickerContext);\n const { read, LiveRegion } = useLiveRegion({});\n\n const { focusedDay, daysArray, handleDayOnKeyDown, handleFocusMetaDayByDay, closeCalendar } =\n useContext(CalendarContext);\n const isFocusedMetaDay = focusedDay?.day ? compareTwoDatesDayEquality(metaDay?.day, focusedDay?.day) : false;\n /*\n * PUI-18077 https://jira.elliemae.io/browse/PUI-18077\n *\n * Fallback logic that mirrors the behavior in:\n * ./useKeyboardHandlers.tsx (tryToFocusDayRegion)\n *\n * When opening the calendar without an explicit focusedDay, this ensures that\n * in controller-only mode, Shift+Tab from the first focusable element focuses\n * the first current-month day instead of the previous month button.\n *\n * Once focusedDay is established, this fallback is no longer used.\n */\n const firstCurrMonthDay = useMemo(() => daysArray.find((metaMonthDay) => metaMonthDay.isCurrMonthDay), [daysArray]);\n const isFirstCurrMonthFallback = useMemo(() => {\n if (!isControllerOnly) return false;\n if (focusedDay?.day) return false;\n if (!firstCurrMonthDay?.day) return false;\n return compareTwoDatesDayEquality(day, firstCurrMonthDay.day);\n }, [isControllerOnly, focusedDay?.day, firstCurrMonthDay?.day, day]);\n const isSelected = useMemo(() => {\n const selectedDate = getDayFromDateString(dateStringFromProps);\n return selectedDate ? isSameDateMoment(day, selectedDate) : false;\n }, [dateStringFromProps, day]);\n const isFocused = latestInteractionRegion === 'calendar-days' && (isFocusedMetaDay || isFirstCurrMonthFallback);\n const isDisabled = getIsDisabledDay(metaDay.dayAsString);\n const isOutOfRange = getIsOutOfRangeDay(metaDay.dayAsString);\n const isStartRangeDay = getIsStartRangeDay(metaDay.dayAsString);\n const isEndRangeDay = getIsEndRangeDay(metaDay.dayAsString);\n const isDayInRangeImproper = getIsDayInRange(metaDay.dayAsString);\n const isDayInRange = !isStartRangeDay && !isEndRangeDay && isDayInRangeImproper;\n\n const dayAriaLabel = useMemo(\n () => `${getAriaDayFromDateString(dayAsString)}, ${weekDays[metaDay.day.getDay()]}`,\n [dayAsString, metaDay],\n );\n\n const rangeSelectionAnnouncement = useMemo(() => {\n if (fromDate && toDate) {\n if (fromDate === toDate) return `Please select another day to complete range selection.`;\n return `Range from ${fromDate} to ${toDate} selected.`;\n }\n if (fromDate && !toDate) return `Please select another day to complete range selection.`;\n return '';\n }, [fromDate, toDate]);\n\n const handleOnDayClick = useCallback(\n (e: DSControlledDateTimePickerT.OnInternalValuesChangeEvent) => {\n handleFocusMetaDayByDay(day);\n if (!isDisabled && !isOutOfRange && !readOnly && !applyAriaDisabled) {\n const newDateString = getDateStringFromDay(day);\n const metaInfo = { ...defaultMetaInfo, newDateString };\n const { month, day: dayNumber, year } = getDateValuesFromDate(day);\n appOnMonthChange(`${month + 1}`, e, metaInfo);\n if (dayNumber) appOnDayChange(`${dayNumber}`, e, metaInfo);\n appOnYearChange(`${year}`, e, metaInfo);\n handleChangeComposedDateString(newDateString, metaInfo);\n trackFocusCalendarMetafocusedDay();\n if (!isWithTimeWheelToo && !preventCloseOnSelection) closeCalendar();\n read(`${dayAriaLabel} selected.`, {});\n }\n },\n [\n handleFocusMetaDayByDay,\n day,\n isDisabled,\n isOutOfRange,\n readOnly,\n applyAriaDisabled,\n appOnMonthChange,\n appOnDayChange,\n appOnYearChange,\n handleChangeComposedDateString,\n trackFocusCalendarMetafocusedDay,\n isWithTimeWheelToo,\n preventCloseOnSelection,\n closeCalendar,\n read,\n dayAriaLabel,\n ],\n );\n\n const handleInnerRef = useCallback(\n (ButtonDomNode: HTMLButtonElement) => {\n window.requestAnimationFrame(() => {\n dayBtnRef.current = ButtonDomNode;\n if (isFocused) ButtonDomNode?.focus?.();\n /**\n * PUI-17922 https://jira.elliemae.io/browse/PUI-17922\n *\n * This allows consumers to plug this calendar into an external\n * focus trap by exposing the last focusable element through\n * `lastElementRef`.\n *\n * In the currently known scenarios (DSDataTable filters) that\n * last element is the day that is focused in the calendar when\n * the component is used in `controller-only` mode.\n *\n * Since this is a targeted bug fix, it is only applied for this\n * case for now (YAGNI). In the future we should review, for each\n * component configuration, which element should really be exposed\n * as `lastElementRef`.\n */\n if (lastElementRef && isControllerOnly && (isFocusedMetaDay || isFirstCurrMonthFallback)) {\n lastElementRef.current = ButtonDomNode;\n }\n });\n },\n [dayBtnRef, lastElementRef, isFocused, isFocusedMetaDay, isControllerOnly, isFirstCurrMonthFallback],\n );\n\n const handleOnDayFocus = useCallback(() => {\n trackFocusCalendarMetafocusedDay();\n }, [trackFocusCalendarMetafocusedDay]);\n\n const dayClassModifiers = useMemo(\n () =>\n `dayWrapper ${isSelected ? 'selectedDay ' : ''}${isDisabled ? 'disabledDay ' : ''}${\n isOutOfRange ? 'outOfRangeDay ' : ''\n }${isFocused ? 'focusedDay ' : ''}${isStartRangeDay ? 'startRangeDay ' : ''}${\n isDayInRangeImproper ? 'inRangeImproperDay ' : ''\n }${isDayInRange ? 'inRangeDay ' : ''}${isEndRangeDay ? 'endRangeDay ' : ''}${\n isCurrMonthDay ? '' : 'notCurrentMonth'\n }\n ${readOnly || applyAriaDisabled ? 'readOnly' : ''}`,\n [\n isSelected,\n isDisabled,\n isOutOfRange,\n isFocused,\n isStartRangeDay,\n isDayInRangeImproper,\n isDayInRange,\n isEndRangeDay,\n isCurrMonthDay,\n readOnly,\n applyAriaDisabled,\n ],\n );\n\n let dataTestid: (typeof ControlledDateTimePickerDatatestid)['CALENDAR'][keyof (typeof ControlledDateTimePickerDatatestid)['CALENDAR']] =\n ControlledDateTimePickerDatatestid.CALENDAR.DAY;\n\n if (isSelected) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.SELECTED_DAY;\n if (isFocused) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.FOCUSED_DAY;\n if (isFocused && isSelected) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.SELECTED_FOCUSED_DAY;\n if (isStartRangeDay) {\n dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.START_RANGE_DAY;\n if (isFocused) read(`${dayAriaLabel} selected. ${rangeSelectionAnnouncement}`, {});\n }\n if (isEndRangeDay) {\n dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.END_RANGE_DAY;\n if (isFocused) read(`${dayAriaLabel} selected. ${rangeSelectionAnnouncement}`, {});\n }\n if (isDayInRange) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.IN_RANGE_DAY;\n\n return (\n <div\n className={dayClassModifiers}\n style={isHidden ? displayNone : undefined}\n role=\"gridcell\"\n {...(Number.isInteger(colIndex) && { 'aria-colindex': colIndex })}\n >\n <StyledDayBtn\n aria-label={dayAriaLabel}\n aria-disabled={isOutOfRange || isDisabled || readOnly || applyAriaDisabled}\n applyAriaDisabled={applyAriaDisabled}\n aria-hidden={!!isInvisible}\n buttonType=\"raw\"\n size=\"m\"\n onClick={handleOnDayClick} // DSButton triggers this with \"spacebar\" and \"enter\" too...\n onFocus={handleOnDayFocus}\n onKeyDown={(e: React.KeyboardEvent<Element>) => {\n handleDayOnKeyDown(e, metaDay);\n }}\n innerRef={handleInnerRef}\n /**\n * PUI-17432 https://jira.elliemae.io/browse/PUI-17432\n *\n * We tried to avoid this in PUI-17922 by adding `lastElementRef`.\n * That works when the last element is focused programmatically by useFocusTrap logic,\n * but when going through the calendar and the last element is within another\n * component, on Shift+Tab the focus goes to the next month instead of the\n * last focused or selected day.\n *\n * This ensures that when using controller-only mode, focus moves back to the\n * last focused day.\n */\n tabIndex={isControllerOnly && (isFocusedMetaDay || isFirstCurrMonthFallback) ? 0 : -1}\n data-isfocused={isFocused}\n data-testid={dataTestid}\n type=\"button\"\n getOwnerProps={getProps}\n readOnlyStyles={readOnly || applyAriaDisabled}\n >\n {`${day.getDate()}`}\n </StyledDayBtn>\n <LiveRegion />\n </div>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmNnB;AAhNJ,8BAA8B;AAC9B,mBAAwD;AACxD,uBAAmD;AACnD,yCAAgD;AAGhD,IAAAA,oBAA0C;AAC1C,yBAMO;AACP,2BAAyC;AACzC,6BAAgC;AAChC,qBAA6B;AAO7B,MAAM,cAAc,EAAE,SAAS,OAAO;AAE/B,MAAM,MAAM,CAAC,EAAE,SAAS,UAAU,YAAY,MAAsC;AACzF,QAAM,EAAE,KAAK,gBAAgB,UAAU,WAAW,YAAY,IAAI;AAClE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,EAAE,yBAAyB,UAAU,mBAAmB,eAAe;AAAA,IAC9E;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,kEA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,UAAC;AAAA;AAAA,YACC,cAAY;AAAA,YACZ,iBAAe,gBAAgB,cAAc,YAAY;AAAA,YACzD;AAAA,YACA,eAAa,CAAC,CAAC;AAAA,YACf,YAAW;AAAA,YACX,MAAK;AAAA,YACL,SAAS;AAAA,YACT,SAAS;AAAA,YACT,WAAW,CAAC,MAAoC;AAC9C,iCAAmB,GAAG,OAAO;AAAA,YAC/B;AAAA,YACA,UAAU;AAAA,YAaV,UAAU,qBAAqB,oBAAoB,4BAA4B,IAAI;AAAA,YACnF,kBAAgB;AAAA,YAChB,eAAa;AAAA,YACb,MAAK;AAAA,YACL,eAAe;AAAA,YACf,gBAAgB,YAAY;AAAA,YAE3B,aAAG,IAAI,QAAQ,CAAC;AAAA;AAAA,QACnB;AAAA,QACA,4CAAC,cAAW;AAAA;AAAA;AAAA,EACd;AAEJ;",
|
|
6
6
|
"names": ["import_constants"]
|
|
7
7
|
}
|
|
@@ -120,6 +120,9 @@ const propTypes = {
|
|
|
120
120
|
"data-testid": import_ds_props_helpers.PropTypes.string.description("Unique id for tests.").defaultValue(""),
|
|
121
121
|
...(0, import_ds_props_helpers.getPropsPerDatatestIdPropTypes)(import_constants.ControlledDateTimePickerDatatestid),
|
|
122
122
|
innerRef: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.func, import_ds_props_helpers.PropTypes.object]).description("inner ref for the month input"),
|
|
123
|
+
lastElementRef: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.object]).description(
|
|
124
|
+
"ref for the last focusable element in the component based on its configuration, used for focus management in focus trap logic"
|
|
125
|
+
),
|
|
123
126
|
fromDate: import_ds_props_helpers.PropTypes.string.description(
|
|
124
127
|
`Strictly formatted string representing user's selected "from" date, this prop comes from the DateRangePicker and it's used internally for the range selection announcement`
|
|
125
128
|
),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport {\n PropTypes,\n getPropsPerDatatestIdPropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n type GlobalAttributesT,\n type ValidationMap,\n type XstyledProps,\n} from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type React from 'react';\nimport type { FORM_DATE_TIME_PICKER_SLOTS } from './constants/index.js';\nimport {\n ControlledDateTimePickerDatatestid,\n DSControlledDateTimePickerName,\n DSControlledDateTimePickerSlotsFlatten,\n} from './constants/index.js';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = (): void => {};\nconst defaultReturnFalse = (): false => false;\n\nexport declare namespace DSControlledDateTimePickerT {\n export type SlotFunctionArguments = {\n dsControlleddatetimepickerRoot: () => object;\n dsControlleddatetimepickerTimePickerMonthInput: () => object;\n dsControlleddatetimepickerTimePickerDayInput: () => object;\n dsControlleddatetimepickerTimePickerYearInput: () => object;\n dsControlleddatetimepickerTimePickerHourInput: () => object;\n dsControlleddatetimepickerTimePickerMinuteInput: () => object;\n dsControlleddatetimepickerTimePickerMeridiemInput: () => object;\n dsControlleddatetimepickerCalendarTriggerIcon: () => object;\n dsControlleddatetimepickerTimewheelTriggerIcon: () => object;\n dsControlleddatetimepickerCalendarTimewheelTriggerIcon: () => object;\n dsControlleddatetimepickerCalendarDay: () => object;\n dsControlleddatetimepickerCalendarHeaderLabel: () => object;\n dsControlleddatetimepickerCalendarHeaderButtons: () => object;\n dsControlleddatetimepickerCalendarHeaderWeeklyDayList: () => object;\n dsControlleddatetimepickerTimewheelTimeButton: () => object;\n dsControlleddatetimepickerTimewheelTimeChangeButton: () => object;\n dsControlleddatetimepickerTimewheelHeaderLabel: () => object;\n dsControlleddatetimepickerCalendarContextContentWrapper: () => object;\n dsControlleddatetimepickerTimewheelContextContentWrapper: () => object;\n dsControlleddatetimepickerCalendarTimewheelContextContentWrapper: () => object;\n dsControlleddatetimepickerCalendarContextFooter: () => object;\n dsControlleddatetimepickerTimewheelContextFooter: () => object;\n dsControlleddatetimepickerCalendarTimewheelContextFooter: () => object;\n dsControlleddatetimepickerCalendarControllerWrapper: () => object;\n dsControlleddatetimepickerTimewheelControllerWrapper: () => object;\n dsControlleddatetimepickerCalendarTimewheelControllerWrapper: () => object;\n dsControlleddatetimepickerClearBtn: () => object;\n };\n\n type PropsT<Default, Required, Optional, SpecificHTMLElement> = Partial<Default> &\n Required &\n Optional &\n TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSControlledDateTimePickerName,\n typeof FORM_DATE_TIME_PICKER_SLOTS\n > &\n Omit<GlobalAttributesT<SpecificHTMLElement>, keyof Default | keyof Required | keyof Optional> &\n Omit<XstyledProps, keyof Default | keyof Required | keyof Optional>;\n\n type InternalPropsT<Default, Required, Optional, SpecificHTMLElement> = Default &\n Required &\n Optional &\n TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSControlledDateTimePickerName,\n typeof FORM_DATE_TIME_PICKER_SLOTS\n > &\n Omit<GlobalAttributesT<SpecificHTMLElement>, keyof Default | keyof Required | keyof Optional> &\n Omit<XstyledProps, keyof Default | keyof Required | keyof Optional>;\n type DataTestIdType = typeof ControlledDateTimePickerDatatestid;\n // typescript type that rapresents the union of all the values for ControlledDateTimePickerDatatestid\n export type FlatDataTestIdValues = {\n [K in keyof DataTestIdType]: DataTestIdType[K] extends Record<string, unknown>\n ? DataTestIdType[K][keyof DataTestIdType[K]] // this is only 1 level deep, but it's enough for our needs right now\n : // can be extended to more levels if needed as follows:\n // ? DataTestIdType[K][keyof DataTestIdType[K]] extends Record<string, unknown>\n // ? DataTestIdType[K][keyof DataTestIdType[K]][keyof DataTestIdType[K][keyof DataTestIdType[K]]]\n // : DataTestIdType[K][keyof DataTestIdType[K]]\n DataTestIdType[K];\n }[keyof DataTestIdType];\n\n export type OnInternalValuesChangeEvent =\n | React.ChangeEvent<HTMLInputElement>\n | React.KeyboardEvent<HTMLInputElement>\n | React.KeyboardEvent<HTMLButtonElement>\n | React.KeyboardEvent\n | React.MouseEvent<HTMLInputElement>\n | React.MouseEvent<HTMLButtonElement>\n | React.MouseEvent<HTMLDivElement>;\n\n export type ControlTypes =\n | 'full-date-time'\n | 'date-time-inputs'\n | 'date-time-picker'\n | 'date-time-picker-controller-only'\n | 'full-date'\n | 'date-inputs'\n | 'date-picker'\n | 'date-picker-controller-only'\n | 'full-time'\n | 'time-inputs'\n | 'time-picker'\n | 'time-picker-controller-only';\n export interface InternalInputsChangeMetaInfo {\n isAutomaticFillTrigger?: boolean;\n isDayPresentInMonth?: boolean;\n isOutOfRangeDay?: boolean;\n isDisabledDay?: boolean;\n isDisabledTime?: boolean;\n suggestedErrorMsg?: string;\n newDateTimeString?: string;\n newDateString?: string;\n newTimeString?: string;\n }\n\n export type OnDateChange = (val: string, metaInfo: InternalInputsChangeMetaInfo) => void;\n export type OnTimeChange = (val: string, metaInfo: InternalInputsChangeMetaInfo) => void;\n export type OnDateTimeChange = (val: string, metaInfo: InternalInputsChangeMetaInfo) => void;\n export type OnInternalInputsChange = (\n val: string,\n e: OnInternalValuesChangeEvent,\n metaInfo?: InternalInputsChangeMetaInfo,\n ) => void;\n export type AppOnInputChange = (\n val: string,\n e: OnInternalValuesChangeEvent,\n metaInfo: InternalInputsChangeMetaInfo,\n ) => void;\n\n /* ------------------------ ------------------ ------------------------*/\n /* ------------------------ DATE CONFIGURATION ------------------------*/\n /* ------------------------ ------------------ ------------------------*/\n export interface DefaultDateProps {\n onMonthChange: AppOnInputChange;\n onDayChange: AppOnInputChange;\n onYearChange: AppOnInputChange;\n onPickerOpen: TypescriptHelpersT.VoidGenericFunc;\n onPickerClose: TypescriptHelpersT.VoidGenericFunc;\n getIsDisabledDay: TypescriptHelpersT.BooleanGetter<string>;\n getIsOutOfRangeDay: TypescriptHelpersT.BooleanGetter<string>;\n getIsStartRangeDay: TypescriptHelpersT.BooleanGetter<string>;\n getIsDayInRange: TypescriptHelpersT.BooleanGetter<string>;\n getIsEndRangeDay: TypescriptHelpersT.BooleanGetter<string>;\n isClearable: boolean;\n disabled: boolean;\n readOnly: boolean;\n hasError: boolean;\n autoFocus: boolean;\n preventCloseOnSelection: boolean;\n }\n export interface OptionalDatePickerProps\n extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSControlledDateTimePickerName,\n typeof DSControlledDateTimePickerSlotsFlatten\n > {\n applyAriaDisabled?: boolean;\n emptyPickerStartingMonth?: string;\n onCalendarOpenFocusedDay?: string;\n pickerFooterMsg?: string;\n innerRef?:\n | React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null>\n | ((ref: HTMLInputElement | HTMLButtonElement | null) => void);\n tabIndex?: TypescriptHelpersT.WCAGTabIndex;\n fromDate?: string;\n toDate?: string;\n }\n export interface RequiredDatePickerProps {\n type: 'full-date' | 'date-inputs' | 'date-picker' | 'date-picker-controller-only';\n date: string;\n onDateChange: OnDateChange;\n }\n export type DatePickerProps = PropsT<\n Partial<DefaultDateProps>,\n RequiredDatePickerProps,\n OptionalDatePickerProps,\n HTMLDivElement\n >;\n\n export type InternalDatePickerProps = InternalPropsT<\n DefaultDateProps,\n RequiredDatePickerProps,\n OptionalDatePickerProps,\n HTMLDivElement\n >;\n\n /* ------------------------ ------------------ ------------------------*/\n /* ------------------------ TIME CONFIGURATION ------------------------*/\n /* ------------------------ ------------------ ------------------------*/\n\n export interface DefaultTimeProps {\n onHourChange: AppOnInputChange;\n onMinuteChange: AppOnInputChange;\n onMeridiemChange: AppOnInputChange;\n onPickerOpen: TypescriptHelpersT.VoidGenericFunc;\n onPickerClose: TypescriptHelpersT.VoidGenericFunc;\n getIsDisabledTime: TypescriptHelpersT.BooleanGetter<string>;\n minutesInterval: number;\n isClearable: boolean;\n disabled: boolean;\n readOnly: boolean;\n hasError: boolean;\n autoFocus: boolean;\n preventCloseOnSelection: boolean;\n }\n export interface OptionalTimePickerProps\n extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSControlledDateTimePickerName,\n typeof DSControlledDateTimePickerSlotsFlatten\n > {\n applyAriaDisabled?: boolean;\n pickerFooterMsg?: string;\n onTimeWheelOpenStartingTime?: string;\n innerRef?:\n | React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null>\n | ((ref: HTMLInputElement | HTMLButtonElement | null) => void);\n tabIndex?: TypescriptHelpersT.WCAGTabIndex;\n }\n export interface RequiredTimePickerProps {\n type: 'full-time' | 'time-inputs' | 'time-picker' | 'time-picker-controller-only';\n time: string;\n onTimeChange: OnTimeChange;\n }\n export type TimePickerProps = PropsT<\n Partial<DefaultTimeProps>,\n RequiredTimePickerProps,\n OptionalTimePickerProps,\n HTMLDivElement\n >;\n\n export type InternalTimePickerProps = InternalPropsT<\n DefaultTimeProps,\n RequiredTimePickerProps,\n OptionalTimePickerProps,\n HTMLDivElement\n >;\n\n /* -------------------- ---------------------- ------------------------*/\n /* -------------------- DATETIME CONFIGURATION ------------------------*/\n /* -------------------- ---------------------- ------------------------*/\n\n export type DefaultDateTimeProps = DefaultTimeProps &\n DefaultDateProps & {\n onDateChange: OnDateChange;\n onTimeChange: OnTimeChange;\n };\n export type OptionalDateTimeProps = OptionalTimePickerProps &\n OptionalDatePickerProps &\n TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSControlledDateTimePickerName,\n typeof DSControlledDateTimePickerSlotsFlatten\n >;\n export interface RequiredDateTimeProps {\n type: 'full-date-time' | 'date-time-inputs' | 'date-time-picker' | 'date-time-picker-controller-only';\n dateTime: string;\n onDateTimeChange: OnDateTimeChange;\n }\n\n export type DateTimePickerProps = PropsT<\n Partial<DefaultDateTimeProps>,\n RequiredDateTimeProps,\n OptionalDateTimeProps,\n HTMLDivElement\n >;\n export type InternalDateTimePickerProps = InternalPropsT<\n DefaultDateTimeProps,\n RequiredDateTimeProps,\n OptionalDateTimeProps,\n HTMLDivElement\n >;\n\n /* ---------------------- ------------------- -------------------------*/\n /* ---------------------- FINAL CONFIGURATION -------------------------*/\n /* ---------------------- ------------------- -------------------------*/\n export type DefaultProps = DefaultDateTimeProps & { type: 'full-date-time' };\n\n export type Props = DateTimePickerProps | DatePickerProps | TimePickerProps;\n export type InternalProps = InternalDateTimePickerProps | InternalDatePickerProps | InternalTimePickerProps;\n}\n\nexport const defaultProps: DSControlledDateTimePickerT.DefaultProps = {\n type: 'full-date-time',\n onDateChange: noop,\n onMonthChange: noop,\n onDayChange: noop,\n onYearChange: noop,\n onTimeChange: noop,\n onHourChange: noop,\n onMinuteChange: noop,\n onMeridiemChange: noop,\n onPickerOpen: noop,\n onPickerClose: noop,\n getIsDisabledDay: defaultReturnFalse,\n getIsOutOfRangeDay: defaultReturnFalse,\n getIsStartRangeDay: defaultReturnFalse,\n getIsDayInRange: defaultReturnFalse,\n getIsEndRangeDay: defaultReturnFalse,\n getIsDisabledTime: defaultReturnFalse,\n minutesInterval: 1,\n isClearable: false,\n disabled: false,\n readOnly: false,\n hasError: false,\n autoFocus: false,\n preventCloseOnSelection: false,\n};\n\nexport const propTypes = {\n ...getPropsPerSlotPropTypes(DSControlledDateTimePickerName, DSControlledDateTimePickerSlotsFlatten),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n type: PropTypes.oneOf([\n 'full-date-time',\n 'date-time-inputs',\n 'date-time-picker',\n 'date-time-picker-controller-only',\n 'full-date',\n 'date-inputs',\n 'date-picker',\n 'date-picker-controller-only',\n 'full-time',\n 'time-inputs',\n 'time-picker',\n 'time-picker-controller-only',\n ])\n .description('Type of time form control to use')\n .defaultValue('full-date-time'),\n disabled: PropTypes.bool.description('wheter or not the input is disabled').defaultValue(false),\n applyAriaDisabled: PropTypes.bool.description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION.',\n ),\n readOnly: PropTypes.bool\n .description('Makes the component non-editable while remaining accessible')\n .defaultValue(false),\n isClearable: PropTypes.bool.description('with or without clearable button').defaultValue(false),\n dateTime: PropTypes.string.description('when using date-time types, this is the value of the controller'),\n date: PropTypes.string.description('when using date types, this is the value of the controller'),\n time: PropTypes.string.description('when using time types, this is the value of the controller'),\n onDateChange: PropTypes.func.description('(newDateString, metaInformations) => void'),\n onTimeChange: PropTypes.func.description('(newTimeString, metaInformations) => void'),\n onDateTimeChange: PropTypes.func.description('(newDateTimeString, metaInformations) => void'),\n onMonthChange: PropTypes.func.description('(newMonthString, event, metaInformations) => void'),\n onDayChange: PropTypes.func.description('(newDayString, event, metaInformations) => void'),\n onYearChange: PropTypes.func.description('(newYearString, event, metaInformations) => void'),\n onHourChange: PropTypes.func.description('(newHourString, event, metaInformations) => void'),\n onMinuteChange: PropTypes.func.description('(newMinuteString, event, metaInformations) => void'),\n onMeridiemChange: PropTypes.func.description('(newMeridiemString, event, metaInformations) => void'),\n getIsDisabledDay: PropTypes.func.description(\n '(dayAsString) => true for marking as disabled, false for marking as valid',\n ),\n getIsOutOfRangeDay: PropTypes.func.description(\n '(dayAsString) => true for marking as disabled, false for marking as valid',\n ),\n getIsDisabledTime: PropTypes.func.description(\n '(timeAsString) => true for marking as disabled, false for marking as valid',\n ),\n emptyPickerStartingMonth: PropTypes.string.description(\n 'which month to start the calendar on open, when value is empty, string following the \"MM/__/YYYY\" pattern',\n ),\n onCalendarOpenFocusedDay: PropTypes.string\n .description('which day to focus on calendar open when value is empty, string following the \"MM/DD/YYYY\" pattern')\n .defaultValue('if value is empty current month, else current month'),\n onTimeWheelOpenStartingTime: PropTypes.string\n .description(\n 'which day to start the timewheel on picker open when value is empty, string following the HH:MM AA\" pattern',\n )\n .defaultValue('01:00 AM'),\n minutesInterval: PropTypes.number\n .description('increments/decrements of minutes in time related controllers interactions')\n .defaultValue('1'),\n 'data-testid': PropTypes.string.description('Unique id for tests.').defaultValue(''),\n ...getPropsPerDatatestIdPropTypes(ControlledDateTimePickerDatatestid),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('inner ref for the month input'),\n fromDate: PropTypes.string.description(\n `Strictly formatted string representing user's selected \"from\" date, this prop comes from the DateRangePicker and it's used internally for the range selection announcement`,\n ),\n toDate: PropTypes.string.description(\n `Strictly formatted string representing user's selected \"to\" date, this prop comes from the DateRangePicker and it's used internally for the range selection announcement`,\n ),\n hasError: PropTypes.bool.description('whether the input has error or not').defaultValue(false),\n} as unknown as ValidationMap<DSControlledDateTimePickerT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,8BASO;AAIP,uBAIO;AAGP,MAAM,OAAO,MAAY;AAAC;AAC1B,MAAM,qBAAqB,MAAa;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport {\n PropTypes,\n getPropsPerDatatestIdPropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n type GlobalAttributesT,\n type ValidationMap,\n type XstyledProps,\n} from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type React from 'react';\nimport type { FORM_DATE_TIME_PICKER_SLOTS } from './constants/index.js';\nimport {\n ControlledDateTimePickerDatatestid,\n DSControlledDateTimePickerName,\n DSControlledDateTimePickerSlotsFlatten,\n} from './constants/index.js';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = (): void => {};\nconst defaultReturnFalse = (): false => false;\n\nexport declare namespace DSControlledDateTimePickerT {\n export type SlotFunctionArguments = {\n dsControlleddatetimepickerRoot: () => object;\n dsControlleddatetimepickerTimePickerMonthInput: () => object;\n dsControlleddatetimepickerTimePickerDayInput: () => object;\n dsControlleddatetimepickerTimePickerYearInput: () => object;\n dsControlleddatetimepickerTimePickerHourInput: () => object;\n dsControlleddatetimepickerTimePickerMinuteInput: () => object;\n dsControlleddatetimepickerTimePickerMeridiemInput: () => object;\n dsControlleddatetimepickerCalendarTriggerIcon: () => object;\n dsControlleddatetimepickerTimewheelTriggerIcon: () => object;\n dsControlleddatetimepickerCalendarTimewheelTriggerIcon: () => object;\n dsControlleddatetimepickerCalendarDay: () => object;\n dsControlleddatetimepickerCalendarHeaderLabel: () => object;\n dsControlleddatetimepickerCalendarHeaderButtons: () => object;\n dsControlleddatetimepickerCalendarHeaderWeeklyDayList: () => object;\n dsControlleddatetimepickerTimewheelTimeButton: () => object;\n dsControlleddatetimepickerTimewheelTimeChangeButton: () => object;\n dsControlleddatetimepickerTimewheelHeaderLabel: () => object;\n dsControlleddatetimepickerCalendarContextContentWrapper: () => object;\n dsControlleddatetimepickerTimewheelContextContentWrapper: () => object;\n dsControlleddatetimepickerCalendarTimewheelContextContentWrapper: () => object;\n dsControlleddatetimepickerCalendarContextFooter: () => object;\n dsControlleddatetimepickerTimewheelContextFooter: () => object;\n dsControlleddatetimepickerCalendarTimewheelContextFooter: () => object;\n dsControlleddatetimepickerCalendarControllerWrapper: () => object;\n dsControlleddatetimepickerTimewheelControllerWrapper: () => object;\n dsControlleddatetimepickerCalendarTimewheelControllerWrapper: () => object;\n dsControlleddatetimepickerClearBtn: () => object;\n };\n\n type PropsT<Default, Required, Optional, SpecificHTMLElement> = Partial<Default> &\n Required &\n Optional &\n TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSControlledDateTimePickerName,\n typeof FORM_DATE_TIME_PICKER_SLOTS\n > &\n Omit<GlobalAttributesT<SpecificHTMLElement>, keyof Default | keyof Required | keyof Optional> &\n Omit<XstyledProps, keyof Default | keyof Required | keyof Optional>;\n\n type InternalPropsT<Default, Required, Optional, SpecificHTMLElement> = Default &\n Required &\n Optional &\n TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSControlledDateTimePickerName,\n typeof FORM_DATE_TIME_PICKER_SLOTS\n > &\n Omit<GlobalAttributesT<SpecificHTMLElement>, keyof Default | keyof Required | keyof Optional> &\n Omit<XstyledProps, keyof Default | keyof Required | keyof Optional>;\n type DataTestIdType = typeof ControlledDateTimePickerDatatestid;\n // typescript type that rapresents the union of all the values for ControlledDateTimePickerDatatestid\n export type FlatDataTestIdValues = {\n [K in keyof DataTestIdType]: DataTestIdType[K] extends Record<string, unknown>\n ? DataTestIdType[K][keyof DataTestIdType[K]] // this is only 1 level deep, but it's enough for our needs right now\n : // can be extended to more levels if needed as follows:\n // ? DataTestIdType[K][keyof DataTestIdType[K]] extends Record<string, unknown>\n // ? DataTestIdType[K][keyof DataTestIdType[K]][keyof DataTestIdType[K][keyof DataTestIdType[K]]]\n // : DataTestIdType[K][keyof DataTestIdType[K]]\n DataTestIdType[K];\n }[keyof DataTestIdType];\n\n export type OnInternalValuesChangeEvent =\n | React.ChangeEvent<HTMLInputElement>\n | React.KeyboardEvent<HTMLInputElement>\n | React.KeyboardEvent<HTMLButtonElement>\n | React.KeyboardEvent\n | React.MouseEvent<HTMLInputElement>\n | React.MouseEvent<HTMLButtonElement>\n | React.MouseEvent<HTMLDivElement>;\n\n export type ControlTypes =\n | 'full-date-time'\n | 'date-time-inputs'\n | 'date-time-picker'\n | 'date-time-picker-controller-only'\n | 'full-date'\n | 'date-inputs'\n | 'date-picker'\n | 'date-picker-controller-only'\n | 'full-time'\n | 'time-inputs'\n | 'time-picker'\n | 'time-picker-controller-only';\n export interface InternalInputsChangeMetaInfo {\n isAutomaticFillTrigger?: boolean;\n isDayPresentInMonth?: boolean;\n isOutOfRangeDay?: boolean;\n isDisabledDay?: boolean;\n isDisabledTime?: boolean;\n suggestedErrorMsg?: string;\n newDateTimeString?: string;\n newDateString?: string;\n newTimeString?: string;\n }\n\n export type OnDateChange = (val: string, metaInfo: InternalInputsChangeMetaInfo) => void;\n export type OnTimeChange = (val: string, metaInfo: InternalInputsChangeMetaInfo) => void;\n export type OnDateTimeChange = (val: string, metaInfo: InternalInputsChangeMetaInfo) => void;\n export type OnInternalInputsChange = (\n val: string,\n e: OnInternalValuesChangeEvent,\n metaInfo?: InternalInputsChangeMetaInfo,\n ) => void;\n export type AppOnInputChange = (\n val: string,\n e: OnInternalValuesChangeEvent,\n metaInfo: InternalInputsChangeMetaInfo,\n ) => void;\n\n /* ------------------------ ------------------ ------------------------*/\n /* ------------------------ DATE CONFIGURATION ------------------------*/\n /* ------------------------ ------------------ ------------------------*/\n export interface DefaultDateProps {\n onMonthChange: AppOnInputChange;\n onDayChange: AppOnInputChange;\n onYearChange: AppOnInputChange;\n onPickerOpen: TypescriptHelpersT.VoidGenericFunc;\n onPickerClose: TypescriptHelpersT.VoidGenericFunc;\n getIsDisabledDay: TypescriptHelpersT.BooleanGetter<string>;\n getIsOutOfRangeDay: TypescriptHelpersT.BooleanGetter<string>;\n getIsStartRangeDay: TypescriptHelpersT.BooleanGetter<string>;\n getIsDayInRange: TypescriptHelpersT.BooleanGetter<string>;\n getIsEndRangeDay: TypescriptHelpersT.BooleanGetter<string>;\n isClearable: boolean;\n disabled: boolean;\n readOnly: boolean;\n hasError: boolean;\n autoFocus: boolean;\n preventCloseOnSelection: boolean;\n }\n export interface OptionalDatePickerProps\n extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSControlledDateTimePickerName,\n typeof DSControlledDateTimePickerSlotsFlatten\n > {\n applyAriaDisabled?: boolean;\n emptyPickerStartingMonth?: string;\n onCalendarOpenFocusedDay?: string;\n pickerFooterMsg?: string;\n innerRef?:\n | React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null>\n | ((ref: HTMLInputElement | HTMLButtonElement | null) => void);\n lastElementRef?: React.MutableRefObject<HTMLElement | null>;\n tabIndex?: TypescriptHelpersT.WCAGTabIndex;\n fromDate?: string;\n toDate?: string;\n }\n export interface RequiredDatePickerProps {\n type: 'full-date' | 'date-inputs' | 'date-picker' | 'date-picker-controller-only';\n date: string;\n onDateChange: OnDateChange;\n }\n export type DatePickerProps = PropsT<\n Partial<DefaultDateProps>,\n RequiredDatePickerProps,\n OptionalDatePickerProps,\n HTMLDivElement\n >;\n\n export type InternalDatePickerProps = InternalPropsT<\n DefaultDateProps,\n RequiredDatePickerProps,\n OptionalDatePickerProps,\n HTMLDivElement\n >;\n\n /* ------------------------ ------------------ ------------------------*/\n /* ------------------------ TIME CONFIGURATION ------------------------*/\n /* ------------------------ ------------------ ------------------------*/\n\n export interface DefaultTimeProps {\n onHourChange: AppOnInputChange;\n onMinuteChange: AppOnInputChange;\n onMeridiemChange: AppOnInputChange;\n onPickerOpen: TypescriptHelpersT.VoidGenericFunc;\n onPickerClose: TypescriptHelpersT.VoidGenericFunc;\n getIsDisabledTime: TypescriptHelpersT.BooleanGetter<string>;\n minutesInterval: number;\n isClearable: boolean;\n disabled: boolean;\n readOnly: boolean;\n hasError: boolean;\n autoFocus: boolean;\n preventCloseOnSelection: boolean;\n }\n export interface OptionalTimePickerProps\n extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSControlledDateTimePickerName,\n typeof DSControlledDateTimePickerSlotsFlatten\n > {\n applyAriaDisabled?: boolean;\n pickerFooterMsg?: string;\n onTimeWheelOpenStartingTime?: string;\n innerRef?:\n | React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null>\n | ((ref: HTMLInputElement | HTMLButtonElement | null) => void);\n lastElementRef?: React.MutableRefObject<HTMLElement | null>;\n tabIndex?: TypescriptHelpersT.WCAGTabIndex;\n }\n export interface RequiredTimePickerProps {\n type: 'full-time' | 'time-inputs' | 'time-picker' | 'time-picker-controller-only';\n time: string;\n onTimeChange: OnTimeChange;\n }\n export type TimePickerProps = PropsT<\n Partial<DefaultTimeProps>,\n RequiredTimePickerProps,\n OptionalTimePickerProps,\n HTMLDivElement\n >;\n\n export type InternalTimePickerProps = InternalPropsT<\n DefaultTimeProps,\n RequiredTimePickerProps,\n OptionalTimePickerProps,\n HTMLDivElement\n >;\n\n /* -------------------- ---------------------- ------------------------*/\n /* -------------------- DATETIME CONFIGURATION ------------------------*/\n /* -------------------- ---------------------- ------------------------*/\n\n export type DefaultDateTimeProps = DefaultTimeProps &\n DefaultDateProps & {\n onDateChange: OnDateChange;\n onTimeChange: OnTimeChange;\n };\n export type OptionalDateTimeProps = OptionalTimePickerProps &\n OptionalDatePickerProps &\n TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSControlledDateTimePickerName,\n typeof DSControlledDateTimePickerSlotsFlatten\n >;\n export interface RequiredDateTimeProps {\n type: 'full-date-time' | 'date-time-inputs' | 'date-time-picker' | 'date-time-picker-controller-only';\n dateTime: string;\n onDateTimeChange: OnDateTimeChange;\n }\n\n export type DateTimePickerProps = PropsT<\n Partial<DefaultDateTimeProps>,\n RequiredDateTimeProps,\n OptionalDateTimeProps,\n HTMLDivElement\n >;\n export type InternalDateTimePickerProps = InternalPropsT<\n DefaultDateTimeProps,\n RequiredDateTimeProps,\n OptionalDateTimeProps,\n HTMLDivElement\n >;\n\n /* ---------------------- ------------------- -------------------------*/\n /* ---------------------- FINAL CONFIGURATION -------------------------*/\n /* ---------------------- ------------------- -------------------------*/\n export type DefaultProps = DefaultDateTimeProps & { type: 'full-date-time' };\n\n export type Props = DateTimePickerProps | DatePickerProps | TimePickerProps;\n export type InternalProps = InternalDateTimePickerProps | InternalDatePickerProps | InternalTimePickerProps;\n}\n\nexport const defaultProps: DSControlledDateTimePickerT.DefaultProps = {\n type: 'full-date-time',\n onDateChange: noop,\n onMonthChange: noop,\n onDayChange: noop,\n onYearChange: noop,\n onTimeChange: noop,\n onHourChange: noop,\n onMinuteChange: noop,\n onMeridiemChange: noop,\n onPickerOpen: noop,\n onPickerClose: noop,\n getIsDisabledDay: defaultReturnFalse,\n getIsOutOfRangeDay: defaultReturnFalse,\n getIsStartRangeDay: defaultReturnFalse,\n getIsDayInRange: defaultReturnFalse,\n getIsEndRangeDay: defaultReturnFalse,\n getIsDisabledTime: defaultReturnFalse,\n minutesInterval: 1,\n isClearable: false,\n disabled: false,\n readOnly: false,\n hasError: false,\n autoFocus: false,\n preventCloseOnSelection: false,\n};\n\nexport const propTypes = {\n ...getPropsPerSlotPropTypes(DSControlledDateTimePickerName, DSControlledDateTimePickerSlotsFlatten),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n type: PropTypes.oneOf([\n 'full-date-time',\n 'date-time-inputs',\n 'date-time-picker',\n 'date-time-picker-controller-only',\n 'full-date',\n 'date-inputs',\n 'date-picker',\n 'date-picker-controller-only',\n 'full-time',\n 'time-inputs',\n 'time-picker',\n 'time-picker-controller-only',\n ])\n .description('Type of time form control to use')\n .defaultValue('full-date-time'),\n disabled: PropTypes.bool.description('wheter or not the input is disabled').defaultValue(false),\n applyAriaDisabled: PropTypes.bool.description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION.',\n ),\n readOnly: PropTypes.bool\n .description('Makes the component non-editable while remaining accessible')\n .defaultValue(false),\n isClearable: PropTypes.bool.description('with or without clearable button').defaultValue(false),\n dateTime: PropTypes.string.description('when using date-time types, this is the value of the controller'),\n date: PropTypes.string.description('when using date types, this is the value of the controller'),\n time: PropTypes.string.description('when using time types, this is the value of the controller'),\n onDateChange: PropTypes.func.description('(newDateString, metaInformations) => void'),\n onTimeChange: PropTypes.func.description('(newTimeString, metaInformations) => void'),\n onDateTimeChange: PropTypes.func.description('(newDateTimeString, metaInformations) => void'),\n onMonthChange: PropTypes.func.description('(newMonthString, event, metaInformations) => void'),\n onDayChange: PropTypes.func.description('(newDayString, event, metaInformations) => void'),\n onYearChange: PropTypes.func.description('(newYearString, event, metaInformations) => void'),\n onHourChange: PropTypes.func.description('(newHourString, event, metaInformations) => void'),\n onMinuteChange: PropTypes.func.description('(newMinuteString, event, metaInformations) => void'),\n onMeridiemChange: PropTypes.func.description('(newMeridiemString, event, metaInformations) => void'),\n getIsDisabledDay: PropTypes.func.description(\n '(dayAsString) => true for marking as disabled, false for marking as valid',\n ),\n getIsOutOfRangeDay: PropTypes.func.description(\n '(dayAsString) => true for marking as disabled, false for marking as valid',\n ),\n getIsDisabledTime: PropTypes.func.description(\n '(timeAsString) => true for marking as disabled, false for marking as valid',\n ),\n emptyPickerStartingMonth: PropTypes.string.description(\n 'which month to start the calendar on open, when value is empty, string following the \"MM/__/YYYY\" pattern',\n ),\n onCalendarOpenFocusedDay: PropTypes.string\n .description('which day to focus on calendar open when value is empty, string following the \"MM/DD/YYYY\" pattern')\n .defaultValue('if value is empty current month, else current month'),\n onTimeWheelOpenStartingTime: PropTypes.string\n .description(\n 'which day to start the timewheel on picker open when value is empty, string following the HH:MM AA\" pattern',\n )\n .defaultValue('01:00 AM'),\n minutesInterval: PropTypes.number\n .description('increments/decrements of minutes in time related controllers interactions')\n .defaultValue('1'),\n 'data-testid': PropTypes.string.description('Unique id for tests.').defaultValue(''),\n ...getPropsPerDatatestIdPropTypes(ControlledDateTimePickerDatatestid),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('inner ref for the month input'),\n lastElementRef: PropTypes.oneOfType([PropTypes.object]).description(\n 'ref for the last focusable element in the component based on its configuration, used for focus management in focus trap logic',\n ),\n fromDate: PropTypes.string.description(\n `Strictly formatted string representing user's selected \"from\" date, this prop comes from the DateRangePicker and it's used internally for the range selection announcement`,\n ),\n toDate: PropTypes.string.description(\n `Strictly formatted string representing user's selected \"to\" date, this prop comes from the DateRangePicker and it's used internally for the range selection announcement`,\n ),\n hasError: PropTypes.bool.description('whether the input has error or not').defaultValue(false),\n} as unknown as ValidationMap<DSControlledDateTimePickerT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,8BASO;AAIP,uBAIO;AAGP,MAAM,OAAO,MAAY;AAAC;AAC1B,MAAM,qBAAqB,MAAa;AAwQjC,MAAM,eAAyD;AAAA,EACpE,MAAM;AAAA,EACN,cAAc;AAAA,EACd,eAAe;AAAA,EACf,aAAa;AAAA,EACb,cAAc;AAAA,EACd,cAAc;AAAA,EAC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19: "ninteenth",
|
|
73
73
|
20: "twentieth",
|
|
74
|
-
21: "
|
|
75
|
-
22: "
|
|
76
|
-
23: "
|
|
77
|
-
24: "
|
|
78
|
-
25: "
|
|
79
|
-
26: "
|
|
80
|
-
27: "
|
|
81
|
-
28: "
|
|
82
|
-
29: "
|
|
74
|
+
21: "twenty first",
|
|
75
|
+
22: "twenty second",
|
|
76
|
+
23: "twenty third",
|
|
77
|
+
24: "twenty fourth",
|
|
78
|
+
25: "twenty fifth",
|
|
79
|
+
26: "twenty sixth",
|
|
80
|
+
27: "twenty seventh",
|
|
81
|
+
28: "twenty eighth",
|
|
82
|
+
29: "twenty ninth",
|
|
83
83
|
30: "thirtieth",
|
|
84
84
|
31: "thirty first"
|
|
85
85
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/utils/constants.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export const weekDays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] as const;\n\nexport const monthNames = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n] as const;\n\nexport const announcableCardinalDays = {\n 1: 'first',\n 2: 'second',\n 3: 'third',\n 4: 'fourth',\n 5: 'fifth',\n 6: 'sixth',\n 7: 'seventh',\n 8: 'eighth',\n 9: 'ninth',\n 10: 'tenth',\n 11: 'eleventh',\n 12: 'twelfth',\n 13: 'thirteenth',\n 14: 'fourteenth',\n 15: 'fifteenth',\n 16: 'sixteenth',\n 17: 'seventeenth',\n 18: 'eighteenth',\n 19: 'ninteenth',\n 20: 'twentieth',\n 21: '
|
|
4
|
+
"sourcesContent": ["export const weekDays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] as const;\n\nexport const monthNames = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n] as const;\n\nexport const announcableCardinalDays = {\n 1: 'first',\n 2: 'second',\n 3: 'third',\n 4: 'fourth',\n 5: 'fifth',\n 6: 'sixth',\n 7: 'seventh',\n 8: 'eighth',\n 9: 'ninth',\n 10: 'tenth',\n 11: 'eleventh',\n 12: 'twelfth',\n 13: 'thirteenth',\n 14: 'fourteenth',\n 15: 'fifteenth',\n 16: 'sixteenth',\n 17: 'seventeenth',\n 18: 'eighteenth',\n 19: 'ninteenth',\n 20: 'twentieth',\n 21: 'twenty first',\n 22: 'twenty second',\n 23: 'twenty third',\n 24: 'twenty fourth',\n 25: 'twenty fifth',\n 26: 'twenty sixth',\n 27: 'twenty seventh',\n 28: 'twenty eighth',\n 29: 'twenty ninth',\n 30: 'thirtieth',\n 31: 'thirty first',\n} as const;\n\nexport const defaultMetaInfo = { isAutomaticFillTrigger: false };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,WAAW,CAAC,UAAU,UAAU,WAAW,aAAa,YAAY,UAAU,UAAU;AAE9F,MAAM,aAAa;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,MAAM,0BAA0B;AAAA,EACrC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEO,MAAM,kBAAkB,EAAE,wBAAwB,MAAM;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,7 +4,7 @@ const useFocusTracker = ({ DOMRefs, flags }) => {
|
|
|
4
4
|
const [latestInteractionRegion, setLatestInteractionRegion] = useState("");
|
|
5
5
|
const [currFocusDescriber, setCurrFocusDescriber] = useState("");
|
|
6
6
|
const { firstSegment, lastSegment } = DOMRefs;
|
|
7
|
-
const { isDateSelector, isTimeSelector } = flags;
|
|
7
|
+
const { isDateSelector, isTimeSelector, isControllerOnly } = flags;
|
|
8
8
|
const trackFocusPicker = useCallback(() => {
|
|
9
9
|
let picker = "datetime-picker-icon";
|
|
10
10
|
if (isDateSelector) picker = "date-picker-icon";
|
|
@@ -35,17 +35,28 @@ const useFocusTracker = ({ DOMRefs, flags }) => {
|
|
|
35
35
|
if (latestInteractionRegion !== "") setLatestInteractionRegion("");
|
|
36
36
|
if (currFocusDescriber !== "") setCurrFocusDescriber("");
|
|
37
37
|
}, [currFocusDescriber, latestInteractionRegion]);
|
|
38
|
-
const handleComponentBlurs = useCallback(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
const handleComponentBlurs = useCallback(
|
|
39
|
+
(e) => {
|
|
40
|
+
if (isControllerOnly) {
|
|
41
|
+
const relatedTarget = e.relatedTarget;
|
|
42
|
+
if (relatedTarget && e.currentTarget.contains(relatedTarget)) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
trackFocusResetter();
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
let shouldShortCircuit = false;
|
|
49
|
+
if (latestInteractionRegion === "calendar-days" && currFocusDescriber === "calendar-metafocused-day")
|
|
50
|
+
shouldShortCircuit = true;
|
|
51
|
+
if (latestInteractionRegion === "calendar-head" && currFocusDescriber === "calendar-prev-month")
|
|
52
|
+
shouldShortCircuit = true;
|
|
53
|
+
if (latestInteractionRegion === "timewheel" && currFocusDescriber === "timewheel-curr-hour")
|
|
54
|
+
shouldShortCircuit = true;
|
|
55
|
+
if (shouldShortCircuit) return;
|
|
56
|
+
trackFocusResetter();
|
|
57
|
+
},
|
|
58
|
+
[currFocusDescriber, isControllerOnly, latestInteractionRegion, trackFocusResetter]
|
|
59
|
+
);
|
|
49
60
|
return useMemo(
|
|
50
61
|
() => ({
|
|
51
62
|
latestInteractionRegion,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useFocusTracker.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable max-lines */\n/* eslint-disable indent */\n/* eslint-disable max-params */\n/* eslint-disable max-statements */\nimport { useCallback, useMemo, useState } from 'react';\nimport type { useGetReferences } from './useGetReferences.js';\nimport type { useGetFlags } from './useGetFlags.js';\n\ntype LatestInteractionRegion =\n | 'calendar-days'\n | 'calendar-head'\n | 'timewheel'\n | 'date-inputs'\n | 'time-inputs'\n | 'clear-btn'\n | 'picker-icon'\n | '';\ntype CurrFocusDescriber =\n | 'first-segment'\n | 'month-input'\n | 'day-input'\n | 'year-input'\n | 'hour-input'\n | 'minute-input'\n | 'meridiem-input'\n | 'last-segment'\n | 'clear-btn'\n | 'date-picker-icon'\n | 'time-picker-icon'\n | 'datetime-picker-icon'\n | 'calendar-prev-month'\n | 'calendar-next-month'\n | 'calendar-prev-year'\n | 'calendar-next-year'\n | 'calendar-metafocused-day'\n | 'timewheel-curr-hour'\n | 'timewheel-curr-minute'\n | 'timewheel-curr-meridiem'\n | '';\n\ninterface Config {\n DOMRefs: ReturnType<typeof useGetReferences>;\n flags: ReturnType<typeof useGetFlags>;\n}\nexport const useFocusTracker = ({ DOMRefs, flags }: Config) => {\n const [latestInteractionRegion, setLatestInteractionRegion] = useState<LatestInteractionRegion>('');\n const [currFocusDescriber, setCurrFocusDescriber] = useState<CurrFocusDescriber>('');\n const { firstSegment, lastSegment } = DOMRefs;\n const { isDateSelector, isTimeSelector } = flags;\n\n const trackFocusPicker = useCallback(() => {\n let picker = 'datetime-picker-icon' as CurrFocusDescriber;\n if (isDateSelector) picker = 'date-picker-icon';\n if (isTimeSelector) picker = 'time-picker-icon';\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (picker !== currFocusDescriber) setCurrFocusDescriber(picker);\n }, [currFocusDescriber, isDateSelector, isTimeSelector, latestInteractionRegion]);\n\n /*\n depending on the polymorphic props, the first segment can be:\n - month-input (when date inputs are present)\n - hour-input (when ONLY time inputs are present)\n - datetime-picker-icon (when picker is present and we are selecting both date and time)\n - date-picker-icon (when picker is present and no time selection is involved)\n - time-picker-icon (when picker is present and no date selection is involved)\n */\n const trackFocusFirstSegment = useCallback(() => {\n let region = 'date-inputs' as LatestInteractionRegion;\n if (firstSegment === 'hour-input') region = 'time-inputs';\n if (firstSegment === 'date-picker-icon') region = 'picker-icon';\n if (firstSegment === 'time-picker-icon') region = 'picker-icon';\n if (firstSegment === 'datetime-picker-icon') region = 'picker-icon';\n if (region !== latestInteractionRegion) setLatestInteractionRegion(region);\n if (firstSegment !== currFocusDescriber) setCurrFocusDescriber(firstSegment);\n }, [currFocusDescriber, firstSegment, latestInteractionRegion]);\n\n /*\n depending on the polymorphic props, the last segment can be:\n - year-input (when ONLY date inputs are present)\n - meridiem-input (when time inputs are present)\n - clear-btn (when clearable is true and there is no picker)\n - datetime-picker-icon (when picker is present and we are selecting both date and time)\n - date-picker-icon (when picker is present and no time selection is involved)\n - time-picker-icon (when picker is present and no date selection is involved)\n */\n const trackFocusLastSegment = useCallback(() => {\n let region = 'date-inputs' as LatestInteractionRegion;\n if (lastSegment === 'meridiem-input') region = 'time-inputs';\n if (lastSegment === 'clear-btn') region = 'clear-btn';\n if (lastSegment === 'date-picker-icon') region = 'picker-icon';\n if (lastSegment === 'time-picker-icon') region = 'picker-icon';\n if (lastSegment === 'datetime-picker-icon') region = 'picker-icon';\n if (region !== latestInteractionRegion) setLatestInteractionRegion(region);\n if (lastSegment !== currFocusDescriber) setCurrFocusDescriber(lastSegment);\n }, [currFocusDescriber, lastSegment, latestInteractionRegion]);\n\n const trackFocusResetter = useCallback(() => {\n if (latestInteractionRegion !== '') setLatestInteractionRegion('');\n if (currFocusDescriber !== '') setCurrFocusDescriber('');\n }, [currFocusDescriber, latestInteractionRegion]);\n\n const handleComponentBlurs = useCallback(() => {\n /* our code base is trying to avoid side-effects and we also try to be imperative\n due to how \"portals\" work, when we open a portal the \"blur\" event is triggered\n we need to distinguish between\n - a blur that is caused by a portal opening\n vs\n - a blur that is caused by a user moving focus to another element\n we can do this by checking the currFocusDescriber and latestInteractionRegion\n we know that blur is triggered by portal opening when:\n - latestInteractionRegion === 'calendar-days' && currFocusDescriber === 'calendar-metafocused-day'\n (this is the case when we open the calendar or calendarWithTimeWheel with a preselected date)\n - latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-prev-month'\n (this is the case when we open the calendar or calendarWithTimeWheel without a preselected date)\n - latestInteractionRegion === 'timewheel' && currFocusDescriber === 'timewheel-curr-hour'\n (this is the case when we open any timewheel ONLY)\n */\n let shouldShortCircuit = false;\n // preselected date OR filled date value OR onCalendarOpenFocusedDay is present\n if (latestInteractionRegion === 'calendar-days' && currFocusDescriber === 'calendar-metafocused-day')\n shouldShortCircuit = true;\n // empty date value AND no onCalendarOpenFocusedDay is present\n if (latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-prev-month')\n shouldShortCircuit = true;\n\n // only time wheel is present in the contextual region\n if (latestInteractionRegion === 'timewheel' && currFocusDescriber === 'timewheel-curr-hour')\n shouldShortCircuit = true;\n\n if (shouldShortCircuit) return;\n trackFocusResetter();\n }, [currFocusDescriber, latestInteractionRegion, trackFocusResetter]);\n\n return useMemo(\n () => ({\n latestInteractionRegion,\n setLatestInteractionRegion,\n currFocusDescriber,\n setCurrFocusDescriber,\n trackFocusResetter,\n trackFocusMonthInput: () => {\n if (latestInteractionRegion !== 'date-inputs') setLatestInteractionRegion('date-inputs');\n if (currFocusDescriber !== 'month-input') setCurrFocusDescriber('month-input');\n },\n trackFocusDayInput: () => {\n if (latestInteractionRegion !== 'date-inputs') setLatestInteractionRegion('date-inputs');\n if (currFocusDescriber !== 'day-input') setCurrFocusDescriber('day-input');\n },\n trackFocusYearInput: () => {\n if (latestInteractionRegion !== 'date-inputs') setLatestInteractionRegion('date-inputs');\n if (currFocusDescriber !== 'year-input') setCurrFocusDescriber('year-input');\n },\n trackFocusHourInput: () => {\n if (latestInteractionRegion !== 'time-inputs') setLatestInteractionRegion('time-inputs');\n if (currFocusDescriber !== 'hour-input') setCurrFocusDescriber('hour-input');\n },\n trackFocusMinuteInput: () => {\n if (latestInteractionRegion !== 'time-inputs') setLatestInteractionRegion('time-inputs');\n if (currFocusDescriber !== 'minute-input') setCurrFocusDescriber('minute-input');\n },\n trackFocusMeridiemInput: () => {\n if (latestInteractionRegion !== 'time-inputs') setLatestInteractionRegion('time-inputs');\n if (currFocusDescriber !== 'meridiem-input') setCurrFocusDescriber('meridiem-input');\n },\n trackFocusClearBtn: () => {\n if (latestInteractionRegion !== 'clear-btn') setLatestInteractionRegion('clear-btn');\n if (currFocusDescriber !== 'clear-btn') setCurrFocusDescriber('clear-btn');\n },\n trackFocusDatePickerIcon: () => {\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (currFocusDescriber !== 'date-picker-icon') setCurrFocusDescriber('date-picker-icon');\n },\n trackFocusTimePickerIcon: () => {\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (currFocusDescriber !== 'time-picker-icon') setCurrFocusDescriber('time-picker-icon');\n },\n trackFocusDatetimePickerIcon: () => {\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (currFocusDescriber !== 'datetime-picker-icon') setCurrFocusDescriber('datetime-picker-icon');\n },\n trackFocusCalendarPrevMonth: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-prev-month') setCurrFocusDescriber('calendar-prev-month');\n },\n trackFocusCalendarNextMonth: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-next-month') setCurrFocusDescriber('calendar-next-month');\n },\n trackFocusCalendarPrevYear: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-prev-year') setCurrFocusDescriber('calendar-prev-year');\n },\n trackFocusCalendarNextYear: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-next-year') setCurrFocusDescriber('calendar-next-year');\n },\n trackFocusCalendarMetafocusedDay: () => {\n if (latestInteractionRegion !== 'calendar-days') setLatestInteractionRegion('calendar-days');\n if (currFocusDescriber !== 'calendar-metafocused-day') setCurrFocusDescriber('calendar-metafocused-day');\n },\n trackFocusTimewheelCurrHour: () => {\n if (latestInteractionRegion !== 'timewheel') setLatestInteractionRegion('timewheel');\n if (currFocusDescriber !== 'timewheel-curr-hour') setCurrFocusDescriber('timewheel-curr-hour');\n },\n trackFocusTimewheelCurrMinute: () => {\n if (latestInteractionRegion !== 'timewheel') setLatestInteractionRegion('timewheel');\n if (currFocusDescriber !== 'timewheel-curr-minute') setCurrFocusDescriber('timewheel-curr-minute');\n },\n trackFocusTimewheelCurrMeridiem: () => {\n if (latestInteractionRegion !== 'timewheel') setLatestInteractionRegion('timewheel');\n if (currFocusDescriber !== 'timewheel-curr-meridiem') setCurrFocusDescriber('timewheel-curr-meridiem');\n },\n trackFocusPicker,\n trackFocusFirstSegment,\n trackFocusLastSegment,\n handleComponentBlurs,\n }),\n [\n latestInteractionRegion,\n currFocusDescriber,\n trackFocusResetter,\n trackFocusPicker,\n trackFocusFirstSegment,\n trackFocusLastSegment,\n handleComponentBlurs,\n ],\n );\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACKvB,SAAS,aAAa,SAAS,gBAAgB;AAwCxC,MAAM,kBAAkB,CAAC,EAAE,SAAS,MAAM,MAAc;AAC7D,QAAM,CAAC,yBAAyB,0BAA0B,IAAI,SAAkC,EAAE;AAClG,QAAM,CAAC,oBAAoB,qBAAqB,IAAI,SAA6B,EAAE;AACnF,QAAM,EAAE,cAAc,YAAY,IAAI;AACtC,QAAM,EAAE,gBAAgB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable max-lines */\n/* eslint-disable indent */\n/* eslint-disable max-params */\n/* eslint-disable max-statements */\nimport { useCallback, useMemo, useState } from 'react';\nimport type { useGetReferences } from './useGetReferences.js';\nimport type { useGetFlags } from './useGetFlags.js';\n\ntype LatestInteractionRegion =\n | 'calendar-days'\n | 'calendar-head'\n | 'timewheel'\n | 'date-inputs'\n | 'time-inputs'\n | 'clear-btn'\n | 'picker-icon'\n | '';\ntype CurrFocusDescriber =\n | 'first-segment'\n | 'month-input'\n | 'day-input'\n | 'year-input'\n | 'hour-input'\n | 'minute-input'\n | 'meridiem-input'\n | 'last-segment'\n | 'clear-btn'\n | 'date-picker-icon'\n | 'time-picker-icon'\n | 'datetime-picker-icon'\n | 'calendar-prev-month'\n | 'calendar-next-month'\n | 'calendar-prev-year'\n | 'calendar-next-year'\n | 'calendar-metafocused-day'\n | 'timewheel-curr-hour'\n | 'timewheel-curr-minute'\n | 'timewheel-curr-meridiem'\n | '';\n\ninterface Config {\n DOMRefs: ReturnType<typeof useGetReferences>;\n flags: ReturnType<typeof useGetFlags>;\n}\nexport const useFocusTracker = ({ DOMRefs, flags }: Config) => {\n const [latestInteractionRegion, setLatestInteractionRegion] = useState<LatestInteractionRegion>('');\n const [currFocusDescriber, setCurrFocusDescriber] = useState<CurrFocusDescriber>('');\n const { firstSegment, lastSegment } = DOMRefs;\n const { isDateSelector, isTimeSelector, isControllerOnly } = flags;\n\n const trackFocusPicker = useCallback(() => {\n let picker = 'datetime-picker-icon' as CurrFocusDescriber;\n if (isDateSelector) picker = 'date-picker-icon';\n if (isTimeSelector) picker = 'time-picker-icon';\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (picker !== currFocusDescriber) setCurrFocusDescriber(picker);\n }, [currFocusDescriber, isDateSelector, isTimeSelector, latestInteractionRegion]);\n\n /*\n depending on the polymorphic props, the first segment can be:\n - month-input (when date inputs are present)\n - hour-input (when ONLY time inputs are present)\n - datetime-picker-icon (when picker is present and we are selecting both date and time)\n - date-picker-icon (when picker is present and no time selection is involved)\n - time-picker-icon (when picker is present and no date selection is involved)\n */\n const trackFocusFirstSegment = useCallback(() => {\n let region = 'date-inputs' as LatestInteractionRegion;\n if (firstSegment === 'hour-input') region = 'time-inputs';\n if (firstSegment === 'date-picker-icon') region = 'picker-icon';\n if (firstSegment === 'time-picker-icon') region = 'picker-icon';\n if (firstSegment === 'datetime-picker-icon') region = 'picker-icon';\n if (region !== latestInteractionRegion) setLatestInteractionRegion(region);\n if (firstSegment !== currFocusDescriber) setCurrFocusDescriber(firstSegment);\n }, [currFocusDescriber, firstSegment, latestInteractionRegion]);\n\n /*\n depending on the polymorphic props, the last segment can be:\n - year-input (when ONLY date inputs are present)\n - meridiem-input (when time inputs are present)\n - clear-btn (when clearable is true and there is no picker)\n - datetime-picker-icon (when picker is present and we are selecting both date and time)\n - date-picker-icon (when picker is present and no time selection is involved)\n - time-picker-icon (when picker is present and no date selection is involved)\n */\n const trackFocusLastSegment = useCallback(() => {\n let region = 'date-inputs' as LatestInteractionRegion;\n if (lastSegment === 'meridiem-input') region = 'time-inputs';\n if (lastSegment === 'clear-btn') region = 'clear-btn';\n if (lastSegment === 'date-picker-icon') region = 'picker-icon';\n if (lastSegment === 'time-picker-icon') region = 'picker-icon';\n if (lastSegment === 'datetime-picker-icon') region = 'picker-icon';\n if (region !== latestInteractionRegion) setLatestInteractionRegion(region);\n if (lastSegment !== currFocusDescriber) setCurrFocusDescriber(lastSegment);\n }, [currFocusDescriber, lastSegment, latestInteractionRegion]);\n\n const trackFocusResetter = useCallback(() => {\n if (latestInteractionRegion !== '') setLatestInteractionRegion('');\n if (currFocusDescriber !== '') setCurrFocusDescriber('');\n }, [currFocusDescriber, latestInteractionRegion]);\n\n const handleComponentBlurs = useCallback(\n (e: React.FocusEvent<HTMLElement>) => {\n /**\n * In controller only mode, we want to reset the focus tracker when the user moves focus outside of the component\n * this is because in controller only mode we don't have a portal that we need to account for,\n * so any blur event that happens when we are in controller only mode should be treated as a user moving focus outside of the component\n */\n if (isControllerOnly) {\n const relatedTarget = e.relatedTarget as HTMLElement | null;\n if (relatedTarget && (e.currentTarget as HTMLElement).contains(relatedTarget)) {\n return;\n }\n trackFocusResetter();\n return;\n }\n /* our code base is trying to avoid side-effects and we also try to be imperative\n due to how \"portals\" work, when we open a portal the \"blur\" event is triggered\n we need to distinguish between\n - a blur that is caused by a portal opening\n vs\n - a blur that is caused by a user moving focus to another element\n we can do this by checking the currFocusDescriber and latestInteractionRegion\n we know that blur is triggered by portal opening when:\n - latestInteractionRegion === 'calendar-days' && currFocusDescriber === 'calendar-metafocused-day'\n (this is the case when we open the calendar or calendarWithTimeWheel with a preselected date)\n - latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-prev-month'\n (this is the case when we open the calendar or calendarWithTimeWheel without a preselected date)\n - latestInteractionRegion === 'timewheel' && currFocusDescriber === 'timewheel-curr-hour'\n (this is the case when we open any timewheel ONLY)\n */\n let shouldShortCircuit = false;\n // preselected date OR filled date value OR onCalendarOpenFocusedDay is present\n if (latestInteractionRegion === 'calendar-days' && currFocusDescriber === 'calendar-metafocused-day')\n shouldShortCircuit = true;\n // empty date value AND no onCalendarOpenFocusedDay is present\n if (latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-prev-month')\n shouldShortCircuit = true;\n\n // only time wheel is present in the contextual region\n if (latestInteractionRegion === 'timewheel' && currFocusDescriber === 'timewheel-curr-hour')\n shouldShortCircuit = true;\n\n if (shouldShortCircuit) return;\n trackFocusResetter();\n },\n [currFocusDescriber, isControllerOnly, latestInteractionRegion, trackFocusResetter],\n );\n\n return useMemo(\n () => ({\n latestInteractionRegion,\n setLatestInteractionRegion,\n currFocusDescriber,\n setCurrFocusDescriber,\n trackFocusResetter,\n trackFocusMonthInput: () => {\n if (latestInteractionRegion !== 'date-inputs') setLatestInteractionRegion('date-inputs');\n if (currFocusDescriber !== 'month-input') setCurrFocusDescriber('month-input');\n },\n trackFocusDayInput: () => {\n if (latestInteractionRegion !== 'date-inputs') setLatestInteractionRegion('date-inputs');\n if (currFocusDescriber !== 'day-input') setCurrFocusDescriber('day-input');\n },\n trackFocusYearInput: () => {\n if (latestInteractionRegion !== 'date-inputs') setLatestInteractionRegion('date-inputs');\n if (currFocusDescriber !== 'year-input') setCurrFocusDescriber('year-input');\n },\n trackFocusHourInput: () => {\n if (latestInteractionRegion !== 'time-inputs') setLatestInteractionRegion('time-inputs');\n if (currFocusDescriber !== 'hour-input') setCurrFocusDescriber('hour-input');\n },\n trackFocusMinuteInput: () => {\n if (latestInteractionRegion !== 'time-inputs') setLatestInteractionRegion('time-inputs');\n if (currFocusDescriber !== 'minute-input') setCurrFocusDescriber('minute-input');\n },\n trackFocusMeridiemInput: () => {\n if (latestInteractionRegion !== 'time-inputs') setLatestInteractionRegion('time-inputs');\n if (currFocusDescriber !== 'meridiem-input') setCurrFocusDescriber('meridiem-input');\n },\n trackFocusClearBtn: () => {\n if (latestInteractionRegion !== 'clear-btn') setLatestInteractionRegion('clear-btn');\n if (currFocusDescriber !== 'clear-btn') setCurrFocusDescriber('clear-btn');\n },\n trackFocusDatePickerIcon: () => {\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (currFocusDescriber !== 'date-picker-icon') setCurrFocusDescriber('date-picker-icon');\n },\n trackFocusTimePickerIcon: () => {\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (currFocusDescriber !== 'time-picker-icon') setCurrFocusDescriber('time-picker-icon');\n },\n trackFocusDatetimePickerIcon: () => {\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (currFocusDescriber !== 'datetime-picker-icon') setCurrFocusDescriber('datetime-picker-icon');\n },\n trackFocusCalendarPrevMonth: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-prev-month') setCurrFocusDescriber('calendar-prev-month');\n },\n trackFocusCalendarNextMonth: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-next-month') setCurrFocusDescriber('calendar-next-month');\n },\n trackFocusCalendarPrevYear: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-prev-year') setCurrFocusDescriber('calendar-prev-year');\n },\n trackFocusCalendarNextYear: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-next-year') setCurrFocusDescriber('calendar-next-year');\n },\n trackFocusCalendarMetafocusedDay: () => {\n if (latestInteractionRegion !== 'calendar-days') setLatestInteractionRegion('calendar-days');\n if (currFocusDescriber !== 'calendar-metafocused-day') setCurrFocusDescriber('calendar-metafocused-day');\n },\n trackFocusTimewheelCurrHour: () => {\n if (latestInteractionRegion !== 'timewheel') setLatestInteractionRegion('timewheel');\n if (currFocusDescriber !== 'timewheel-curr-hour') setCurrFocusDescriber('timewheel-curr-hour');\n },\n trackFocusTimewheelCurrMinute: () => {\n if (latestInteractionRegion !== 'timewheel') setLatestInteractionRegion('timewheel');\n if (currFocusDescriber !== 'timewheel-curr-minute') setCurrFocusDescriber('timewheel-curr-minute');\n },\n trackFocusTimewheelCurrMeridiem: () => {\n if (latestInteractionRegion !== 'timewheel') setLatestInteractionRegion('timewheel');\n if (currFocusDescriber !== 'timewheel-curr-meridiem') setCurrFocusDescriber('timewheel-curr-meridiem');\n },\n trackFocusPicker,\n trackFocusFirstSegment,\n trackFocusLastSegment,\n handleComponentBlurs,\n }),\n [\n latestInteractionRegion,\n currFocusDescriber,\n trackFocusResetter,\n trackFocusPicker,\n trackFocusFirstSegment,\n trackFocusLastSegment,\n handleComponentBlurs,\n ],\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACKvB,SAAS,aAAa,SAAS,gBAAgB;AAwCxC,MAAM,kBAAkB,CAAC,EAAE,SAAS,MAAM,MAAc;AAC7D,QAAM,CAAC,yBAAyB,0BAA0B,IAAI,SAAkC,EAAE;AAClG,QAAM,CAAC,oBAAoB,qBAAqB,IAAI,SAA6B,EAAE;AACnF,QAAM,EAAE,cAAc,YAAY,IAAI;AACtC,QAAM,EAAE,gBAAgB,gBAAgB,iBAAiB,IAAI;AAE7D,QAAM,mBAAmB,YAAY,MAAM;AACzC,QAAI,SAAS;AACb,QAAI,eAAgB,UAAS;AAC7B,QAAI,eAAgB,UAAS;AAC7B,QAAI,4BAA4B,cAAe,4BAA2B,aAAa;AACvF,QAAI,WAAW,mBAAoB,uBAAsB,MAAM;AAAA,EACjE,GAAG,CAAC,oBAAoB,gBAAgB,gBAAgB,u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A;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -22,7 +22,7 @@ const Day = ({ metaDay, colIndex, isInvisible }) => {
|
|
|
22
22
|
handleChangeComposedDateString,
|
|
23
23
|
dateStringFromProps,
|
|
24
24
|
getProps,
|
|
25
|
-
props: { preventCloseOnSelection, readOnly, applyAriaDisabled },
|
|
25
|
+
props: { preventCloseOnSelection, readOnly, applyAriaDisabled, lastElementRef },
|
|
26
26
|
getIsDisabledDay,
|
|
27
27
|
getIsOutOfRangeDay,
|
|
28
28
|
getIsStartRangeDay,
|
|
@@ -35,16 +35,24 @@ const Day = ({ metaDay, colIndex, isInvisible }) => {
|
|
|
35
35
|
isWithTimeWheelToo,
|
|
36
36
|
trackFocusCalendarMetafocusedDay,
|
|
37
37
|
fromDate,
|
|
38
|
-
toDate
|
|
38
|
+
toDate,
|
|
39
|
+
isControllerOnly
|
|
39
40
|
} = useContext(ControlledDateTimePickerContext);
|
|
40
41
|
const { read, LiveRegion } = useLiveRegion({});
|
|
41
|
-
const { focusedDay, handleDayOnKeyDown, handleFocusMetaDayByDay, closeCalendar } = useContext(CalendarContext);
|
|
42
|
+
const { focusedDay, daysArray, handleDayOnKeyDown, handleFocusMetaDayByDay, closeCalendar } = useContext(CalendarContext);
|
|
42
43
|
const isFocusedMetaDay = focusedDay?.day ? compareTwoDatesDayEquality(metaDay?.day, focusedDay?.day) : false;
|
|
44
|
+
const firstCurrMonthDay = useMemo(() => daysArray.find((metaMonthDay) => metaMonthDay.isCurrMonthDay), [daysArray]);
|
|
45
|
+
const isFirstCurrMonthFallback = useMemo(() => {
|
|
46
|
+
if (!isControllerOnly) return false;
|
|
47
|
+
if (focusedDay?.day) return false;
|
|
48
|
+
if (!firstCurrMonthDay?.day) return false;
|
|
49
|
+
return compareTwoDatesDayEquality(day, firstCurrMonthDay.day);
|
|
50
|
+
}, [isControllerOnly, focusedDay?.day, firstCurrMonthDay?.day, day]);
|
|
43
51
|
const isSelected = useMemo(() => {
|
|
44
52
|
const selectedDate = getDayFromDateString(dateStringFromProps);
|
|
45
53
|
return selectedDate ? isSameDateMoment(day, selectedDate) : false;
|
|
46
54
|
}, [dateStringFromProps, day]);
|
|
47
|
-
const isFocused = latestInteractionRegion === "calendar-days" && isFocusedMetaDay;
|
|
55
|
+
const isFocused = latestInteractionRegion === "calendar-days" && (isFocusedMetaDay || isFirstCurrMonthFallback);
|
|
48
56
|
const isDisabled = getIsDisabledDay(metaDay.dayAsString);
|
|
49
57
|
const isOutOfRange = getIsOutOfRangeDay(metaDay.dayAsString);
|
|
50
58
|
const isStartRangeDay = getIsStartRangeDay(metaDay.dayAsString);
|
|
@@ -103,9 +111,12 @@ const Day = ({ metaDay, colIndex, isInvisible }) => {
|
|
|
103
111
|
window.requestAnimationFrame(() => {
|
|
104
112
|
dayBtnRef.current = ButtonDomNode;
|
|
105
113
|
if (isFocused) ButtonDomNode?.focus?.();
|
|
114
|
+
if (lastElementRef && isControllerOnly && (isFocusedMetaDay || isFirstCurrMonthFallback)) {
|
|
115
|
+
lastElementRef.current = ButtonDomNode;
|
|
116
|
+
}
|
|
106
117
|
});
|
|
107
118
|
},
|
|
108
|
-
[dayBtnRef, isFocused]
|
|
119
|
+
[dayBtnRef, lastElementRef, isFocused, isFocusedMetaDay, isControllerOnly, isFirstCurrMonthFallback]
|
|
109
120
|
);
|
|
110
121
|
const handleOnDayFocus = useCallback(() => {
|
|
111
122
|
trackFocusCalendarMetafocusedDay();
|
|
@@ -163,7 +174,7 @@ const Day = ({ metaDay, colIndex, isInvisible }) => {
|
|
|
163
174
|
handleDayOnKeyDown(e, metaDay);
|
|
164
175
|
},
|
|
165
176
|
innerRef: handleInnerRef,
|
|
166
|
-
tabIndex: -1,
|
|
177
|
+
tabIndex: isControllerOnly && (isFocusedMetaDay || isFirstCurrMonthFallback) ? 0 : -1,
|
|
167
178
|
"data-isfocused": isFocused,
|
|
168
179
|
"data-testid": dataTestid,
|
|
169
180
|
type: "button",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/Pickers/Calendar/Day.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport { useLiveRegion } from '@elliemae/ds-accessibility';\nimport React, { useCallback, useContext, useMemo } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../constants/index.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport type { DSControlledDateTimePickerT } from '../../../react-desc-prop-types.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../../sharedTypes.js';\nimport { defaultMetaInfo, weekDays } from '../../../utils/constants.js';\nimport {\n compareTwoDatesDayEquality,\n getDateStringFromDay,\n getDateValuesFromDate,\n getDayFromDateString,\n isSameDateMoment,\n} from '../../../utils/dateHelpers.js';\nimport { getAriaDayFromDateString } from '../../../utils/stringHelpers.js';\nimport { CalendarContext } from './CalendarContext.js';\nimport { StyledDayBtn } from './Styleds.js';\n\ninterface CalendarDayPropsT {\n metaDay: DSControlledDateTimePickerInternalsT.MetaMonthDay;\n colIndex?: number;\n isInvisible?: boolean;\n}\nconst displayNone = { display: 'none' };\n\nexport const Day = ({ metaDay, colIndex, isInvisible }: CalendarDayPropsT): JSX.Element => {\n const { day, isCurrMonthDay, isHidden, dayBtnRef, dayAsString } = metaDay;\n const {\n handleChangeComposedDateString,\n dateStringFromProps,\n getProps,\n props: { preventCloseOnSelection, readOnly, applyAriaDisabled },\n getIsDisabledDay,\n getIsOutOfRangeDay,\n getIsStartRangeDay,\n getIsDayInRange,\n getIsEndRangeDay,\n appOnMonthChange,\n appOnDayChange,\n appOnYearChange,\n latestInteractionRegion,\n isWithTimeWheelToo,\n trackFocusCalendarMetafocusedDay,\n fromDate,\n toDate,\n } = useContext(ControlledDateTimePickerContext);\n const { read, LiveRegion } = useLiveRegion({});\n\n const { focusedDay, handleDayOnKeyDown, handleFocusMetaDayByDay, closeCalendar } = useContext(CalendarContext);\n const isFocusedMetaDay = focusedDay?.day ? compareTwoDatesDayEquality(metaDay?.day, focusedDay?.day) : false;\n const isSelected = useMemo(() => {\n const selectedDate = getDayFromDateString(dateStringFromProps);\n return selectedDate ? isSameDateMoment(day, selectedDate) : false;\n }, [dateStringFromProps, day]);\n const isFocused = latestInteractionRegion === 'calendar-days' && isFocusedMetaDay;\n const isDisabled = getIsDisabledDay(metaDay.dayAsString);\n const isOutOfRange = getIsOutOfRangeDay(metaDay.dayAsString);\n const isStartRangeDay = getIsStartRangeDay(metaDay.dayAsString);\n const isEndRangeDay = getIsEndRangeDay(metaDay.dayAsString);\n const isDayInRangeImproper = getIsDayInRange(metaDay.dayAsString);\n const isDayInRange = !isStartRangeDay && !isEndRangeDay && isDayInRangeImproper;\n\n const dayAriaLabel = useMemo(\n () => `${getAriaDayFromDateString(dayAsString)}, ${weekDays[metaDay.day.getDay()]}`,\n [dayAsString, metaDay],\n );\n\n const rangeSelectionAnnouncement = useMemo(() => {\n if (fromDate && toDate) {\n if (fromDate === toDate) return `Please select another day to complete range selection.`;\n return `Range from ${fromDate} to ${toDate} selected.`;\n }\n if (fromDate && !toDate) return `Please select another day to complete range selection.`;\n return '';\n }, [fromDate, toDate]);\n\n const handleOnDayClick = useCallback(\n (e: DSControlledDateTimePickerT.OnInternalValuesChangeEvent) => {\n handleFocusMetaDayByDay(day);\n if (!isDisabled && !isOutOfRange && !readOnly && !applyAriaDisabled) {\n const newDateString = getDateStringFromDay(day);\n const metaInfo = { ...defaultMetaInfo, newDateString };\n const { month, day: dayNumber, year } = getDateValuesFromDate(day);\n appOnMonthChange(`${month + 1}`, e, metaInfo);\n if (dayNumber) appOnDayChange(`${dayNumber}`, e, metaInfo);\n appOnYearChange(`${year}`, e, metaInfo);\n handleChangeComposedDateString(newDateString, metaInfo);\n trackFocusCalendarMetafocusedDay();\n if (!isWithTimeWheelToo && !preventCloseOnSelection) closeCalendar();\n read(`${dayAriaLabel} selected.`, {});\n }\n },\n [\n handleFocusMetaDayByDay,\n day,\n isDisabled,\n isOutOfRange,\n readOnly,\n applyAriaDisabled,\n appOnMonthChange,\n appOnDayChange,\n appOnYearChange,\n handleChangeComposedDateString,\n trackFocusCalendarMetafocusedDay,\n isWithTimeWheelToo,\n preventCloseOnSelection,\n closeCalendar,\n read,\n dayAriaLabel,\n ],\n );\n\n const handleInnerRef = useCallback(\n (ButtonDomNode: HTMLButtonElement) => {\n window.requestAnimationFrame(() => {\n dayBtnRef.current = ButtonDomNode;\n if (isFocused) ButtonDomNode?.focus?.();\n });\n },\n [dayBtnRef, isFocused],\n );\n\n const handleOnDayFocus = useCallback(() => {\n trackFocusCalendarMetafocusedDay();\n }, [trackFocusCalendarMetafocusedDay]);\n\n const dayClassModifiers = useMemo(\n () =>\n `dayWrapper ${isSelected ? 'selectedDay ' : ''}${isDisabled ? 'disabledDay ' : ''}${\n isOutOfRange ? 'outOfRangeDay ' : ''\n }${isFocused ? 'focusedDay ' : ''}${isStartRangeDay ? 'startRangeDay ' : ''}${\n isDayInRangeImproper ? 'inRangeImproperDay ' : ''\n }${isDayInRange ? 'inRangeDay ' : ''}${isEndRangeDay ? 'endRangeDay ' : ''}${\n isCurrMonthDay ? '' : 'notCurrentMonth'\n }\n ${readOnly || applyAriaDisabled ? 'readOnly' : ''}`,\n [\n isSelected,\n isDisabled,\n isOutOfRange,\n isFocused,\n isStartRangeDay,\n isDayInRangeImproper,\n isDayInRange,\n isEndRangeDay,\n isCurrMonthDay,\n readOnly,\n applyAriaDisabled,\n ],\n );\n\n let dataTestid: (typeof ControlledDateTimePickerDatatestid)['CALENDAR'][keyof (typeof ControlledDateTimePickerDatatestid)['CALENDAR']] =\n ControlledDateTimePickerDatatestid.CALENDAR.DAY;\n\n if (isSelected) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.SELECTED_DAY;\n if (isFocused) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.FOCUSED_DAY;\n if (isFocused && isSelected) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.SELECTED_FOCUSED_DAY;\n if (isStartRangeDay) {\n dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.START_RANGE_DAY;\n if (isFocused) read(`${dayAriaLabel} selected. ${rangeSelectionAnnouncement}`, {});\n }\n if (isEndRangeDay) {\n dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.END_RANGE_DAY;\n if (isFocused) read(`${dayAriaLabel} selected. ${rangeSelectionAnnouncement}`, {});\n }\n if (isDayInRange) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.IN_RANGE_DAY;\n\n return (\n <div\n className={dayClassModifiers}\n style={isHidden ? displayNone : undefined}\n role=\"gridcell\"\n {...(Number.isInteger(colIndex) && { 'aria-colindex': colIndex })}\n >\n <StyledDayBtn\n aria-label={dayAriaLabel}\n aria-disabled={isOutOfRange || isDisabled || readOnly || applyAriaDisabled}\n applyAriaDisabled={applyAriaDisabled}\n aria-hidden={!!isInvisible}\n buttonType=\"raw\"\n size=\"m\"\n onClick={handleOnDayClick} // DSButton triggers this with \"spacebar\" and \"enter\" too...\n onFocus={handleOnDayFocus}\n onKeyDown={(e: React.KeyboardEvent<Element>) => {\n handleDayOnKeyDown(e, metaDay);\n }}\n innerRef={handleInnerRef}\n tabIndex={-1}\n data-isfocused={isFocused}\n data-testid={dataTestid}\n type=\"button\"\n getOwnerProps={getProps}\n readOnlyStyles={readOnly || applyAriaDisabled}\n >\n {`${day.getDate()}`}\n </StyledDayBtn>\n <LiveRegion />\n </div>\n );\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport { useLiveRegion } from '@elliemae/ds-accessibility';\nimport React, { useCallback, useContext, useMemo } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../constants/index.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport type { DSControlledDateTimePickerT } from '../../../react-desc-prop-types.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../../sharedTypes.js';\nimport { defaultMetaInfo, weekDays } from '../../../utils/constants.js';\nimport {\n compareTwoDatesDayEquality,\n getDateStringFromDay,\n getDateValuesFromDate,\n getDayFromDateString,\n isSameDateMoment,\n} from '../../../utils/dateHelpers.js';\nimport { getAriaDayFromDateString } from '../../../utils/stringHelpers.js';\nimport { CalendarContext } from './CalendarContext.js';\nimport { StyledDayBtn } from './Styleds.js';\n\ninterface CalendarDayPropsT {\n metaDay: DSControlledDateTimePickerInternalsT.MetaMonthDay;\n colIndex?: number;\n isInvisible?: boolean;\n}\nconst displayNone = { display: 'none' };\n\nexport const Day = ({ metaDay, colIndex, isInvisible }: CalendarDayPropsT): JSX.Element => {\n const { day, isCurrMonthDay, isHidden, dayBtnRef, dayAsString } = metaDay;\n const {\n handleChangeComposedDateString,\n dateStringFromProps,\n getProps,\n props: { preventCloseOnSelection, readOnly, applyAriaDisabled, lastElementRef },\n getIsDisabledDay,\n getIsOutOfRangeDay,\n getIsStartRangeDay,\n getIsDayInRange,\n getIsEndRangeDay,\n appOnMonthChange,\n appOnDayChange,\n appOnYearChange,\n latestInteractionRegion,\n isWithTimeWheelToo,\n trackFocusCalendarMetafocusedDay,\n fromDate,\n toDate,\n isControllerOnly,\n } = useContext(ControlledDateTimePickerContext);\n const { read, LiveRegion } = useLiveRegion({});\n\n const { focusedDay, daysArray, handleDayOnKeyDown, handleFocusMetaDayByDay, closeCalendar } =\n useContext(CalendarContext);\n const isFocusedMetaDay = focusedDay?.day ? compareTwoDatesDayEquality(metaDay?.day, focusedDay?.day) : false;\n /*\n * PUI-18077 https://jira.elliemae.io/browse/PUI-18077\n *\n * Fallback logic that mirrors the behavior in:\n * ./useKeyboardHandlers.tsx (tryToFocusDayRegion)\n *\n * When opening the calendar without an explicit focusedDay, this ensures that\n * in controller-only mode, Shift+Tab from the first focusable element focuses\n * the first current-month day instead of the previous month button.\n *\n * Once focusedDay is established, this fallback is no longer used.\n */\n const firstCurrMonthDay = useMemo(() => daysArray.find((metaMonthDay) => metaMonthDay.isCurrMonthDay), [daysArray]);\n const isFirstCurrMonthFallback = useMemo(() => {\n if (!isControllerOnly) return false;\n if (focusedDay?.day) return false;\n if (!firstCurrMonthDay?.day) return false;\n return compareTwoDatesDayEquality(day, firstCurrMonthDay.day);\n }, [isControllerOnly, focusedDay?.day, firstCurrMonthDay?.day, day]);\n const isSelected = useMemo(() => {\n const selectedDate = getDayFromDateString(dateStringFromProps);\n return selectedDate ? isSameDateMoment(day, selectedDate) : false;\n }, [dateStringFromProps, day]);\n const isFocused = latestInteractionRegion === 'calendar-days' && (isFocusedMetaDay || isFirstCurrMonthFallback);\n const isDisabled = getIsDisabledDay(metaDay.dayAsString);\n const isOutOfRange = getIsOutOfRangeDay(metaDay.dayAsString);\n const isStartRangeDay = getIsStartRangeDay(metaDay.dayAsString);\n const isEndRangeDay = getIsEndRangeDay(metaDay.dayAsString);\n const isDayInRangeImproper = getIsDayInRange(metaDay.dayAsString);\n const isDayInRange = !isStartRangeDay && !isEndRangeDay && isDayInRangeImproper;\n\n const dayAriaLabel = useMemo(\n () => `${getAriaDayFromDateString(dayAsString)}, ${weekDays[metaDay.day.getDay()]}`,\n [dayAsString, metaDay],\n );\n\n const rangeSelectionAnnouncement = useMemo(() => {\n if (fromDate && toDate) {\n if (fromDate === toDate) return `Please select another day to complete range selection.`;\n return `Range from ${fromDate} to ${toDate} selected.`;\n }\n if (fromDate && !toDate) return `Please select another day to complete range selection.`;\n return '';\n }, [fromDate, toDate]);\n\n const handleOnDayClick = useCallback(\n (e: DSControlledDateTimePickerT.OnInternalValuesChangeEvent) => {\n handleFocusMetaDayByDay(day);\n if (!isDisabled && !isOutOfRange && !readOnly && !applyAriaDisabled) {\n const newDateString = getDateStringFromDay(day);\n const metaInfo = { ...defaultMetaInfo, newDateString };\n const { month, day: dayNumber, year } = getDateValuesFromDate(day);\n appOnMonthChange(`${month + 1}`, e, metaInfo);\n if (dayNumber) appOnDayChange(`${dayNumber}`, e, metaInfo);\n appOnYearChange(`${year}`, e, metaInfo);\n handleChangeComposedDateString(newDateString, metaInfo);\n trackFocusCalendarMetafocusedDay();\n if (!isWithTimeWheelToo && !preventCloseOnSelection) closeCalendar();\n read(`${dayAriaLabel} selected.`, {});\n }\n },\n [\n handleFocusMetaDayByDay,\n day,\n isDisabled,\n isOutOfRange,\n readOnly,\n applyAriaDisabled,\n appOnMonthChange,\n appOnDayChange,\n appOnYearChange,\n handleChangeComposedDateString,\n trackFocusCalendarMetafocusedDay,\n isWithTimeWheelToo,\n preventCloseOnSelection,\n closeCalendar,\n read,\n dayAriaLabel,\n ],\n );\n\n const handleInnerRef = useCallback(\n (ButtonDomNode: HTMLButtonElement) => {\n window.requestAnimationFrame(() => {\n dayBtnRef.current = ButtonDomNode;\n if (isFocused) ButtonDomNode?.focus?.();\n /**\n * PUI-17922 https://jira.elliemae.io/browse/PUI-17922\n *\n * This allows consumers to plug this calendar into an external\n * focus trap by exposing the last focusable element through\n * `lastElementRef`.\n *\n * In the currently known scenarios (DSDataTable filters) that\n * last element is the day that is focused in the calendar when\n * the component is used in `controller-only` mode.\n *\n * Since this is a targeted bug fix, it is only applied for this\n * case for now (YAGNI). In the future we should review, for each\n * component configuration, which element should really be exposed\n * as `lastElementRef`.\n */\n if (lastElementRef && isControllerOnly && (isFocusedMetaDay || isFirstCurrMonthFallback)) {\n lastElementRef.current = ButtonDomNode;\n }\n });\n },\n [dayBtnRef, lastElementRef, isFocused, isFocusedMetaDay, isControllerOnly, isFirstCurrMonthFallback],\n );\n\n const handleOnDayFocus = useCallback(() => {\n trackFocusCalendarMetafocusedDay();\n }, [trackFocusCalendarMetafocusedDay]);\n\n const dayClassModifiers = useMemo(\n () =>\n `dayWrapper ${isSelected ? 'selectedDay ' : ''}${isDisabled ? 'disabledDay ' : ''}${\n isOutOfRange ? 'outOfRangeDay ' : ''\n }${isFocused ? 'focusedDay ' : ''}${isStartRangeDay ? 'startRangeDay ' : ''}${\n isDayInRangeImproper ? 'inRangeImproperDay ' : ''\n }${isDayInRange ? 'inRangeDay ' : ''}${isEndRangeDay ? 'endRangeDay ' : ''}${\n isCurrMonthDay ? '' : 'notCurrentMonth'\n }\n ${readOnly || applyAriaDisabled ? 'readOnly' : ''}`,\n [\n isSelected,\n isDisabled,\n isOutOfRange,\n isFocused,\n isStartRangeDay,\n isDayInRangeImproper,\n isDayInRange,\n isEndRangeDay,\n isCurrMonthDay,\n readOnly,\n applyAriaDisabled,\n ],\n );\n\n let dataTestid: (typeof ControlledDateTimePickerDatatestid)['CALENDAR'][keyof (typeof ControlledDateTimePickerDatatestid)['CALENDAR']] =\n ControlledDateTimePickerDatatestid.CALENDAR.DAY;\n\n if (isSelected) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.SELECTED_DAY;\n if (isFocused) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.FOCUSED_DAY;\n if (isFocused && isSelected) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.SELECTED_FOCUSED_DAY;\n if (isStartRangeDay) {\n dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.START_RANGE_DAY;\n if (isFocused) read(`${dayAriaLabel} selected. ${rangeSelectionAnnouncement}`, {});\n }\n if (isEndRangeDay) {\n dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.END_RANGE_DAY;\n if (isFocused) read(`${dayAriaLabel} selected. ${rangeSelectionAnnouncement}`, {});\n }\n if (isDayInRange) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.IN_RANGE_DAY;\n\n return (\n <div\n className={dayClassModifiers}\n style={isHidden ? displayNone : undefined}\n role=\"gridcell\"\n {...(Number.isInteger(colIndex) && { 'aria-colindex': colIndex })}\n >\n <StyledDayBtn\n aria-label={dayAriaLabel}\n aria-disabled={isOutOfRange || isDisabled || readOnly || applyAriaDisabled}\n applyAriaDisabled={applyAriaDisabled}\n aria-hidden={!!isInvisible}\n buttonType=\"raw\"\n size=\"m\"\n onClick={handleOnDayClick} // DSButton triggers this with \"spacebar\" and \"enter\" too...\n onFocus={handleOnDayFocus}\n onKeyDown={(e: React.KeyboardEvent<Element>) => {\n handleDayOnKeyDown(e, metaDay);\n }}\n innerRef={handleInnerRef}\n /**\n * PUI-17432 https://jira.elliemae.io/browse/PUI-17432\n *\n * We tried to avoid this in PUI-17922 by adding `lastElementRef`.\n * That works when the last element is focused programmatically by useFocusTrap logic,\n * but when going through the calendar and the last element is within another\n * component, on Shift+Tab the focus goes to the next month instead of the\n * last focused or selected day.\n *\n * This ensures that when using controller-only mode, focus moves back to the\n * last focused day.\n */\n tabIndex={isControllerOnly && (isFocusedMetaDay || isFirstCurrMonthFallback) ? 0 : -1}\n data-isfocused={isFocused}\n data-testid={dataTestid}\n type=\"button\"\n getOwnerProps={getProps}\n readOnlyStyles={readOnly || applyAriaDisabled}\n >\n {`${day.getDate()}`}\n </StyledDayBtn>\n <LiveRegion />\n </div>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACmNnB,SAME,KANF;AAhNJ,SAAS,qBAAqB;AAC9B,SAAgB,aAAa,YAAY,eAAe;AACxD,SAAS,0CAA0C;AACnD,SAAS,uCAAuC;AAGhD,SAAS,iBAAiB,gBAAgB;AAC1C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,gCAAgC;AACzC,SAAS,uBAAuB;AAChC,SAAS,oBAAoB;AAO7B,MAAM,cAAc,EAAE,SAAS,OAAO;AAE/B,MAAM,MAAM,CAAC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,EACnF;AACA,MAAI,eAAe;AACjB,iBAAa,mCAAmC,SAAS;AACzD,QAAI,UAAW,MAAK,GAAG,YAAY,cAAc,0BAA0B,IAAI,CAAC,CAAC;AAAA,EACnF;AACA,MAAI,aAAc,cAAa,mCAAmC,SAAS;AAE3E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,MACX,OAAO,WAAW,cAAc;AAAA,MAChC,MAAK;AAAA,MACJ,GAAI,OAAO,UAAU,QAAQ,KAAK,EAAE,iBAAiB,SAAS;AAAA,MAE/D;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,cAAY;AAAA,YACZ,iBAAe,gBAAgB,cAAc,YAAY;AAAA,YACzD;AAAA,YACA,eAAa,CAAC,CAAC;AAAA,YACf,YAAW;AAAA,YACX,MAAK;AAAA,YACL,SAAS;AAAA,YACT,SAAS;AAAA,YACT,WAAW,CAAC,MAAoC;AAC9C,iCAAmB,GAAG,OAAO;AAAA,YAC/B;AAAA,YACA,UAAU;AAAA,YAaV,UAAU,qBAAqB,oBAAoB,4BAA4B,IAAI;AAAA,YACnF,kBAAgB;AAAA,YAChB,eAAa;AAAA,YACb,MAAK;AAAA,YACL,eAAe;AAAA,YACf,gBAAgB,YAAY;AAAA,YAE3B,aAAG,IAAI,QAAQ,CAAC;AAAA;AAAA,QACnB;AAAA,QACA,oBAAC,cAAW;AAAA;AAAA;AAAA,EACd;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -96,6 +96,9 @@ const propTypes = {
|
|
|
96
96
|
"data-testid": PropTypes.string.description("Unique id for tests.").defaultValue(""),
|
|
97
97
|
...getPropsPerDatatestIdPropTypes(ControlledDateTimePickerDatatestid),
|
|
98
98
|
innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description("inner ref for the month input"),
|
|
99
|
+
lastElementRef: PropTypes.oneOfType([PropTypes.object]).description(
|
|
100
|
+
"ref for the last focusable element in the component based on its configuration, used for focus management in focus trap logic"
|
|
101
|
+
),
|
|
99
102
|
fromDate: PropTypes.string.description(
|
|
100
103
|
`Strictly formatted string representing user's selected "from" date, this prop comes from the DateRangePicker and it's used internally for the range selection announcement`
|
|
101
104
|
),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport {\n PropTypes,\n getPropsPerDatatestIdPropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n type GlobalAttributesT,\n type ValidationMap,\n type XstyledProps,\n} from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type React from 'react';\nimport type { FORM_DATE_TIME_PICKER_SLOTS } from './constants/index.js';\nimport {\n ControlledDateTimePickerDatatestid,\n DSControlledDateTimePickerName,\n DSControlledDateTimePickerSlotsFlatten,\n} from './constants/index.js';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = (): void => {};\nconst defaultReturnFalse = (): false => false;\n\nexport declare namespace DSControlledDateTimePickerT {\n export type SlotFunctionArguments = {\n dsControlleddatetimepickerRoot: () => object;\n dsControlleddatetimepickerTimePickerMonthInput: () => object;\n dsControlleddatetimepickerTimePickerDayInput: () => object;\n dsControlleddatetimepickerTimePickerYearInput: () => object;\n dsControlleddatetimepickerTimePickerHourInput: () => object;\n dsControlleddatetimepickerTimePickerMinuteInput: () => object;\n dsControlleddatetimepickerTimePickerMeridiemInput: () => object;\n dsControlleddatetimepickerCalendarTriggerIcon: () => object;\n dsControlleddatetimepickerTimewheelTriggerIcon: () => object;\n dsControlleddatetimepickerCalendarTimewheelTriggerIcon: () => object;\n dsControlleddatetimepickerCalendarDay: () => object;\n dsControlleddatetimepickerCalendarHeaderLabel: () => object;\n dsControlleddatetimepickerCalendarHeaderButtons: () => object;\n dsControlleddatetimepickerCalendarHeaderWeeklyDayList: () => object;\n dsControlleddatetimepickerTimewheelTimeButton: () => object;\n dsControlleddatetimepickerTimewheelTimeChangeButton: () => object;\n dsControlleddatetimepickerTimewheelHeaderLabel: () => object;\n dsControlleddatetimepickerCalendarContextContentWrapper: () => object;\n dsControlleddatetimepickerTimewheelContextContentWrapper: () => object;\n dsControlleddatetimepickerCalendarTimewheelContextContentWrapper: () => object;\n dsControlleddatetimepickerCalendarContextFooter: () => object;\n dsControlleddatetimepickerTimewheelContextFooter: () => object;\n dsControlleddatetimepickerCalendarTimewheelContextFooter: () => object;\n dsControlleddatetimepickerCalendarControllerWrapper: () => object;\n dsControlleddatetimepickerTimewheelControllerWrapper: () => object;\n dsControlleddatetimepickerCalendarTimewheelControllerWrapper: () => object;\n dsControlleddatetimepickerClearBtn: () => object;\n };\n\n type PropsT<Default, Required, Optional, SpecificHTMLElement> = Partial<Default> &\n Required &\n Optional &\n TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSControlledDateTimePickerName,\n typeof FORM_DATE_TIME_PICKER_SLOTS\n > &\n Omit<GlobalAttributesT<SpecificHTMLElement>, keyof Default | keyof Required | keyof Optional> &\n Omit<XstyledProps, keyof Default | keyof Required | keyof Optional>;\n\n type InternalPropsT<Default, Required, Optional, SpecificHTMLElement> = Default &\n Required &\n Optional &\n TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSControlledDateTimePickerName,\n typeof FORM_DATE_TIME_PICKER_SLOTS\n > &\n Omit<GlobalAttributesT<SpecificHTMLElement>, keyof Default | keyof Required | keyof Optional> &\n Omit<XstyledProps, keyof Default | keyof Required | keyof Optional>;\n type DataTestIdType = typeof ControlledDateTimePickerDatatestid;\n // typescript type that rapresents the union of all the values for ControlledDateTimePickerDatatestid\n export type FlatDataTestIdValues = {\n [K in keyof DataTestIdType]: DataTestIdType[K] extends Record<string, unknown>\n ? DataTestIdType[K][keyof DataTestIdType[K]] // this is only 1 level deep, but it's enough for our needs right now\n : // can be extended to more levels if needed as follows:\n // ? DataTestIdType[K][keyof DataTestIdType[K]] extends Record<string, unknown>\n // ? DataTestIdType[K][keyof DataTestIdType[K]][keyof DataTestIdType[K][keyof DataTestIdType[K]]]\n // : DataTestIdType[K][keyof DataTestIdType[K]]\n DataTestIdType[K];\n }[keyof DataTestIdType];\n\n export type OnInternalValuesChangeEvent =\n | React.ChangeEvent<HTMLInputElement>\n | React.KeyboardEvent<HTMLInputElement>\n | React.KeyboardEvent<HTMLButtonElement>\n | React.KeyboardEvent\n | React.MouseEvent<HTMLInputElement>\n | React.MouseEvent<HTMLButtonElement>\n | React.MouseEvent<HTMLDivElement>;\n\n export type ControlTypes =\n | 'full-date-time'\n | 'date-time-inputs'\n | 'date-time-picker'\n | 'date-time-picker-controller-only'\n | 'full-date'\n | 'date-inputs'\n | 'date-picker'\n | 'date-picker-controller-only'\n | 'full-time'\n | 'time-inputs'\n | 'time-picker'\n | 'time-picker-controller-only';\n export interface InternalInputsChangeMetaInfo {\n isAutomaticFillTrigger?: boolean;\n isDayPresentInMonth?: boolean;\n isOutOfRangeDay?: boolean;\n isDisabledDay?: boolean;\n isDisabledTime?: boolean;\n suggestedErrorMsg?: string;\n newDateTimeString?: string;\n newDateString?: string;\n newTimeString?: string;\n }\n\n export type OnDateChange = (val: string, metaInfo: InternalInputsChangeMetaInfo) => void;\n export type OnTimeChange = (val: string, metaInfo: InternalInputsChangeMetaInfo) => void;\n export type OnDateTimeChange = (val: string, metaInfo: InternalInputsChangeMetaInfo) => void;\n export type OnInternalInputsChange = (\n val: string,\n e: OnInternalValuesChangeEvent,\n metaInfo?: InternalInputsChangeMetaInfo,\n ) => void;\n export type AppOnInputChange = (\n val: string,\n e: OnInternalValuesChangeEvent,\n metaInfo: InternalInputsChangeMetaInfo,\n ) => void;\n\n /* ------------------------ ------------------ ------------------------*/\n /* ------------------------ DATE CONFIGURATION ------------------------*/\n /* ------------------------ ------------------ ------------------------*/\n export interface DefaultDateProps {\n onMonthChange: AppOnInputChange;\n onDayChange: AppOnInputChange;\n onYearChange: AppOnInputChange;\n onPickerOpen: TypescriptHelpersT.VoidGenericFunc;\n onPickerClose: TypescriptHelpersT.VoidGenericFunc;\n getIsDisabledDay: TypescriptHelpersT.BooleanGetter<string>;\n getIsOutOfRangeDay: TypescriptHelpersT.BooleanGetter<string>;\n getIsStartRangeDay: TypescriptHelpersT.BooleanGetter<string>;\n getIsDayInRange: TypescriptHelpersT.BooleanGetter<string>;\n getIsEndRangeDay: TypescriptHelpersT.BooleanGetter<string>;\n isClearable: boolean;\n disabled: boolean;\n readOnly: boolean;\n hasError: boolean;\n autoFocus: boolean;\n preventCloseOnSelection: boolean;\n }\n export interface OptionalDatePickerProps\n extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSControlledDateTimePickerName,\n typeof DSControlledDateTimePickerSlotsFlatten\n > {\n applyAriaDisabled?: boolean;\n emptyPickerStartingMonth?: string;\n onCalendarOpenFocusedDay?: string;\n pickerFooterMsg?: string;\n innerRef?:\n | React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null>\n | ((ref: HTMLInputElement | HTMLButtonElement | null) => void);\n tabIndex?: TypescriptHelpersT.WCAGTabIndex;\n fromDate?: string;\n toDate?: string;\n }\n export interface RequiredDatePickerProps {\n type: 'full-date' | 'date-inputs' | 'date-picker' | 'date-picker-controller-only';\n date: string;\n onDateChange: OnDateChange;\n }\n export type DatePickerProps = PropsT<\n Partial<DefaultDateProps>,\n RequiredDatePickerProps,\n OptionalDatePickerProps,\n HTMLDivElement\n >;\n\n export type InternalDatePickerProps = InternalPropsT<\n DefaultDateProps,\n RequiredDatePickerProps,\n OptionalDatePickerProps,\n HTMLDivElement\n >;\n\n /* ------------------------ ------------------ ------------------------*/\n /* ------------------------ TIME CONFIGURATION ------------------------*/\n /* ------------------------ ------------------ ------------------------*/\n\n export interface DefaultTimeProps {\n onHourChange: AppOnInputChange;\n onMinuteChange: AppOnInputChange;\n onMeridiemChange: AppOnInputChange;\n onPickerOpen: TypescriptHelpersT.VoidGenericFunc;\n onPickerClose: TypescriptHelpersT.VoidGenericFunc;\n getIsDisabledTime: TypescriptHelpersT.BooleanGetter<string>;\n minutesInterval: number;\n isClearable: boolean;\n disabled: boolean;\n readOnly: boolean;\n hasError: boolean;\n autoFocus: boolean;\n preventCloseOnSelection: boolean;\n }\n export interface OptionalTimePickerProps\n extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSControlledDateTimePickerName,\n typeof DSControlledDateTimePickerSlotsFlatten\n > {\n applyAriaDisabled?: boolean;\n pickerFooterMsg?: string;\n onTimeWheelOpenStartingTime?: string;\n innerRef?:\n | React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null>\n | ((ref: HTMLInputElement | HTMLButtonElement | null) => void);\n tabIndex?: TypescriptHelpersT.WCAGTabIndex;\n }\n export interface RequiredTimePickerProps {\n type: 'full-time' | 'time-inputs' | 'time-picker' | 'time-picker-controller-only';\n time: string;\n onTimeChange: OnTimeChange;\n }\n export type TimePickerProps = PropsT<\n Partial<DefaultTimeProps>,\n RequiredTimePickerProps,\n OptionalTimePickerProps,\n HTMLDivElement\n >;\n\n export type InternalTimePickerProps = InternalPropsT<\n DefaultTimeProps,\n RequiredTimePickerProps,\n OptionalTimePickerProps,\n HTMLDivElement\n >;\n\n /* -------------------- ---------------------- ------------------------*/\n /* -------------------- DATETIME CONFIGURATION ------------------------*/\n /* -------------------- ---------------------- ------------------------*/\n\n export type DefaultDateTimeProps = DefaultTimeProps &\n DefaultDateProps & {\n onDateChange: OnDateChange;\n onTimeChange: OnTimeChange;\n };\n export type OptionalDateTimeProps = OptionalTimePickerProps &\n OptionalDatePickerProps &\n TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSControlledDateTimePickerName,\n typeof DSControlledDateTimePickerSlotsFlatten\n >;\n export interface RequiredDateTimeProps {\n type: 'full-date-time' | 'date-time-inputs' | 'date-time-picker' | 'date-time-picker-controller-only';\n dateTime: string;\n onDateTimeChange: OnDateTimeChange;\n }\n\n export type DateTimePickerProps = PropsT<\n Partial<DefaultDateTimeProps>,\n RequiredDateTimeProps,\n OptionalDateTimeProps,\n HTMLDivElement\n >;\n export type InternalDateTimePickerProps = InternalPropsT<\n DefaultDateTimeProps,\n RequiredDateTimeProps,\n OptionalDateTimeProps,\n HTMLDivElement\n >;\n\n /* ---------------------- ------------------- -------------------------*/\n /* ---------------------- FINAL CONFIGURATION -------------------------*/\n /* ---------------------- ------------------- -------------------------*/\n export type DefaultProps = DefaultDateTimeProps & { type: 'full-date-time' };\n\n export type Props = DateTimePickerProps | DatePickerProps | TimePickerProps;\n export type InternalProps = InternalDateTimePickerProps | InternalDatePickerProps | InternalTimePickerProps;\n}\n\nexport const defaultProps: DSControlledDateTimePickerT.DefaultProps = {\n type: 'full-date-time',\n onDateChange: noop,\n onMonthChange: noop,\n onDayChange: noop,\n onYearChange: noop,\n onTimeChange: noop,\n onHourChange: noop,\n onMinuteChange: noop,\n onMeridiemChange: noop,\n onPickerOpen: noop,\n onPickerClose: noop,\n getIsDisabledDay: defaultReturnFalse,\n getIsOutOfRangeDay: defaultReturnFalse,\n getIsStartRangeDay: defaultReturnFalse,\n getIsDayInRange: defaultReturnFalse,\n getIsEndRangeDay: defaultReturnFalse,\n getIsDisabledTime: defaultReturnFalse,\n minutesInterval: 1,\n isClearable: false,\n disabled: false,\n readOnly: false,\n hasError: false,\n autoFocus: false,\n preventCloseOnSelection: false,\n};\n\nexport const propTypes = {\n ...getPropsPerSlotPropTypes(DSControlledDateTimePickerName, DSControlledDateTimePickerSlotsFlatten),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n type: PropTypes.oneOf([\n 'full-date-time',\n 'date-time-inputs',\n 'date-time-picker',\n 'date-time-picker-controller-only',\n 'full-date',\n 'date-inputs',\n 'date-picker',\n 'date-picker-controller-only',\n 'full-time',\n 'time-inputs',\n 'time-picker',\n 'time-picker-controller-only',\n ])\n .description('Type of time form control to use')\n .defaultValue('full-date-time'),\n disabled: PropTypes.bool.description('wheter or not the input is disabled').defaultValue(false),\n applyAriaDisabled: PropTypes.bool.description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION.',\n ),\n readOnly: PropTypes.bool\n .description('Makes the component non-editable while remaining accessible')\n .defaultValue(false),\n isClearable: PropTypes.bool.description('with or without clearable button').defaultValue(false),\n dateTime: PropTypes.string.description('when using date-time types, this is the value of the controller'),\n date: PropTypes.string.description('when using date types, this is the value of the controller'),\n time: PropTypes.string.description('when using time types, this is the value of the controller'),\n onDateChange: PropTypes.func.description('(newDateString, metaInformations) => void'),\n onTimeChange: PropTypes.func.description('(newTimeString, metaInformations) => void'),\n onDateTimeChange: PropTypes.func.description('(newDateTimeString, metaInformations) => void'),\n onMonthChange: PropTypes.func.description('(newMonthString, event, metaInformations) => void'),\n onDayChange: PropTypes.func.description('(newDayString, event, metaInformations) => void'),\n onYearChange: PropTypes.func.description('(newYearString, event, metaInformations) => void'),\n onHourChange: PropTypes.func.description('(newHourString, event, metaInformations) => void'),\n onMinuteChange: PropTypes.func.description('(newMinuteString, event, metaInformations) => void'),\n onMeridiemChange: PropTypes.func.description('(newMeridiemString, event, metaInformations) => void'),\n getIsDisabledDay: PropTypes.func.description(\n '(dayAsString) => true for marking as disabled, false for marking as valid',\n ),\n getIsOutOfRangeDay: PropTypes.func.description(\n '(dayAsString) => true for marking as disabled, false for marking as valid',\n ),\n getIsDisabledTime: PropTypes.func.description(\n '(timeAsString) => true for marking as disabled, false for marking as valid',\n ),\n emptyPickerStartingMonth: PropTypes.string.description(\n 'which month to start the calendar on open, when value is empty, string following the \"MM/__/YYYY\" pattern',\n ),\n onCalendarOpenFocusedDay: PropTypes.string\n .description('which day to focus on calendar open when value is empty, string following the \"MM/DD/YYYY\" pattern')\n .defaultValue('if value is empty current month, else current month'),\n onTimeWheelOpenStartingTime: PropTypes.string\n .description(\n 'which day to start the timewheel on picker open when value is empty, string following the HH:MM AA\" pattern',\n )\n .defaultValue('01:00 AM'),\n minutesInterval: PropTypes.number\n .description('increments/decrements of minutes in time related controllers interactions')\n .defaultValue('1'),\n 'data-testid': PropTypes.string.description('Unique id for tests.').defaultValue(''),\n ...getPropsPerDatatestIdPropTypes(ControlledDateTimePickerDatatestid),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('inner ref for the month input'),\n fromDate: PropTypes.string.description(\n `Strictly formatted string representing user's selected \"from\" date, this prop comes from the DateRangePicker and it's used internally for the range selection announcement`,\n ),\n toDate: PropTypes.string.description(\n `Strictly formatted string representing user's selected \"to\" date, this prop comes from the DateRangePicker and it's used internally for the range selection announcement`,\n ),\n hasError: PropTypes.bool.description('whether the input has error or not').defaultValue(false),\n} as unknown as ValidationMap<DSControlledDateTimePickerT.Props>;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACCvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAIP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,MAAM,OAAO,MAAY;AAAC;AAC1B,MAAM,qBAAqB,MAAa;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport {\n PropTypes,\n getPropsPerDatatestIdPropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n type GlobalAttributesT,\n type ValidationMap,\n type XstyledProps,\n} from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type React from 'react';\nimport type { FORM_DATE_TIME_PICKER_SLOTS } from './constants/index.js';\nimport {\n ControlledDateTimePickerDatatestid,\n DSControlledDateTimePickerName,\n DSControlledDateTimePickerSlotsFlatten,\n} from './constants/index.js';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = (): void => {};\nconst defaultReturnFalse = (): false => false;\n\nexport declare namespace DSControlledDateTimePickerT {\n export type SlotFunctionArguments = {\n dsControlleddatetimepickerRoot: () => object;\n dsControlleddatetimepickerTimePickerMonthInput: () => object;\n dsControlleddatetimepickerTimePickerDayInput: () => object;\n dsControlleddatetimepickerTimePickerYearInput: () => object;\n dsControlleddatetimepickerTimePickerHourInput: () => object;\n dsControlleddatetimepickerTimePickerMinuteInput: () => object;\n dsControlleddatetimepickerTimePickerMeridiemInput: () => object;\n dsControlleddatetimepickerCalendarTriggerIcon: () => object;\n dsControlleddatetimepickerTimewheelTriggerIcon: () => object;\n dsControlleddatetimepickerCalendarTimewheelTriggerIcon: () => object;\n dsControlleddatetimepickerCalendarDay: () => object;\n dsControlleddatetimepickerCalendarHeaderLabel: () => object;\n dsControlleddatetimepickerCalendarHeaderButtons: () => object;\n dsControlleddatetimepickerCalendarHeaderWeeklyDayList: () => object;\n dsControlleddatetimepickerTimewheelTimeButton: () => object;\n dsControlleddatetimepickerTimewheelTimeChangeButton: () => object;\n dsControlleddatetimepickerTimewheelHeaderLabel: () => object;\n dsControlleddatetimepickerCalendarContextContentWrapper: () => object;\n dsControlleddatetimepickerTimewheelContextContentWrapper: () => object;\n dsControlleddatetimepickerCalendarTimewheelContextContentWrapper: () => object;\n dsControlleddatetimepickerCalendarContextFooter: () => object;\n dsControlleddatetimepickerTimewheelContextFooter: () => object;\n dsControlleddatetimepickerCalendarTimewheelContextFooter: () => object;\n dsControlleddatetimepickerCalendarControllerWrapper: () => object;\n dsControlleddatetimepickerTimewheelControllerWrapper: () => object;\n dsControlleddatetimepickerCalendarTimewheelControllerWrapper: () => object;\n dsControlleddatetimepickerClearBtn: () => object;\n };\n\n type PropsT<Default, Required, Optional, SpecificHTMLElement> = Partial<Default> &\n Required &\n Optional &\n TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSControlledDateTimePickerName,\n typeof FORM_DATE_TIME_PICKER_SLOTS\n > &\n Omit<GlobalAttributesT<SpecificHTMLElement>, keyof Default | keyof Required | keyof Optional> &\n Omit<XstyledProps, keyof Default | keyof Required | keyof Optional>;\n\n type InternalPropsT<Default, Required, Optional, SpecificHTMLElement> = Default &\n Required &\n Optional &\n TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSControlledDateTimePickerName,\n typeof FORM_DATE_TIME_PICKER_SLOTS\n > &\n Omit<GlobalAttributesT<SpecificHTMLElement>, keyof Default | keyof Required | keyof Optional> &\n Omit<XstyledProps, keyof Default | keyof Required | keyof Optional>;\n type DataTestIdType = typeof ControlledDateTimePickerDatatestid;\n // typescript type that rapresents the union of all the values for ControlledDateTimePickerDatatestid\n export type FlatDataTestIdValues = {\n [K in keyof DataTestIdType]: DataTestIdType[K] extends Record<string, unknown>\n ? DataTestIdType[K][keyof DataTestIdType[K]] // this is only 1 level deep, but it's enough for our needs right now\n : // can be extended to more levels if needed as follows:\n // ? DataTestIdType[K][keyof DataTestIdType[K]] extends Record<string, unknown>\n // ? DataTestIdType[K][keyof DataTestIdType[K]][keyof DataTestIdType[K][keyof DataTestIdType[K]]]\n // : DataTestIdType[K][keyof DataTestIdType[K]]\n DataTestIdType[K];\n }[keyof DataTestIdType];\n\n export type OnInternalValuesChangeEvent =\n | React.ChangeEvent<HTMLInputElement>\n | React.KeyboardEvent<HTMLInputElement>\n | React.KeyboardEvent<HTMLButtonElement>\n | React.KeyboardEvent\n | React.MouseEvent<HTMLInputElement>\n | React.MouseEvent<HTMLButtonElement>\n | React.MouseEvent<HTMLDivElement>;\n\n export type ControlTypes =\n | 'full-date-time'\n | 'date-time-inputs'\n | 'date-time-picker'\n | 'date-time-picker-controller-only'\n | 'full-date'\n | 'date-inputs'\n | 'date-picker'\n | 'date-picker-controller-only'\n | 'full-time'\n | 'time-inputs'\n | 'time-picker'\n | 'time-picker-controller-only';\n export interface InternalInputsChangeMetaInfo {\n isAutomaticFillTrigger?: boolean;\n isDayPresentInMonth?: boolean;\n isOutOfRangeDay?: boolean;\n isDisabledDay?: boolean;\n isDisabledTime?: boolean;\n suggestedErrorMsg?: string;\n newDateTimeString?: string;\n newDateString?: string;\n newTimeString?: string;\n }\n\n export type OnDateChange = (val: string, metaInfo: InternalInputsChangeMetaInfo) => void;\n export type OnTimeChange = (val: string, metaInfo: InternalInputsChangeMetaInfo) => void;\n export type OnDateTimeChange = (val: string, metaInfo: InternalInputsChangeMetaInfo) => void;\n export type OnInternalInputsChange = (\n val: string,\n e: OnInternalValuesChangeEvent,\n metaInfo?: InternalInputsChangeMetaInfo,\n ) => void;\n export type AppOnInputChange = (\n val: string,\n e: OnInternalValuesChangeEvent,\n metaInfo: InternalInputsChangeMetaInfo,\n ) => void;\n\n /* ------------------------ ------------------ ------------------------*/\n /* ------------------------ DATE CONFIGURATION ------------------------*/\n /* ------------------------ ------------------ ------------------------*/\n export interface DefaultDateProps {\n onMonthChange: AppOnInputChange;\n onDayChange: AppOnInputChange;\n onYearChange: AppOnInputChange;\n onPickerOpen: TypescriptHelpersT.VoidGenericFunc;\n onPickerClose: TypescriptHelpersT.VoidGenericFunc;\n getIsDisabledDay: TypescriptHelpersT.BooleanGetter<string>;\n getIsOutOfRangeDay: TypescriptHelpersT.BooleanGetter<string>;\n getIsStartRangeDay: TypescriptHelpersT.BooleanGetter<string>;\n getIsDayInRange: TypescriptHelpersT.BooleanGetter<string>;\n getIsEndRangeDay: TypescriptHelpersT.BooleanGetter<string>;\n isClearable: boolean;\n disabled: boolean;\n readOnly: boolean;\n hasError: boolean;\n autoFocus: boolean;\n preventCloseOnSelection: boolean;\n }\n export interface OptionalDatePickerProps\n extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSControlledDateTimePickerName,\n typeof DSControlledDateTimePickerSlotsFlatten\n > {\n applyAriaDisabled?: boolean;\n emptyPickerStartingMonth?: string;\n onCalendarOpenFocusedDay?: string;\n pickerFooterMsg?: string;\n innerRef?:\n | React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null>\n | ((ref: HTMLInputElement | HTMLButtonElement | null) => void);\n lastElementRef?: React.MutableRefObject<HTMLElement | null>;\n tabIndex?: TypescriptHelpersT.WCAGTabIndex;\n fromDate?: string;\n toDate?: string;\n }\n export interface RequiredDatePickerProps {\n type: 'full-date' | 'date-inputs' | 'date-picker' | 'date-picker-controller-only';\n date: string;\n onDateChange: OnDateChange;\n }\n export type DatePickerProps = PropsT<\n Partial<DefaultDateProps>,\n RequiredDatePickerProps,\n OptionalDatePickerProps,\n HTMLDivElement\n >;\n\n export type InternalDatePickerProps = InternalPropsT<\n DefaultDateProps,\n RequiredDatePickerProps,\n OptionalDatePickerProps,\n HTMLDivElement\n >;\n\n /* ------------------------ ------------------ ------------------------*/\n /* ------------------------ TIME CONFIGURATION ------------------------*/\n /* ------------------------ ------------------ ------------------------*/\n\n export interface DefaultTimeProps {\n onHourChange: AppOnInputChange;\n onMinuteChange: AppOnInputChange;\n onMeridiemChange: AppOnInputChange;\n onPickerOpen: TypescriptHelpersT.VoidGenericFunc;\n onPickerClose: TypescriptHelpersT.VoidGenericFunc;\n getIsDisabledTime: TypescriptHelpersT.BooleanGetter<string>;\n minutesInterval: number;\n isClearable: boolean;\n disabled: boolean;\n readOnly: boolean;\n hasError: boolean;\n autoFocus: boolean;\n preventCloseOnSelection: boolean;\n }\n export interface OptionalTimePickerProps\n extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSControlledDateTimePickerName,\n typeof DSControlledDateTimePickerSlotsFlatten\n > {\n applyAriaDisabled?: boolean;\n pickerFooterMsg?: string;\n onTimeWheelOpenStartingTime?: string;\n innerRef?:\n | React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null>\n | ((ref: HTMLInputElement | HTMLButtonElement | null) => void);\n lastElementRef?: React.MutableRefObject<HTMLElement | null>;\n tabIndex?: TypescriptHelpersT.WCAGTabIndex;\n }\n export interface RequiredTimePickerProps {\n type: 'full-time' | 'time-inputs' | 'time-picker' | 'time-picker-controller-only';\n time: string;\n onTimeChange: OnTimeChange;\n }\n export type TimePickerProps = PropsT<\n Partial<DefaultTimeProps>,\n RequiredTimePickerProps,\n OptionalTimePickerProps,\n HTMLDivElement\n >;\n\n export type InternalTimePickerProps = InternalPropsT<\n DefaultTimeProps,\n RequiredTimePickerProps,\n OptionalTimePickerProps,\n HTMLDivElement\n >;\n\n /* -------------------- ---------------------- ------------------------*/\n /* -------------------- DATETIME CONFIGURATION ------------------------*/\n /* -------------------- ---------------------- ------------------------*/\n\n export type DefaultDateTimeProps = DefaultTimeProps &\n DefaultDateProps & {\n onDateChange: OnDateChange;\n onTimeChange: OnTimeChange;\n };\n export type OptionalDateTimeProps = OptionalTimePickerProps &\n OptionalDatePickerProps &\n TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSControlledDateTimePickerName,\n typeof DSControlledDateTimePickerSlotsFlatten\n >;\n export interface RequiredDateTimeProps {\n type: 'full-date-time' | 'date-time-inputs' | 'date-time-picker' | 'date-time-picker-controller-only';\n dateTime: string;\n onDateTimeChange: OnDateTimeChange;\n }\n\n export type DateTimePickerProps = PropsT<\n Partial<DefaultDateTimeProps>,\n RequiredDateTimeProps,\n OptionalDateTimeProps,\n HTMLDivElement\n >;\n export type InternalDateTimePickerProps = InternalPropsT<\n DefaultDateTimeProps,\n RequiredDateTimeProps,\n OptionalDateTimeProps,\n HTMLDivElement\n >;\n\n /* ---------------------- ------------------- -------------------------*/\n /* ---------------------- FINAL CONFIGURATION -------------------------*/\n /* ---------------------- ------------------- -------------------------*/\n export type DefaultProps = DefaultDateTimeProps & { type: 'full-date-time' };\n\n export type Props = DateTimePickerProps | DatePickerProps | TimePickerProps;\n export type InternalProps = InternalDateTimePickerProps | InternalDatePickerProps | InternalTimePickerProps;\n}\n\nexport const defaultProps: DSControlledDateTimePickerT.DefaultProps = {\n type: 'full-date-time',\n onDateChange: noop,\n onMonthChange: noop,\n onDayChange: noop,\n onYearChange: noop,\n onTimeChange: noop,\n onHourChange: noop,\n onMinuteChange: noop,\n onMeridiemChange: noop,\n onPickerOpen: noop,\n onPickerClose: noop,\n getIsDisabledDay: defaultReturnFalse,\n getIsOutOfRangeDay: defaultReturnFalse,\n getIsStartRangeDay: defaultReturnFalse,\n getIsDayInRange: defaultReturnFalse,\n getIsEndRangeDay: defaultReturnFalse,\n getIsDisabledTime: defaultReturnFalse,\n minutesInterval: 1,\n isClearable: false,\n disabled: false,\n readOnly: false,\n hasError: false,\n autoFocus: false,\n preventCloseOnSelection: false,\n};\n\nexport const propTypes = {\n ...getPropsPerSlotPropTypes(DSControlledDateTimePickerName, DSControlledDateTimePickerSlotsFlatten),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n type: PropTypes.oneOf([\n 'full-date-time',\n 'date-time-inputs',\n 'date-time-picker',\n 'date-time-picker-controller-only',\n 'full-date',\n 'date-inputs',\n 'date-picker',\n 'date-picker-controller-only',\n 'full-time',\n 'time-inputs',\n 'time-picker',\n 'time-picker-controller-only',\n ])\n .description('Type of time form control to use')\n .defaultValue('full-date-time'),\n disabled: PropTypes.bool.description('wheter or not the input is disabled').defaultValue(false),\n applyAriaDisabled: PropTypes.bool.description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION.',\n ),\n readOnly: PropTypes.bool\n .description('Makes the component non-editable while remaining accessible')\n .defaultValue(false),\n isClearable: PropTypes.bool.description('with or without clearable button').defaultValue(false),\n dateTime: PropTypes.string.description('when using date-time types, this is the value of the controller'),\n date: PropTypes.string.description('when using date types, this is the value of the controller'),\n time: PropTypes.string.description('when using time types, this is the value of the controller'),\n onDateChange: PropTypes.func.description('(newDateString, metaInformations) => void'),\n onTimeChange: PropTypes.func.description('(newTimeString, metaInformations) => void'),\n onDateTimeChange: PropTypes.func.description('(newDateTimeString, metaInformations) => void'),\n onMonthChange: PropTypes.func.description('(newMonthString, event, metaInformations) => void'),\n onDayChange: PropTypes.func.description('(newDayString, event, metaInformations) => void'),\n onYearChange: PropTypes.func.description('(newYearString, event, metaInformations) => void'),\n onHourChange: PropTypes.func.description('(newHourString, event, metaInformations) => void'),\n onMinuteChange: PropTypes.func.description('(newMinuteString, event, metaInformations) => void'),\n onMeridiemChange: PropTypes.func.description('(newMeridiemString, event, metaInformations) => void'),\n getIsDisabledDay: PropTypes.func.description(\n '(dayAsString) => true for marking as disabled, false for marking as valid',\n ),\n getIsOutOfRangeDay: PropTypes.func.description(\n '(dayAsString) => true for marking as disabled, false for marking as valid',\n ),\n getIsDisabledTime: PropTypes.func.description(\n '(timeAsString) => true for marking as disabled, false for marking as valid',\n ),\n emptyPickerStartingMonth: PropTypes.string.description(\n 'which month to start the calendar on open, when value is empty, string following the \"MM/__/YYYY\" pattern',\n ),\n onCalendarOpenFocusedDay: PropTypes.string\n .description('which day to focus on calendar open when value is empty, string following the \"MM/DD/YYYY\" pattern')\n .defaultValue('if value is empty current month, else current month'),\n onTimeWheelOpenStartingTime: PropTypes.string\n .description(\n 'which day to start the timewheel on picker open when value is empty, string following the HH:MM AA\" pattern',\n )\n .defaultValue('01:00 AM'),\n minutesInterval: PropTypes.number\n .description('increments/decrements of minutes in time related controllers interactions')\n .defaultValue('1'),\n 'data-testid': PropTypes.string.description('Unique id for tests.').defaultValue(''),\n ...getPropsPerDatatestIdPropTypes(ControlledDateTimePickerDatatestid),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('inner ref for the month input'),\n lastElementRef: PropTypes.oneOfType([PropTypes.object]).description(\n 'ref for the last focusable element in the component based on its configuration, used for focus management in focus trap logic',\n ),\n fromDate: PropTypes.string.description(\n `Strictly formatted string representing user's selected \"from\" date, this prop comes from the DateRangePicker and it's used internally for the range selection announcement`,\n ),\n toDate: PropTypes.string.description(\n `Strictly formatted string representing user's selected \"to\" date, this prop comes from the DateRangePicker and it's used internally for the range selection announcement`,\n ),\n hasError: PropTypes.bool.description('whether the input has error or not').defaultValue(false),\n} as unknown as ValidationMap<DSControlledDateTimePickerT.Props>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB;AAAA,EACE;AAAA,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zB;AAAA,EACF;AAAA,EACA,QAAQ,UAAU,OAAO;AAAA,IACvB;AAAA,EACF;AAAA,EACA,UAAU,UAAU,KAAK,YAAY,oCAAoC,EAAE,aAAa,KAAK;AAC/F;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -35,15 +35,15 @@ const announcableCardinalDays = {
|
|
|
35
35
|
18: "eighteenth",
|
|
36
36
|
19: "ninteenth",
|
|
37
37
|
20: "twentieth",
|
|
38
|
-
21: "
|
|
39
|
-
22: "
|
|
40
|
-
23: "
|
|
41
|
-
24: "
|
|
42
|
-
25: "
|
|
43
|
-
26: "
|
|
44
|
-
27: "
|
|
45
|
-
28: "
|
|
46
|
-
29: "
|
|
38
|
+
21: "twenty first",
|
|
39
|
+
22: "twenty second",
|
|
40
|
+
23: "twenty third",
|
|
41
|
+
24: "twenty fourth",
|
|
42
|
+
25: "twenty fifth",
|
|
43
|
+
26: "twenty sixth",
|
|
44
|
+
27: "twenty seventh",
|
|
45
|
+
28: "twenty eighth",
|
|
46
|
+
29: "twenty ninth",
|
|
47
47
|
30: "thirtieth",
|
|
48
48
|
31: "thirty first"
|
|
49
49
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/constants.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const weekDays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] as const;\n\nexport const monthNames = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n] as const;\n\nexport const announcableCardinalDays = {\n 1: 'first',\n 2: 'second',\n 3: 'third',\n 4: 'fourth',\n 5: 'fifth',\n 6: 'sixth',\n 7: 'seventh',\n 8: 'eighth',\n 9: 'ninth',\n 10: 'tenth',\n 11: 'eleventh',\n 12: 'twelfth',\n 13: 'thirteenth',\n 14: 'fourteenth',\n 15: 'fifteenth',\n 16: 'sixteenth',\n 17: 'seventeenth',\n 18: 'eighteenth',\n 19: 'ninteenth',\n 20: 'twentieth',\n 21: '
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const weekDays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] as const;\n\nexport const monthNames = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n] as const;\n\nexport const announcableCardinalDays = {\n 1: 'first',\n 2: 'second',\n 3: 'third',\n 4: 'fourth',\n 5: 'fifth',\n 6: 'sixth',\n 7: 'seventh',\n 8: 'eighth',\n 9: 'ninth',\n 10: 'tenth',\n 11: 'eleventh',\n 12: 'twelfth',\n 13: 'thirteenth',\n 14: 'fourteenth',\n 15: 'fifteenth',\n 16: 'sixteenth',\n 17: 'seventeenth',\n 18: 'eighteenth',\n 19: 'ninteenth',\n 20: 'twentieth',\n 21: 'twenty first',\n 22: 'twenty second',\n 23: 'twenty third',\n 24: 'twenty fourth',\n 25: 'twenty fifth',\n 26: 'twenty sixth',\n 27: 'twenty seventh',\n 28: 'twenty eighth',\n 29: 'twenty ninth',\n 30: 'thirtieth',\n 31: 'thirty first',\n} as const;\n\nexport const defaultMetaInfo = { isAutomaticFillTrigger: false };\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,WAAW,CAAC,UAAU,UAAU,WAAW,aAAa,YAAY,UAAU,UAAU;AAE9F,MAAM,aAAa;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,MAAM,0BAA0B;AAAA,EACrC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEO,MAAM,kBAAkB,EAAE,wBAAwB,MAAM;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -33,6 +33,6 @@ export declare const useFocusTracker: ({ DOMRefs, flags }: Config) => {
|
|
|
33
33
|
trackFocusPicker: () => void;
|
|
34
34
|
trackFocusFirstSegment: () => void;
|
|
35
35
|
trackFocusLastSegment: () => void;
|
|
36
|
-
handleComponentBlurs: () => void;
|
|
36
|
+
handleComponentBlurs: (e: React.FocusEvent<HTMLElement>) => void;
|
|
37
37
|
};
|
|
38
38
|
export {};
|
|
@@ -81,6 +81,7 @@ export declare namespace DSControlledDateTimePickerT {
|
|
|
81
81
|
onCalendarOpenFocusedDay?: string;
|
|
82
82
|
pickerFooterMsg?: string;
|
|
83
83
|
innerRef?: React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null> | ((ref: HTMLInputElement | HTMLButtonElement | null) => void);
|
|
84
|
+
lastElementRef?: React.MutableRefObject<HTMLElement | null>;
|
|
84
85
|
tabIndex?: TypescriptHelpersT.WCAGTabIndex;
|
|
85
86
|
fromDate?: string;
|
|
86
87
|
toDate?: string;
|
|
@@ -112,6 +113,7 @@ export declare namespace DSControlledDateTimePickerT {
|
|
|
112
113
|
pickerFooterMsg?: string;
|
|
113
114
|
onTimeWheelOpenStartingTime?: string;
|
|
114
115
|
innerRef?: React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null> | ((ref: HTMLInputElement | HTMLButtonElement | null) => void);
|
|
116
|
+
lastElementRef?: React.MutableRefObject<HTMLElement | null>;
|
|
115
117
|
tabIndex?: TypescriptHelpersT.WCAGTabIndex;
|
|
116
118
|
}
|
|
117
119
|
interface RequiredTimePickerProps {
|
|
@@ -21,15 +21,15 @@ export declare const announcableCardinalDays: {
|
|
|
21
21
|
readonly 18: "eighteenth";
|
|
22
22
|
readonly 19: "ninteenth";
|
|
23
23
|
readonly 20: "twentieth";
|
|
24
|
-
readonly 21: "
|
|
25
|
-
readonly 22: "
|
|
26
|
-
readonly 23: "
|
|
27
|
-
readonly 24: "
|
|
28
|
-
readonly 25: "
|
|
29
|
-
readonly 26: "
|
|
30
|
-
readonly 27: "
|
|
31
|
-
readonly 28: "
|
|
32
|
-
readonly 29: "
|
|
24
|
+
readonly 21: "twenty first";
|
|
25
|
+
readonly 22: "twenty second";
|
|
26
|
+
readonly 23: "twenty third";
|
|
27
|
+
readonly 24: "twenty fourth";
|
|
28
|
+
readonly 25: "twenty fifth";
|
|
29
|
+
readonly 26: "twenty sixth";
|
|
30
|
+
readonly 27: "twenty seventh";
|
|
31
|
+
readonly 28: "twenty eighth";
|
|
32
|
+
readonly 29: "twenty ninth";
|
|
33
33
|
readonly 30: "thirtieth";
|
|
34
34
|
readonly 31: "thirty first";
|
|
35
35
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-form-date-time-picker",
|
|
3
|
-
"version": "3.60.0-next.
|
|
3
|
+
"version": "3.60.0-next.41",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Controlled Form Date Time Picker",
|
|
6
6
|
"files": [
|
|
@@ -35,44 +35,43 @@
|
|
|
35
35
|
"reportFile": "tests.xml",
|
|
36
36
|
"indent": 4
|
|
37
37
|
},
|
|
38
|
-
"scripts": {
|
|
39
|
-
"dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
|
|
40
|
-
"test": "pui-cli test --passWithNoTests --coverage=\"false\"",
|
|
41
|
-
"lint": "node ../../../scripts/lint.mjs --fix",
|
|
42
|
-
"lint:strict": "node ../../../scripts/lint-strict.mjs",
|
|
43
|
-
"dts": "node ../../../scripts/dts.mjs",
|
|
44
|
-
"build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
|
|
45
|
-
"checkDeps": "npm exec ../../util/ds-codemods -- check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
|
|
46
|
-
},
|
|
47
38
|
"dependencies": {
|
|
48
|
-
"@elliemae/ds-accessibility": "3.60.0-next.
|
|
49
|
-
"@elliemae/ds-button-v2": "3.60.0-next.
|
|
50
|
-
"@elliemae/ds-
|
|
51
|
-
"@elliemae/ds-icons": "3.60.0-next.
|
|
52
|
-
"@elliemae/ds-
|
|
53
|
-
"@elliemae/ds-
|
|
54
|
-
"@elliemae/ds-
|
|
55
|
-
"@elliemae/ds-typescript-helpers": "3.60.0-next.
|
|
39
|
+
"@elliemae/ds-accessibility": "3.60.0-next.41",
|
|
40
|
+
"@elliemae/ds-button-v2": "3.60.0-next.41",
|
|
41
|
+
"@elliemae/ds-system": "3.60.0-next.41",
|
|
42
|
+
"@elliemae/ds-icons": "3.60.0-next.41",
|
|
43
|
+
"@elliemae/ds-props-helpers": "3.60.0-next.41",
|
|
44
|
+
"@elliemae/ds-grid": "3.60.0-next.41",
|
|
45
|
+
"@elliemae/ds-popperjs": "3.60.0-next.41",
|
|
46
|
+
"@elliemae/ds-typescript-helpers": "3.60.0-next.41"
|
|
56
47
|
},
|
|
57
48
|
"devDependencies": {
|
|
58
|
-
"@elliemae/
|
|
59
|
-
"@
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
49
|
+
"@elliemae/pui-theme": "~2.13.0",
|
|
50
|
+
"@playwright/experimental-ct-react": "^1.51.1",
|
|
51
|
+
"jest": "^30.0.0",
|
|
52
|
+
"styled-components": "~5.3.9",
|
|
53
|
+
"styled-system": "^5.1.5",
|
|
54
|
+
"@elliemae/ds-test-utils": "3.60.0-next.41",
|
|
55
|
+
"@elliemae/ds-monorepo-devops": "3.60.0-next.41"
|
|
65
56
|
},
|
|
66
57
|
"peerDependencies": {
|
|
67
|
-
"@elliemae/pui-theme": "
|
|
68
|
-
"react": "
|
|
69
|
-
"react-dom": "
|
|
70
|
-
"styled-components": "
|
|
71
|
-
"styled-system": "
|
|
58
|
+
"@elliemae/pui-theme": "~2.13.0",
|
|
59
|
+
"react": "^18.3.1",
|
|
60
|
+
"react-dom": "^18.3.1",
|
|
61
|
+
"styled-components": "~5.3.9",
|
|
62
|
+
"styled-system": "^5.1.5"
|
|
72
63
|
},
|
|
73
64
|
"publishConfig": {
|
|
74
65
|
"access": "public",
|
|
75
66
|
"typeSafety": false
|
|
76
67
|
},
|
|
77
|
-
"
|
|
78
|
-
|
|
68
|
+
"scripts": {
|
|
69
|
+
"dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
|
|
70
|
+
"test": "playwright test -c ./playwright.config.mjs && ds-monorepo-devops test --passWithNoTests --coverage=\"false\"",
|
|
71
|
+
"lint": "node ../../../scripts/lint.mjs --fix",
|
|
72
|
+
"lint:strict": "node ../../../scripts/lint-strict.mjs",
|
|
73
|
+
"dts": "node ../../../scripts/dts.mjs",
|
|
74
|
+
"build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
|
|
75
|
+
"checkDeps": "npx -yes ../../util/ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
|
|
76
|
+
}
|
|
77
|
+
}
|