@elliemae/ds-form-date-time-picker 3.60.0-next.57 → 3.60.0-next.58
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/index.js +1 -0
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarDaysList.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/Day.js +45 -70
- package/dist/cjs/parts/Pickers/Calendar/Day.js.map +3 -3
- package/dist/cjs/parts/Pickers/Calendar/Styleds.js +14 -7
- package/dist/cjs/parts/Pickers/Calendar/Styleds.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/useFocusLogic.js +1 -3
- package/dist/cjs/parts/Pickers/Calendar/useFocusLogic.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/useGetDayFlags.js +89 -0
- package/dist/cjs/parts/Pickers/Calendar/useGetDayFlags.js.map +7 -0
- package/dist/cjs/parts/Pickers/Calendar/useKeyboardHandlers.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js +14 -1
- package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js +21 -5
- package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js +14 -1
- package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/Styleds.js +27 -18
- package/dist/cjs/parts/Pickers/TimeWheel/Styleds.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/sharedTypes.js.map +1 -1
- package/dist/cjs/slot-arguments-polymorphic-typescript.js +28 -0
- package/dist/cjs/slot-arguments-polymorphic-typescript.js.map +7 -0
- package/dist/cjs/typescript-testing/slot-arguments-engine.js +25 -0
- package/dist/cjs/typescript-testing/slot-arguments-engine.js.map +7 -0
- package/dist/cjs/typescript-testing/slot-props.js +159 -57
- package/dist/cjs/typescript-testing/slot-props.js.map +2 -2
- package/dist/cjs/utils/dateHelpers.js.map +2 -2
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarDaysList.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/Day.js +47 -78
- package/dist/esm/parts/Pickers/Calendar/Day.js.map +3 -3
- package/dist/esm/parts/Pickers/Calendar/Styleds.js +14 -7
- package/dist/esm/parts/Pickers/Calendar/Styleds.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/useFocusLogic.js +1 -3
- package/dist/esm/parts/Pickers/Calendar/useFocusLogic.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/useGetDayFlags.js +59 -0
- package/dist/esm/parts/Pickers/Calendar/useGetDayFlags.js.map +7 -0
- package/dist/esm/parts/Pickers/Calendar/useKeyboardHandlers.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/HoursList.js +15 -2
- package/dist/esm/parts/Pickers/TimeWheel/HoursList.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js +22 -6
- package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js +15 -2
- package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/Styleds.js +27 -18
- package/dist/esm/parts/Pickers/TimeWheel/Styleds.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/slot-arguments-polymorphic-typescript.js +2 -0
- package/dist/esm/slot-arguments-polymorphic-typescript.js.map +7 -0
- package/dist/esm/typescript-testing/slot-arguments-engine.js +2 -0
- package/dist/esm/typescript-testing/slot-arguments-engine.js.map +7 -0
- package/dist/esm/typescript-testing/slot-props.js +161 -59
- package/dist/esm/typescript-testing/slot-props.js.map +2 -2
- package/dist/esm/utils/dateHelpers.js.map +2 -2
- package/dist/types/config/useGetFlags.d.ts +2 -2
- package/dist/types/config/useGetReferences.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/parts/Pickers/Calendar/CalendarDaysList.d.ts +5 -5
- package/dist/types/parts/Pickers/Calendar/Day.d.ts +2 -2
- package/dist/types/parts/Pickers/Calendar/Styleds.d.ts +1 -1
- package/dist/types/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.d.ts +6 -5
- package/dist/types/parts/Pickers/Calendar/useFocusLogic.d.ts +3 -3
- package/dist/types/parts/Pickers/Calendar/useGetDayFlags.d.ts +14 -0
- package/dist/types/parts/Pickers/Calendar/useKeyboardHandlers.d.ts +2 -2
- package/dist/types/parts/Pickers/TimeWheel/Styleds.d.ts +1 -0
- package/dist/types/react-desc-prop-types.d.ts +49 -35
- package/dist/types/sharedTypes.d.ts +0 -9
- package/dist/types/slot-arguments-polymorphic-typescript.d.ts +80 -0
- package/dist/types/typescript-testing/slot-arguments-engine.d.ts +95 -0
- package/dist/types/utils/dateHelpers.d.ts +1 -1
- package/package.json +10 -11
package/dist/cjs/index.js
CHANGED
|
@@ -37,6 +37,7 @@ __export(index_exports, {
|
|
|
37
37
|
DSControlledDateTimePickerSlotsFlatten: () => import_constants.DSControlledDateTimePickerSlotsFlatten,
|
|
38
38
|
DSControlledDateTimePickerWithSchema: () => import_ControlledDateTimePicker.DSControlledDateTimePickerWithSchema,
|
|
39
39
|
deconstructValuesFromDateString: () => import_stringHelpers.deconstructValuesFromDateString,
|
|
40
|
+
getAriaDayFromDateString: () => import_stringHelpers.getAriaDayFromDateString,
|
|
40
41
|
getDateStringFromDay: () => import_dateHelpers.getDateStringFromDay,
|
|
41
42
|
getDateValuesFromDate: () => import_dateHelpers.getDateValuesFromDate,
|
|
42
43
|
getDayFromDateString: () => import_dateHelpers.getDayFromDateString,
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export {\n ControlledDateTimePickerDatatestid,\n ControlledDateTimePickerDatatestidFlattened,\n DSControlledDateTimePickerName,\n DSControlledDateTimePickerSlots,\n DSControlledDateTimePickerSlotsFlatten,\n} from './constants/index.js';\nexport { DSControlledDateTimePicker, DSControlledDateTimePickerWithSchema } from './ControlledDateTimePicker.js';\n\nexport { CONTROLLED_DATE_TIME_PICKER_TYPES } from './constants/ControlledDateTimePickerTypes.js';\nexport { type DSControlledDateTimePickerT } from './react-desc-prop-types.js';\nexport {\n getDateStringFromDay,\n getDateValuesFromDate,\n getDayFromDateString,\n getValidationDateStringMetaInfo,\n} from './utils/dateHelpers.js';\nexport { getValidationDateTimeStringMetaInfo } from './utils/dateTimeHelpers.js';\nexport {\n deconstructValuesFromDateString,\n isValidDateString,\n isValidTimeString,\n prependStringWithPlaceHolders,\n} from './utils/stringHelpers.js';\nexport { getValidationTimeStringMetaInfo } from './utils/timeHelpers.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAMO;AACP,sCAAiF;AAEjF,2CAAkD;AAElD,yBAKO;AACP,6BAAoD;AACpD,
|
|
4
|
+
"sourcesContent": ["export {\n ControlledDateTimePickerDatatestid,\n ControlledDateTimePickerDatatestidFlattened,\n DSControlledDateTimePickerName,\n DSControlledDateTimePickerSlots,\n DSControlledDateTimePickerSlotsFlatten,\n} from './constants/index.js';\nexport { DSControlledDateTimePicker, DSControlledDateTimePickerWithSchema } from './ControlledDateTimePicker.js';\n\nexport { CONTROLLED_DATE_TIME_PICKER_TYPES } from './constants/ControlledDateTimePickerTypes.js';\nexport { type DSControlledDateTimePickerT } from './react-desc-prop-types.js';\nexport {\n getDateStringFromDay,\n getDateValuesFromDate,\n getDayFromDateString,\n getValidationDateStringMetaInfo,\n} from './utils/dateHelpers.js';\nexport { getValidationDateTimeStringMetaInfo } from './utils/dateTimeHelpers.js';\nexport {\n deconstructValuesFromDateString,\n isValidDateString,\n isValidTimeString,\n prependStringWithPlaceHolders,\n getAriaDayFromDateString,\n} from './utils/stringHelpers.js';\nexport { getValidationTimeStringMetaInfo } from './utils/timeHelpers.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAMO;AACP,sCAAiF;AAEjF,2CAAkD;AAElD,yBAKO;AACP,6BAAoD;AACpD,2BAMO;AACP,yBAAgD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Pickers/Calendar/CalendarDaysList.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { Day } from './Day.js';\nimport { StyledWeekDaysListWrapper } from './Styleds.js';\nimport type {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { Day } from './Day.js';\nimport { StyledWeekDaysListWrapper } from './Styleds.js';\nimport type { DSControlledDateTimePickerT } from '../../../react-desc-prop-types.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\n\nexport interface CalendarDaysListPropsT {\n invisibleFirstDay?: DSControlledDateTimePickerT.MetaMonthDay;\n daysMatrixByWeekday: DSControlledDateTimePickerT.MetaMonthDay[][];\n invisibleLastDay?: DSControlledDateTimePickerT.MetaMonthDay;\n innerRef: React.RefObject<HTMLDivElement>;\n}\n\nexport const CalendarDaysList = React.memo(\n ({ invisibleFirstDay, daysMatrixByWeekday, invisibleLastDay, innerRef }: CalendarDaysListPropsT): JSX.Element => {\n const { getProps } = React.useContext(ControlledDateTimePickerContext);\n\n return (\n <div ref={innerRef} role=\"rowgroup\">\n {invisibleFirstDay ? (\n <div role=\"row\" style={{ display: 'none' }}>\n <Day key={`ds-calendar-${invisibleFirstDay.day.toString()}`} metaDay={invisibleFirstDay} isInvisible />\n </div>\n ) : null}\n {daysMatrixByWeekday.map((week, i) => (\n <StyledWeekDaysListWrapper\n key={`ds-calendar-week-${week[0].day.toString()}-${week[6].day.toString()}`}\n role=\"row\"\n aria-rowindex={i + 1}\n cols={['2.4615rem', '2.4615rem', '2.4615rem', '2.4615rem', '2.4615rem', '2.4615rem', '2.4615rem']}\n rows={['2.1538rem']}\n py=\"xxxs\"\n px=\"2px\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n getOwnerProps={getProps}\n >\n {week.map((metaDay, z) => (\n <Day key={`ds-calendar-${metaDay.day.toString()}`} metaDay={metaDay} colIndex={z + 1} />\n ))}\n </StyledWeekDaysListWrapper>\n ))}\n {invisibleLastDay ? (\n <div role=\"row\" style={{ display: 'none' }}>\n <Day key={`ds-calendar-${invisibleLastDay.day.toString()}`} metaDay={invisibleLastDay} isInvisible />\n </div>\n ) : null}\n </div>\n );\n },\n);\n", "import * as React from 'react';\nexport { React };\n"],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ACE;AAAA,OACN;AAAA,EAEJ;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -33,8 +33,7 @@ __export(Day_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(Day_exports);
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
var
|
|
37
|
-
var import_react = require("react");
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
38
37
|
var import_constants = require("../../../constants/index.js");
|
|
39
38
|
var import_ControlledDateTimePickerCTX = require("../../../ControlledDateTimePickerCTX.js");
|
|
40
39
|
var import_constants2 = require("../../../utils/constants.js");
|
|
@@ -42,30 +41,21 @@ var import_dateHelpers = require("../../../utils/dateHelpers.js");
|
|
|
42
41
|
var import_stringHelpers = require("../../../utils/stringHelpers.js");
|
|
43
42
|
var import_CalendarContext = require("./CalendarContext.js");
|
|
44
43
|
var import_Styleds = require("./Styleds.js");
|
|
44
|
+
var import_useGetDayFlags = require("./useGetDayFlags.js");
|
|
45
45
|
const displayNone = { display: "none" };
|
|
46
46
|
const Day = ({ metaDay, colIndex, isInvisible }) => {
|
|
47
47
|
const { day, isCurrMonthDay, isHidden, dayBtnRef, dayAsString } = metaDay;
|
|
48
48
|
const {
|
|
49
49
|
handleChangeComposedDateString,
|
|
50
|
-
dateStringFromProps,
|
|
51
50
|
getProps,
|
|
52
51
|
props: { preventCloseOnSelection, readOnly, applyAriaDisabled, lastElementRef },
|
|
53
|
-
getIsDisabledDay,
|
|
54
|
-
getIsOutOfRangeDay,
|
|
55
|
-
getIsStartRangeDay,
|
|
56
|
-
getIsDayInRange,
|
|
57
|
-
getIsEndRangeDay,
|
|
58
52
|
appOnMonthChange,
|
|
59
53
|
appOnDayChange,
|
|
60
54
|
appOnYearChange,
|
|
61
|
-
latestInteractionRegion,
|
|
62
55
|
isWithTimeWheelToo,
|
|
63
56
|
trackFocusCalendarMetafocusedDay,
|
|
64
|
-
fromDate,
|
|
65
|
-
toDate,
|
|
66
57
|
isControllerOnly
|
|
67
58
|
} = (0, import_react.useContext)(import_ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
68
|
-
const { read, LiveRegion } = (0, import_ds_accessibility.useLiveRegion)({});
|
|
69
59
|
const { focusedDay, daysArray, handleDayOnKeyDown, handleFocusMetaDayByDay, closeCalendar } = (0, import_react.useContext)(import_CalendarContext.CalendarContext);
|
|
70
60
|
const isFocusedMetaDay = focusedDay?.day ? (0, import_dateHelpers.compareTwoDatesDayEquality)(metaDay?.day, focusedDay?.day) : false;
|
|
71
61
|
const firstCurrMonthDay = (0, import_react.useMemo)(() => daysArray.find((metaMonthDay) => metaMonthDay.isCurrMonthDay), [daysArray]);
|
|
@@ -75,29 +65,24 @@ const Day = ({ metaDay, colIndex, isInvisible }) => {
|
|
|
75
65
|
if (!firstCurrMonthDay?.day) return false;
|
|
76
66
|
return (0, import_dateHelpers.compareTwoDatesDayEquality)(day, firstCurrMonthDay.day);
|
|
77
67
|
}, [isControllerOnly, focusedDay?.day, firstCurrMonthDay?.day, day]);
|
|
78
|
-
const
|
|
79
|
-
const selectedDate = (0, import_dateHelpers.getDayFromDateString)(dateStringFromProps);
|
|
80
|
-
return selectedDate ? (0, import_dateHelpers.isSameDateMoment)(day, selectedDate) : false;
|
|
81
|
-
}, [dateStringFromProps, day]);
|
|
82
|
-
const isFocused = latestInteractionRegion === "calendar-days" && (isFocusedMetaDay || isFirstCurrMonthFallback);
|
|
83
|
-
const isDisabled = getIsDisabledDay(metaDay.dayAsString);
|
|
84
|
-
const isOutOfRange = getIsOutOfRangeDay(metaDay.dayAsString);
|
|
85
|
-
const isStartRangeDay = getIsStartRangeDay(metaDay.dayAsString);
|
|
86
|
-
const isEndRangeDay = getIsEndRangeDay(metaDay.dayAsString);
|
|
87
|
-
const isDayInRangeImproper = getIsDayInRange(metaDay.dayAsString);
|
|
88
|
-
const isDayInRange = !isStartRangeDay && !isEndRangeDay && isDayInRangeImproper;
|
|
68
|
+
const dayFlags = (0, import_useGetDayFlags.useGetDayFlags)({ metaDay, isFirstCurrMonthFallback });
|
|
89
69
|
const dayAriaLabel = (0, import_react.useMemo)(
|
|
90
70
|
() => `${(0, import_stringHelpers.getAriaDayFromDateString)(dayAsString)}, ${import_constants2.weekDays[metaDay.day.getDay()]}`,
|
|
91
71
|
[dayAsString, metaDay]
|
|
92
72
|
);
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
73
|
+
const {
|
|
74
|
+
isSelected,
|
|
75
|
+
isFocused,
|
|
76
|
+
isDisabled,
|
|
77
|
+
isOutOfRange,
|
|
78
|
+
isStartRangeDay,
|
|
79
|
+
isEndRangeDay,
|
|
80
|
+
isDayInRangeImproper,
|
|
81
|
+
isDayInRange
|
|
82
|
+
} = dayFlags;
|
|
83
|
+
const ownerPropsArguments = import_react.default.useRef({ ...dayFlags, metaDay });
|
|
84
|
+
ownerPropsArguments.current = { ...dayFlags, metaDay };
|
|
85
|
+
const getOwnerPropsArguments = import_react.default.useCallback(() => ownerPropsArguments.current, []);
|
|
101
86
|
const handleOnDayClick = (0, import_react.useCallback)(
|
|
102
87
|
(e) => {
|
|
103
88
|
handleFocusMetaDayByDay(day);
|
|
@@ -111,7 +96,6 @@ const Day = ({ metaDay, colIndex, isInvisible }) => {
|
|
|
111
96
|
handleChangeComposedDateString(newDateString, metaInfo);
|
|
112
97
|
trackFocusCalendarMetafocusedDay();
|
|
113
98
|
if (!isWithTimeWheelToo && !preventCloseOnSelection) closeCalendar();
|
|
114
|
-
read(`${dayAriaLabel} selected.`, {});
|
|
115
99
|
}
|
|
116
100
|
},
|
|
117
101
|
[
|
|
@@ -128,9 +112,7 @@ const Day = ({ metaDay, colIndex, isInvisible }) => {
|
|
|
128
112
|
trackFocusCalendarMetafocusedDay,
|
|
129
113
|
isWithTimeWheelToo,
|
|
130
114
|
preventCloseOnSelection,
|
|
131
|
-
closeCalendar
|
|
132
|
-
read,
|
|
133
|
-
dayAriaLabel
|
|
115
|
+
closeCalendar
|
|
134
116
|
]
|
|
135
117
|
);
|
|
136
118
|
const handleInnerRef = (0, import_react.useCallback)(
|
|
@@ -169,48 +151,41 @@ const Day = ({ metaDay, colIndex, isInvisible }) => {
|
|
|
169
151
|
if (isSelected) dataTestid = import_constants.ControlledDateTimePickerDatatestid.CALENDAR.SELECTED_DAY;
|
|
170
152
|
if (isFocused) dataTestid = import_constants.ControlledDateTimePickerDatatestid.CALENDAR.FOCUSED_DAY;
|
|
171
153
|
if (isFocused && isSelected) dataTestid = import_constants.ControlledDateTimePickerDatatestid.CALENDAR.SELECTED_FOCUSED_DAY;
|
|
172
|
-
if (isStartRangeDay)
|
|
173
|
-
|
|
174
|
-
if (isFocused) read(`${dayAriaLabel} selected. ${rangeSelectionAnnouncement}`, {});
|
|
175
|
-
}
|
|
176
|
-
if (isEndRangeDay) {
|
|
177
|
-
dataTestid = import_constants.ControlledDateTimePickerDatatestid.CALENDAR.END_RANGE_DAY;
|
|
178
|
-
if (isFocused) read(`${dayAriaLabel} selected. ${rangeSelectionAnnouncement}`, {});
|
|
179
|
-
}
|
|
154
|
+
if (isStartRangeDay) dataTestid = import_constants.ControlledDateTimePickerDatatestid.CALENDAR.START_RANGE_DAY;
|
|
155
|
+
if (isEndRangeDay) dataTestid = import_constants.ControlledDateTimePickerDatatestid.CALENDAR.END_RANGE_DAY;
|
|
180
156
|
if (isDayInRange) dataTestid = import_constants.ControlledDateTimePickerDatatestid.CALENDAR.IN_RANGE_DAY;
|
|
181
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.
|
|
157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
182
158
|
"div",
|
|
183
159
|
{
|
|
184
160
|
className: dayClassModifiers,
|
|
185
161
|
style: isHidden ? displayNone : void 0,
|
|
186
162
|
role: "gridcell",
|
|
187
163
|
...Number.isInteger(colIndex) && { "aria-colindex": colIndex },
|
|
188
|
-
children:
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
]
|
|
164
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
165
|
+
import_Styleds.StyledDayBtn,
|
|
166
|
+
{
|
|
167
|
+
$readOnlyStyles: readOnly || applyAriaDisabled,
|
|
168
|
+
"aria-pressed": isSelected || isStartRangeDay || isDayInRange || isEndRangeDay ? "true" : "false",
|
|
169
|
+
"aria-label": dayAriaLabel,
|
|
170
|
+
"aria-disabled": isOutOfRange || isDisabled || readOnly || applyAriaDisabled,
|
|
171
|
+
"aria-hidden": !!isInvisible,
|
|
172
|
+
buttonType: "raw",
|
|
173
|
+
size: "m",
|
|
174
|
+
onClick: handleOnDayClick,
|
|
175
|
+
onFocus: handleOnDayFocus,
|
|
176
|
+
onKeyDown: (e) => {
|
|
177
|
+
handleDayOnKeyDown(e, metaDay);
|
|
178
|
+
},
|
|
179
|
+
innerRef: handleInnerRef,
|
|
180
|
+
tabIndex: isControllerOnly && (isFocusedMetaDay || isFirstCurrMonthFallback) ? 0 : -1,
|
|
181
|
+
"data-isfocused": isFocused,
|
|
182
|
+
"data-testid": dataTestid,
|
|
183
|
+
type: "button",
|
|
184
|
+
getOwnerProps: getProps,
|
|
185
|
+
getOwnerPropsArguments,
|
|
186
|
+
children: `${day.getDate()}`
|
|
187
|
+
}
|
|
188
|
+
)
|
|
214
189
|
}
|
|
215
190
|
);
|
|
216
191
|
};
|
|
@@ -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, 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 /**\n * applyAriaDisabled is intentionally NOT passed here.\n *\n * DSButtonV2 with applyAriaDisabled suppresses the click event before onClick\n * fires. This prevents handleFocusMetaDayByDay from running, so focusedDay never\n * updates and the focus ring never appears \u2014 while keyboard navigation silently\n * anchors to the clicked position, causing offset arrow behavior.\n *\n * readOnly and applyAriaDisabled must produce the same click UX on day buttons:\n * focus moves (ring shows), value does not change. The value-change guard in\n * handleOnDayClick already covers both (!readOnly && !applyAriaDisabled).\n * aria-disabled above is already set explicitly, so AT state is unaffected.\n */\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;
|
|
6
|
-
"names": ["import_constants"]
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable complexity */\n/* eslint-disable max-lines */\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 { defaultMetaInfo, weekDays } from '../../../utils/constants.js';\nimport { compareTwoDatesDayEquality, getDateStringFromDay, getDateValuesFromDate } from '../../../utils/dateHelpers.js';\nimport { getAriaDayFromDateString } from '../../../utils/stringHelpers.js';\nimport { CalendarContext } from './CalendarContext.js';\nimport { StyledDayBtn } from './Styleds.js';\nimport { useGetDayFlags } from './useGetDayFlags.js';\n\ninterface CalendarDayPropsT {\n metaDay: DSControlledDateTimePickerT.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 getProps,\n props: { preventCloseOnSelection, readOnly, applyAriaDisabled, lastElementRef },\n appOnMonthChange,\n appOnDayChange,\n appOnYearChange,\n isWithTimeWheelToo,\n trackFocusCalendarMetafocusedDay,\n isControllerOnly,\n } = useContext(ControlledDateTimePickerContext);\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\n // the following flags are useful to be able to condition aria-* attributes via slots\n // for example, the date-range-picker can chose to apply different aria-labels to the buttons based on these flags.\n const dayFlags = useGetDayFlags({ metaDay, isFirstCurrMonthFallback });\n const dayAriaLabel = useMemo(\n () => `${getAriaDayFromDateString(dayAsString)}, ${weekDays[metaDay.day.getDay()]}`,\n [dayAsString, metaDay],\n );\n const {\n isSelected,\n isFocused,\n isDisabled,\n isOutOfRange,\n isStartRangeDay,\n isEndRangeDay,\n isDayInRangeImproper,\n isDayInRange,\n } = dayFlags;\n const ownerPropsArguments = React.useRef({ ...dayFlags, metaDay });\n ownerPropsArguments.current = { ...dayFlags, metaDay };\n const getOwnerPropsArguments = React.useCallback(() => ownerPropsArguments.current, []);\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 }\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 ],\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) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.START_RANGE_DAY;\n if (isEndRangeDay) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.END_RANGE_DAY;\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 $readOnlyStyles={readOnly || applyAriaDisabled}\n aria-pressed={isSelected || isStartRangeDay || isDayInRange || isEndRangeDay ? 'true' : 'false'}\n aria-label={dayAriaLabel}\n aria-disabled={isOutOfRange || isDisabled || readOnly || applyAriaDisabled}\n /**\n * applyAriaDisabled is intentionally NOT passed here.\n *\n * DSButtonV2 with applyAriaDisabled suppresses the click event before onClick\n * fires. This prevents handleFocusMetaDayByDay from running, so focusedDay never\n * updates and the focus ring never appears \u2014 while keyboard navigation silently\n * anchors to the clicked position, causing offset arrow behavior.\n *\n * readOnly and applyAriaDisabled must produce the same click UX on day buttons:\n * focus moves (ring shows), value does not change. The value-change guard in\n * handleOnDayClick already covers both (!readOnly && !applyAriaDisabled).\n * aria-disabled above is already set explicitly, so AT state is unaffected.\n */\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 getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {`${day.getDate()}`}\n </StyledDayBtn>\n </div>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2LjB;AAxLN,mBAAwD;AACxD,uBAAmD;AACnD,yCAAgD;AAEhD,IAAAA,oBAA0C;AAC1C,yBAAwF;AACxF,2BAAyC;AACzC,6BAAgC;AAChC,qBAA6B;AAC7B,4BAA+B;AAO/B,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,OAAO,EAAE,yBA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AA,MACnB;AAAA;AAAA,EACF;AAEJ;",
|
|
6
|
+
"names": ["import_constants", "React"]
|
|
7
7
|
}
|
|
@@ -164,8 +164,8 @@ const StyledDayBtn = (0, import_ds_system.styled)(import_ds_button_v2.DSButtonV2
|
|
|
164
164
|
line-height: 1;
|
|
165
165
|
color: ${({ theme }) => theme.colors.neutral[800]};
|
|
166
166
|
&:hover {
|
|
167
|
-
${({ theme,
|
|
168
|
-
if (
|
|
167
|
+
${({ theme, $readOnlyStyles }) => {
|
|
168
|
+
if ($readOnlyStyles) {
|
|
169
169
|
return import_ds_system.css`
|
|
170
170
|
cursor: not-allowed;
|
|
171
171
|
background-color: ${theme.colors.neutral["100"]};
|
|
@@ -175,6 +175,7 @@ const StyledDayBtn = (0, import_ds_system.styled)(import_ds_button_v2.DSButtonV2
|
|
|
175
175
|
return import_ds_system.css`
|
|
176
176
|
cursor: pointer;
|
|
177
177
|
background-color: ${theme.colors.brand["200"]};
|
|
178
|
+
color: ${theme.colors.brand[700]};
|
|
178
179
|
`;
|
|
179
180
|
}}
|
|
180
181
|
}
|
|
@@ -240,11 +241,14 @@ const StyledWeekDaysListWrapper = (0, import_ds_system.styled)(import_ds_grid.Gr
|
|
|
240
241
|
.dayWrapper.disabledDay,
|
|
241
242
|
.dayWrapper.outOfRangeDay {
|
|
242
243
|
${StyledDayBtn} {
|
|
243
|
-
color: ${({ theme }) => theme.colors.neutral[
|
|
244
|
+
color: ${({ theme }) => theme.colors.neutral[700]};
|
|
244
245
|
${diagonalLine}
|
|
245
246
|
&:before {
|
|
246
247
|
background-color: ${({ theme }) => theme.colors.neutral[500]};
|
|
247
248
|
}
|
|
249
|
+
:hover {
|
|
250
|
+
color: ${({ theme }) => theme.colors.neutral[700]};
|
|
251
|
+
}
|
|
248
252
|
}
|
|
249
253
|
&.focusedDay {
|
|
250
254
|
${StyledDayBtn} {
|
|
@@ -336,7 +340,7 @@ const StyledWeekDaysListWrapper = (0, import_ds_system.styled)(import_ds_grid.Gr
|
|
|
336
340
|
${StyledDayBtn} {
|
|
337
341
|
color: ${({ theme }) => theme.colors.neutral[700]};
|
|
338
342
|
&:before {
|
|
339
|
-
background-color: ${({ theme }) => theme.colors.
|
|
343
|
+
background-color: ${({ theme }) => theme.colors.neutral[700]};
|
|
340
344
|
}
|
|
341
345
|
&:after {
|
|
342
346
|
border: 2px solid ${({ theme }) => theme.colors.brand[700]};
|
|
@@ -348,13 +352,16 @@ const StyledWeekDaysListWrapper = (0, import_ds_system.styled)(import_ds_grid.Gr
|
|
|
348
352
|
.dayWrapper.selectedDay.disabledDay.readOnly,
|
|
349
353
|
.dayWrapper.selectedDay.outOfRangeDay.readOnly {
|
|
350
354
|
${StyledDayBtn} {
|
|
351
|
-
background-color: ${({ theme }) => theme.colors.
|
|
355
|
+
background-color: ${({ theme }) => theme.colors.neutral["500"]};
|
|
352
356
|
color: ${({ theme }) => theme.colors.neutral["000"]};
|
|
353
357
|
&:before {
|
|
354
358
|
background-color: ${({ theme }) => theme.colors.neutral["000"]};
|
|
355
359
|
}
|
|
356
360
|
:hover {
|
|
357
|
-
background-color: ${({ theme }) => theme.colors.
|
|
361
|
+
background-color: ${({ theme }) => theme.colors.neutral["700"]};
|
|
362
|
+
}
|
|
363
|
+
:focus {
|
|
364
|
+
background-color: ${({ theme }) => theme.colors.neutral["700"]};
|
|
358
365
|
}
|
|
359
366
|
}
|
|
360
367
|
}
|
|
@@ -372,7 +379,7 @@ const StyledWeekDaysListWrapper = (0, import_ds_system.styled)(import_ds_grid.Gr
|
|
|
372
379
|
&.disabledDay,
|
|
373
380
|
&.outOfRangeDay {
|
|
374
381
|
${StyledDayBtn} {
|
|
375
|
-
color: ${({ theme }) => theme.colors.
|
|
382
|
+
color: ${({ theme }) => theme.colors.brand[600]};
|
|
376
383
|
}
|
|
377
384
|
|
|
378
385
|
&.inRangeDay,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Pickers/Calendar/Styleds.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { Grid } from '@elliemae/ds-grid';\nimport { css, styled } from '@elliemae/ds-system';\nimport { DSControlledDateTimePickerName, DSControlledDateTimePickerSlots } from '../../../constants/index.js';\n\nconst diagonalLine = css`\n &:before {\n position: absolute;\n content: '';\n top: 48%;\n left: -2px;\n height: 1px;\n width: calc(100% + 4px);\n transform: rotate(45deg);\n background-color: ${({ theme }) => theme.colors.neutral[500]};\n }\n`;\n\nconst focusBorder = css`\n &:after {\n position: absolute;\n content: '';\n top: -4px;\n left: -4px;\n width: calc(100% + 8px);\n height: calc(100% + 8px);\n border-radius: 50%;\n }\n`;\n\nconst backgroundDateRange = {\n inRange: css`\n background-color: ${({ theme }) => theme.colors.brand[200]};\n box-shadow: 4px 0 0 0 ${({ theme }) => theme.colors.brand[200]};\n `,\n startRange: css`\n background-color: ${({ theme }) => theme.colors.brand[200]};\n border-radius: 50% 0 0 50%;\n box-shadow: 4px 0 0 0 ${({ theme }) => theme.colors.brand[200]};\n `,\n endRange: css`\n background-color: ${({ theme }) => theme.colors.brand[200]};\n border-radius: 0 50% 50% 0;\n `,\n};\n\nexport const StyledIconTriggerButton = styled(DSButtonV2, {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.PICKER_ICONS.CALENDAR,\n})`\n color: ${({ theme }) => theme.colors.brand['800']};\n width: 2rem;\n height: 2rem;\n`;\n\nexport const StyledShadowWrapper = styled('div', {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.CONTROLLER_COMPONENT.CALENDAR,\n})``;\n\nexport const StyledCalendarWrapper = styled.div<{ $readOnlyStyles?: boolean }>`\n display: grid;\n min-width: 260px;\n background-color: ${({ theme, $readOnlyStyles }) =>\n $readOnlyStyles ? theme.colors.neutral['050'] : theme.colors.neutral['000']};\n grid-template-rows: auto auto;\n`;\n\nexport const StyledHeader = styled.section`\n * {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n display: grid;\n padding: ${({ theme }) => theme.space.xxxs};\n grid-template-columns: min-content min-content 1fr min-content min-content;\n grid-template-rows: 1fr;\n align-items: center;\n justify-content: center;\n text-align: center;\n background: ${({ theme }) => theme.colors.neutral['050']};\n`;\n\nexport const StyledHeaderLabel = styled('h3', {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.CALENDAR.HEADER_LABEL,\n})`\n font-size: 1rem;\n`;\n\nexport const StyledHeaderButton = styled(DSButtonV2, {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.CALENDAR.HEADER_BUTTON,\n})`\n position: relative;\n width: 2.1538rem;\n height: 2.1538rem;\n &:focus {\n &:after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: 2px solid ${({ theme }) => theme.colors.brand[700]};\n border-radius: 2px;\n pointer-events: none;\n }\n }\n &:hover {\n background: ${({ theme }) => theme.colors.brand[200]};\n }\n`;\n\nexport const StyledBody = styled.section`\n padding: ${({ theme }) => theme.space.xxxs};\n`;\n\nexport const StyledDayBtn = styled(DSButtonV2, {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.CALENDAR.DAY_BUTTON,\n})<{ $$readOnlyStyles?: boolean }>`\n height: 2.4615rem;\n width: 2.4615rem;\n border-radius: 50%;\n position: relative;\n border-width: 2px;\n border-style: solid;\n border-color: transparent;\n line-height: 1;\n color: ${({ theme }) => theme.colors.neutral[800]};\n &:hover {\n ${({ theme, $$readOnlyStyles }) => {\n if ($$readOnlyStyles) {\n return css`\n cursor: not-allowed;\n background-color: ${theme.colors.neutral['100']};\n color: ${theme.colors.neutral['700']};\n `;\n }\n return css`\n cursor: pointer;\n background-color: ${theme.colors.brand['200']};\n `;\n }}\n }\n &:focus {\n ${focusBorder}\n }\n display: flex;\n justify-content: center;\n align-items: center;\n`;\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const StyledWeekDaysListWrapper = styled(Grid, {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.CALENDAR.HEADER_WEEKLY_DAY_LIST,\n})<{ isHeader?: boolean }>`\n font-size: ${({ theme }) => theme.fontSizes.label[400]};\n text-align: center;\n justify-items: center;\n ${({ isHeader, theme }) => (isHeader ? `background: ${theme.colors.neutral['050']}` : '')};\n ${({ isHeader }) => (isHeader ? 'text-transform: capitalize' : '')};\n\n .dayWrapper.selectedDay,\n .dayWrapper.startRangeDay,\n .dayWrapper.endRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n }\n &:not(.disabledDay),\n &:not(.outOfRangeDay) {\n ${StyledDayBtn} {\n background-color: ${({ theme }) => theme.colors.brand[700]};\n }\n }\n\n &.disabledDay,\n &.outOfRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n background-color: ${({ theme }) => theme.colors.danger[900]};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n\n &.focusedDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n border-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n\n &.outOfRangeDay.focusedDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n }\n\n .dayWrapper.disabledDay,\n .dayWrapper.outOfRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral[500]};\n ${diagonalLine}\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral[500]};\n }\n }\n &.focusedDay {\n ${StyledDayBtn} {\n &:after {\n border: 2px solid ${({ theme }) => theme.colors.danger[900]};\n }\n }\n }\n }\n\n .dayWrapper.focusedDay {\n ${StyledDayBtn} {\n ${focusBorder}\n &:after {\n border: 2px solid ${({ theme }) => theme.colors.brand[700]};\n }\n }\n\n &:not(.readOnly) {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.brand[600]};\n }\n }\n &.disabledDay,\n &.outOfRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.danger[900]};\n &:before {\n background-color: ${({ theme }) => theme.colors.danger[900]};\n }\n }\n }\n &.selectedDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n\n .dayWrapper.selectedDay.disabledDay.focusedDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n\n .dayWrapper.readOnly {\n ${StyledDayBtn} {\n :hover {\n cursor: not-allowed;\n background-color: ${({ theme }) => theme.colors.neutral['100']};\n color: ${({ theme }) => theme.colors.neutral['700']};\n }\n }\n }\n\n .dayWrapper.selectedDay.readOnly {\n ${StyledDayBtn} {\n background-color: ${({ theme }) => theme.colors.neutral['500']};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n color: ${({ theme }) => theme.colors.neutral['000']};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n :hover {\n background-color: ${({ theme }) => theme.colors.neutral['700']};\n color: ${({ theme }) => theme.colors.neutral['000']};\n }\n :focus {\n background-color: ${({ theme }) => theme.colors.neutral['700']};\n }\n }\n }\n\n .dayWrapper.disabledDay.readOnly,\n .dayWrapper.outOfRangeDay.readOnly {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral[700]};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral[700]};\n }\n :hover {\n background-color: ${({ theme }) => theme.colors.neutral[100]};\n }\n }\n &.focusedDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral[700]};\n &:before {\n background-color: ${({ theme }) => theme.colors.brand[700]};\n }\n &:after {\n border: 2px solid ${({ theme }) => theme.colors.brand[700]};\n }\n }\n }\n }\n\n .dayWrapper.selectedDay.disabledDay.readOnly,\n .dayWrapper.selectedDay.outOfRangeDay.readOnly {\n ${StyledDayBtn} {\n background-color: ${({ theme }) => theme.colors.danger[900]};\n color: ${({ theme }) => theme.colors.neutral['000']};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n :hover {\n background-color: ${({ theme }) => theme.colors.danger[900]};\n }\n }\n }\n\n .dayWrapper.notCurrentMonth {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral[500]};\n }\n\n &.focusedDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.brand[600]};\n }\n\n &.disabledDay,\n &.outOfRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.danger[900]};\n }\n\n &.inRangeDay,\n &.startRangeDay,\n &.endRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n }\n\n &.selectedDay,\n &.startRangeDay,\n &.endRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n\n .dayWrapper.inRangeDay {\n ${backgroundDateRange.inRange}\n &.disabledDay,\n &.outOfRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n background-color: ${({ theme }) => theme.colors.danger[900]};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n &.focusedDay {\n ${StyledDayBtn} {\n border-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n }\n\n .dayWrapper.startRangeDay {\n &.inRangeImproperDay {\n ${backgroundDateRange.startRange}\n }\n &.focusedDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n &.disabledDay,\n &.outOfRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n }\n\n .dayWrapper.endRangeDay {\n &.inRangeImproperDay {\n ${backgroundDateRange.endRange}\n }\n &.focusedDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n &.disabledDay,\n &.outOfRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n }\n\n .dayWrapper.endRangeDay.startRangeDay {\n background-color: transparent;\n box-shadow: none;\n }\n`;\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\nexport const StyledWeekDaysHeaderItem = styled.div`\n min-width: 2.4615rem;\n display: flex;\n justify-content: center;\n align-items: center;\n`;\n\nexport const CalendarFooterMessage = styled('div', {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.FOOTERS.CALENDAR,\n})<{ $readOnlyStyles?: boolean }>`\n border-top: solid 1px ${({ theme }) => theme.colors.neutral[300]};\n margin: 0 ${({ theme }) => theme.space.xxs2};\n padding: ${({ theme }) => theme.space.xxs2} 0;\n color: ${({ theme }) => theme.colors.danger[900]};\n font-size: ${({ theme }) => theme.fontSizes.microText[200]};\n text-align: right;\n background-color: ${({ theme, $readOnlyStyles }) =>\n $readOnlyStyles ? theme.colors.neutral['050'] : theme.colors.neutral['000']};\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,0BAA2B;AAC3B,qBAAqB;AACrB,uBAA4B;AAC5B,uBAAgF;AAEhF,MAAM,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBASG,CAAC,EAAE,MAAM,MAAM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AAK,CAAC;AAAA;AAGnD,MAAM,wBAAoB,yBAAO,MAAM;AAAA,EAC5C,MAAM;AAAA,EACN,MAAM,iDAAgC,SAAS;AACjD,CAAC;AAAA;AAAA;AAIM,MAAM,yBAAqB,yBAAO,gCAAY;AAAA,EACnD,MAAM;AAAA,EACN,MAAM,iDAAgC,SAAS;AACjD,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAYyB,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAM9C,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAIjD,MAAM,aAAa,wBAAO;AAAA,aACpB,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,IAAI;AAAA;AAGrC,MAAM,mBAAe,yBAAO,gCAAY;AAAA,EAC7C,MAAM;AAAA,EACN,MAAM,iDAAgC,SAAS;AACjD,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WASU,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA,MAE7C,CAAC,EAAE,OAAO,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { Grid } from '@elliemae/ds-grid';\nimport { css, styled } from '@elliemae/ds-system';\nimport { DSControlledDateTimePickerName, DSControlledDateTimePickerSlots } from '../../../constants/index.js';\n\nconst diagonalLine = css`\n &:before {\n position: absolute;\n content: '';\n top: 48%;\n left: -2px;\n height: 1px;\n width: calc(100% + 4px);\n transform: rotate(45deg);\n background-color: ${({ theme }) => theme.colors.neutral[500]};\n }\n`;\n\nconst focusBorder = css`\n &:after {\n position: absolute;\n content: '';\n top: -4px;\n left: -4px;\n width: calc(100% + 8px);\n height: calc(100% + 8px);\n border-radius: 50%;\n }\n`;\n\nconst backgroundDateRange = {\n inRange: css`\n background-color: ${({ theme }) => theme.colors.brand[200]};\n box-shadow: 4px 0 0 0 ${({ theme }) => theme.colors.brand[200]};\n `,\n startRange: css`\n background-color: ${({ theme }) => theme.colors.brand[200]};\n border-radius: 50% 0 0 50%;\n box-shadow: 4px 0 0 0 ${({ theme }) => theme.colors.brand[200]};\n `,\n endRange: css`\n background-color: ${({ theme }) => theme.colors.brand[200]};\n border-radius: 0 50% 50% 0;\n `,\n};\n\nexport const StyledIconTriggerButton = styled(DSButtonV2, {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.PICKER_ICONS.CALENDAR,\n})`\n color: ${({ theme }) => theme.colors.brand['800']};\n width: 2rem;\n height: 2rem;\n`;\n\nexport const StyledShadowWrapper = styled('div', {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.CONTROLLER_COMPONENT.CALENDAR,\n})``;\n\nexport const StyledCalendarWrapper = styled.div<{ $readOnlyStyles?: boolean }>`\n display: grid;\n min-width: 260px;\n background-color: ${({ theme, $readOnlyStyles }) =>\n $readOnlyStyles ? theme.colors.neutral['050'] : theme.colors.neutral['000']};\n grid-template-rows: auto auto;\n`;\n\nexport const StyledHeader = styled.section`\n * {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n display: grid;\n padding: ${({ theme }) => theme.space.xxxs};\n grid-template-columns: min-content min-content 1fr min-content min-content;\n grid-template-rows: 1fr;\n align-items: center;\n justify-content: center;\n text-align: center;\n background: ${({ theme }) => theme.colors.neutral['050']};\n`;\n\nexport const StyledHeaderLabel = styled('h3', {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.CALENDAR.HEADER_LABEL,\n})`\n font-size: 1rem;\n`;\n\nexport const StyledHeaderButton = styled(DSButtonV2, {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.CALENDAR.HEADER_BUTTON,\n})`\n position: relative;\n width: 2.1538rem;\n height: 2.1538rem;\n &:focus {\n &:after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: 2px solid ${({ theme }) => theme.colors.brand[700]};\n border-radius: 2px;\n pointer-events: none;\n }\n }\n &:hover {\n background: ${({ theme }) => theme.colors.brand[200]};\n }\n`;\n\nexport const StyledBody = styled.section`\n padding: ${({ theme }) => theme.space.xxxs};\n`;\n\nexport const StyledDayBtn = styled(DSButtonV2, {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.CALENDAR.DAY_BUTTON,\n})<{ $readOnlyStyles?: boolean }>`\n height: 2.4615rem;\n width: 2.4615rem;\n border-radius: 50%;\n position: relative;\n border-width: 2px;\n border-style: solid;\n border-color: transparent;\n line-height: 1;\n color: ${({ theme }) => theme.colors.neutral[800]};\n &:hover {\n ${({ theme, $readOnlyStyles }) => {\n if ($readOnlyStyles) {\n return css`\n cursor: not-allowed;\n background-color: ${theme.colors.neutral['100']};\n color: ${theme.colors.neutral['700']};\n `;\n }\n return css`\n cursor: pointer;\n background-color: ${theme.colors.brand['200']};\n color: ${theme.colors.brand[700]};\n `;\n }}\n }\n &:focus {\n ${focusBorder}\n }\n display: flex;\n justify-content: center;\n align-items: center;\n`;\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const StyledWeekDaysListWrapper = styled(Grid, {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.CALENDAR.HEADER_WEEKLY_DAY_LIST,\n})<{ isHeader?: boolean }>`\n font-size: ${({ theme }) => theme.fontSizes.label[400]};\n text-align: center;\n justify-items: center;\n ${({ isHeader, theme }) => (isHeader ? `background: ${theme.colors.neutral['050']}` : '')};\n ${({ isHeader }) => (isHeader ? 'text-transform: capitalize' : '')};\n\n .dayWrapper.selectedDay,\n .dayWrapper.startRangeDay,\n .dayWrapper.endRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n }\n &:not(.disabledDay),\n &:not(.outOfRangeDay) {\n ${StyledDayBtn} {\n background-color: ${({ theme }) => theme.colors.brand[700]};\n }\n }\n\n &.disabledDay,\n &.outOfRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n background-color: ${({ theme }) => theme.colors.danger[900]};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n\n &.focusedDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n border-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n\n &.outOfRangeDay.focusedDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n }\n\n .dayWrapper.disabledDay,\n .dayWrapper.outOfRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral[700]};\n ${diagonalLine}\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral[500]};\n }\n :hover {\n color: ${({ theme }) => theme.colors.neutral[700]};\n }\n }\n &.focusedDay {\n ${StyledDayBtn} {\n &:after {\n border: 2px solid ${({ theme }) => theme.colors.danger[900]};\n }\n }\n }\n }\n\n .dayWrapper.focusedDay {\n ${StyledDayBtn} {\n ${focusBorder}\n &:after {\n border: 2px solid ${({ theme }) => theme.colors.brand[700]};\n }\n }\n\n &:not(.readOnly) {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.brand[600]};\n }\n }\n &.disabledDay,\n &.outOfRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.danger[900]};\n &:before {\n background-color: ${({ theme }) => theme.colors.danger[900]};\n }\n }\n }\n &.selectedDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n\n .dayWrapper.selectedDay.disabledDay.focusedDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n\n .dayWrapper.readOnly {\n ${StyledDayBtn} {\n :hover {\n cursor: not-allowed;\n background-color: ${({ theme }) => theme.colors.neutral['100']};\n color: ${({ theme }) => theme.colors.neutral['700']};\n }\n }\n }\n\n .dayWrapper.selectedDay.readOnly {\n ${StyledDayBtn} {\n background-color: ${({ theme }) => theme.colors.neutral['500']};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n color: ${({ theme }) => theme.colors.neutral['000']};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n :hover {\n background-color: ${({ theme }) => theme.colors.neutral['700']};\n color: ${({ theme }) => theme.colors.neutral['000']};\n }\n :focus {\n background-color: ${({ theme }) => theme.colors.neutral['700']};\n }\n }\n }\n\n .dayWrapper.disabledDay.readOnly,\n .dayWrapper.outOfRangeDay.readOnly {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral[700]};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral[700]};\n }\n :hover {\n background-color: ${({ theme }) => theme.colors.neutral[100]};\n }\n }\n &.focusedDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral[700]};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral[700]};\n }\n &:after {\n border: 2px solid ${({ theme }) => theme.colors.brand[700]};\n }\n }\n }\n }\n\n .dayWrapper.selectedDay.disabledDay.readOnly,\n .dayWrapper.selectedDay.outOfRangeDay.readOnly {\n ${StyledDayBtn} {\n background-color: ${({ theme }) => theme.colors.neutral['500']};\n color: ${({ theme }) => theme.colors.neutral['000']};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n :hover {\n background-color: ${({ theme }) => theme.colors.neutral['700']};\n }\n :focus {\n background-color: ${({ theme }) => theme.colors.neutral['700']};\n }\n }\n }\n\n .dayWrapper.notCurrentMonth {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral[500]};\n }\n\n &.focusedDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.brand[600]};\n }\n\n &.disabledDay,\n &.outOfRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.brand[600]};\n }\n\n &.inRangeDay,\n &.startRangeDay,\n &.endRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n }\n\n &.selectedDay,\n &.startRangeDay,\n &.endRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n\n .dayWrapper.inRangeDay {\n ${backgroundDateRange.inRange}\n &.disabledDay,\n &.outOfRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n background-color: ${({ theme }) => theme.colors.danger[900]};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n &.focusedDay {\n ${StyledDayBtn} {\n border-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n }\n\n .dayWrapper.startRangeDay {\n &.inRangeImproperDay {\n ${backgroundDateRange.startRange}\n }\n &.focusedDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n &.disabledDay,\n &.outOfRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n }\n\n .dayWrapper.endRangeDay {\n &.inRangeImproperDay {\n ${backgroundDateRange.endRange}\n }\n &.focusedDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n &.disabledDay,\n &.outOfRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n }\n\n .dayWrapper.endRangeDay.startRangeDay {\n background-color: transparent;\n box-shadow: none;\n }\n`;\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\nexport const StyledWeekDaysHeaderItem = styled.div`\n min-width: 2.4615rem;\n display: flex;\n justify-content: center;\n align-items: center;\n`;\n\nexport const CalendarFooterMessage = styled('div', {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.FOOTERS.CALENDAR,\n})<{ $readOnlyStyles?: boolean }>`\n border-top: solid 1px ${({ theme }) => theme.colors.neutral[300]};\n margin: 0 ${({ theme }) => theme.space.xxs2};\n padding: ${({ theme }) => theme.space.xxs2} 0;\n color: ${({ theme }) => theme.colors.danger[900]};\n font-size: ${({ theme }) => theme.fontSizes.microText[200]};\n text-align: right;\n background-color: ${({ theme, $readOnlyStyles }) =>\n $readOnlyStyles ? theme.colors.neutral['050'] : theme.colors.neutral['000']};\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,0BAA2B;AAC3B,qBAAqB;AACrB,uBAA4B;AAC5B,uBAAgF;AAEhF,MAAM,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBASG,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAIhE,MAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYpB,MAAM,sBAAsB;AAAA,EAC1B,SAAS;AAAA,wBACa,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA,4BAClC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA,EAEhE,YAAY;AAAA,wBACU,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,G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ic.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-statements */\n/* eslint-disable max-lines */\nimport { useMemo, useCallback, useState, useEffect, createRef, useRef } from 'react';\n// eslint-disable-next-line max-len\nimport { useGetMonthYearFromDateStringOrEmptyStartingMonth } from '../../../utils/hooks/useGetMonthYearFromDateStringOrEmptyStartingMonth.js';\nimport {\n getSixBySevenCurrentMonthDaysMatrix,\n sumFromDateValues,\n sumValuesToDate,\n getDateStringFromDay,\n} from '../../../utils/dateHelpers.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../../sharedTypes.js';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction sliceIntoChunks<T = any>(arr: Array<T>, chunkSize: number): Array<Array<T>> {\n const res = [];\n for (let i = 0; i < arr.length; i += chunkSize) {\n const chunk = arr.slice(i, i + chunkSize);\n res.push(chunk);\n }\n return res;\n}\ninterface UseCurrentDisplayedMonthYearLogicT {\n currentMonth: DSControlledDateTimePickerInternalsT.DateMonth;\n currentYear: number;\n daysArray:
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,mBAA6E;AAE7E,+DAAkE;AAClE,yBAKO;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-statements */\n/* eslint-disable max-lines */\nimport { useMemo, useCallback, useState, useEffect, createRef, useRef } from 'react';\n// eslint-disable-next-line max-len\nimport { useGetMonthYearFromDateStringOrEmptyStartingMonth } from '../../../utils/hooks/useGetMonthYearFromDateStringOrEmptyStartingMonth.js';\nimport {\n getSixBySevenCurrentMonthDaysMatrix,\n sumFromDateValues,\n sumValuesToDate,\n getDateStringFromDay,\n} from '../../../utils/dateHelpers.js';\nimport type { DSControlledDateTimePickerT } from '../../../react-desc-prop-types.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../../sharedTypes.js';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction sliceIntoChunks<T = any>(arr: Array<T>, chunkSize: number): Array<Array<T>> {\n const res = [];\n for (let i = 0; i < arr.length; i += chunkSize) {\n const chunk = arr.slice(i, i + chunkSize);\n res.push(chunk);\n }\n return res;\n}\ninterface UseCurrentDisplayedMonthYearLogicT {\n currentMonth: DSControlledDateTimePickerInternalsT.DateMonth;\n currentYear: number;\n daysArray: DSControlledDateTimePickerT.MetaMonthDay[];\n invisibleFirstDay?: DSControlledDateTimePickerT.MetaMonthDay;\n daysMatrixByWeekday: DSControlledDateTimePickerT.MetaMonthDay[][];\n invisibleLastDay?: DSControlledDateTimePickerT.MetaMonthDay;\n handlePrevMonth: () => void;\n handlePrevYear: () => void;\n handleNextMonth: () => void;\n handleNextYear: () => void;\n daysArraysRef: React.MutableRefObject<DSControlledDateTimePickerT.MetaMonthDay[]>;\n resetMonthYear: () => void;\n}\n\nconst getDaysArrays = (currentMonth: DSControlledDateTimePickerInternalsT.DateMonth, currentYear: number) => {\n const newDaysArray = getSixBySevenCurrentMonthDaysMatrix(currentMonth, currentYear);\n const hiddenPrevDay = sumValuesToDate(newDaysArray[0].day, {\n daysToSum: -1,\n });\n const hiddenPrevMetaday = {\n day: hiddenPrevDay,\n dayAsString: getDateStringFromDay(hiddenPrevDay),\n isPrevMonthDay: true,\n isNextMonthDay: false,\n isCurrMonthDay: false,\n dayBtnRef: createRef<HTMLButtonElement>() as React.MutableRefObject<HTMLButtonElement>,\n isHidden: true,\n };\n const hiddenNextDay = sumValuesToDate(newDaysArray[newDaysArray.length - 1].day, {\n daysToSum: 1,\n });\n const hiddenNextMetaday = {\n day: hiddenNextDay,\n dayAsString: getDateStringFromDay(hiddenNextDay),\n isPrevMonthDay: false,\n isNextMonthDay: true,\n isCurrMonthDay: false,\n dayBtnRef: createRef<HTMLButtonElement>() as React.MutableRefObject<HTMLButtonElement>,\n isHidden: true,\n };\n return [hiddenPrevMetaday, ...newDaysArray, hiddenNextMetaday];\n};\nexport const useCurrentDisplayedMonthYearLogic = (): UseCurrentDisplayedMonthYearLogicT => {\n const { month: monthFromDateString, year: yearFromDateString } = useGetMonthYearFromDateStringOrEmptyStartingMonth();\n const [currentMonth, setCurrentMonth] = useState(monthFromDateString);\n const [currentYear, setCurrentYear] = useState(yearFromDateString);\n\n const daysArraysRef = useRef<DSControlledDateTimePickerT.MetaMonthDay[]>([]);\n\n const resetMonthYear = useCallback(() => {\n setCurrentMonth(monthFromDateString);\n setCurrentYear(yearFromDateString);\n }, [monthFromDateString, yearFromDateString]);\n // side-effects are really really controlled in this case so use-effect should be fine\n // don't add 200 side-effects to those or else Chaos would hunt us for the years to come\n useEffect(() => {\n setCurrentMonth(monthFromDateString);\n }, [monthFromDateString]);\n useEffect(() => {\n setCurrentYear(yearFromDateString);\n }, [yearFromDateString]);\n\n const daysArray = useMemo(() => getDaysArrays(currentMonth, currentYear), [currentMonth, currentYear]);\n\n daysArraysRef.current = daysArray;\n\n const handlePrevYear = useCallback(() => {\n const { year: newYear } = sumFromDateValues({ month: currentMonth, year: currentYear }, { yearsToSum: -1 });\n setCurrentYear(newYear);\n }, [currentMonth, currentYear]);\n\n const handlePrevMonth = useCallback(() => {\n const { month: newMonth, year: newYear } = sumFromDateValues(\n { month: currentMonth, year: currentYear },\n { monthsToSum: -1 },\n );\n setCurrentMonth(newMonth);\n setCurrentYear(newYear);\n daysArraysRef.current = getDaysArrays(newMonth, newYear);\n }, [currentMonth, currentYear]);\n\n const handleNextMonth = useCallback(() => {\n const { month: newMonth, year: newYear } = sumFromDateValues(\n { month: currentMonth, year: currentYear },\n { monthsToSum: 1 },\n );\n setCurrentMonth(newMonth);\n setCurrentYear(newYear);\n daysArraysRef.current = getDaysArrays(newMonth, newYear);\n }, [currentMonth, currentYear]);\n\n const handleNextYear = useCallback(() => {\n const { year: newYear } = sumFromDateValues({ month: currentMonth, year: currentYear }, { yearsToSum: 1 });\n setCurrentYear(newYear);\n }, [currentMonth, currentYear]);\n\n const { invisibleFirstDay, daysMatrixByWeekday, invisibleLastDay } = useMemo(() => {\n const [invisible1stDay, ...otherDays] = [...daysArray];\n const invisibleDayLast = otherDays.pop();\n return {\n invisibleFirstDay: invisible1stDay,\n daysMatrixByWeekday: sliceIntoChunks<DSControlledDateTimePickerT.MetaMonthDay>(otherDays, 7),\n invisibleLastDay: invisibleDayLast,\n };\n }, [daysArray]);\n\n return useMemo(\n () => ({\n currentMonth,\n currentYear,\n daysArray,\n invisibleFirstDay,\n daysMatrixByWeekday,\n invisibleLastDay,\n handlePrevYear,\n handlePrevMonth,\n handleNextMonth,\n handleNextYear,\n daysArraysRef,\n resetMonthYear,\n }),\n [\n currentMonth,\n currentYear,\n daysArray,\n daysMatrixByWeekday,\n handleNextMonth,\n handleNextYear,\n handlePrevMonth,\n handlePrevYear,\n invisibleFirstDay,\n invisibleLastDay,\n resetMonthYear,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,mBAA6E;AAE7E,+DAAkE;AAClE,yBAKO;AAKP,SAAS,gBAAyB,KAAe,WAAoC;AACnF,QAAM,MAAM,CAAC;AACb,WAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK,WAAW;AAC9C,UAAM,QAAQ,IAAI,MAAM,GAAG,IAAI,SAAS;AACxC,QAAI,KAAK,KAAK;AAAA,EAChB;AACA,SAAO;AACT;AAgBA,MAAM,gBAAgB,CAAC,cAA8D,gBAAwB;AAC3G,QAAM,mBAAe,wDAAoC,cAAc,WAAW;AAClF,QAAM,oBAAgB,oCAAgB,aAAa,CAAC,EAAE,KAAK;AAAA,IACzD,WAAW;AAAA,EACb,CAAC;AACD,QAAM,oBAAoB;AAAA,IACxB,KAAK;AAAA,IACL,iBAAa,yCAAqB,aAAa;AAAA,IAC/C,gBAAgB;AAAA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AA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -38,9 +38,7 @@ var import_useGetStartingFocusedDay = require("../../../utils/hooks/useGetStarti
|
|
|
38
38
|
const useFocusLogic = ({ currentDisplayedMonthLogic }) => {
|
|
39
39
|
const { daysArraysRef, daysArray } = currentDisplayedMonthLogic;
|
|
40
40
|
const { startFocusedDate } = (0, import_useGetStartingFocusedDay.useGetStartingFocusedDay)();
|
|
41
|
-
const [metadayToFocus, setMetadayToFocus] = (0, import_react.useState)(
|
|
42
|
-
void 0
|
|
43
|
-
);
|
|
41
|
+
const [metadayToFocus, setMetadayToFocus] = (0, import_react.useState)(void 0);
|
|
44
42
|
const focusedDay = (0, import_react.useMemo)(() => {
|
|
45
43
|
let newFocusedDay;
|
|
46
44
|
if (metadayToFocus)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Pickers/Calendar/useFocusLogic.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-statements */\n/* eslint-disable max-lines */\nimport { useMemo, useCallback, useState } from 'react';\nimport { compareTwoDatesDayEquality } from '../../../utils/dateHelpers.js';\nimport { useGetStartingFocusedDay } from '../../../utils/hooks/useGetStartingFocusedDay.js';\nimport type { useCurrentDisplayedMonthYearLogic } from './useCurrentDisplayedMonthYearLogic.js';\nimport type {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,mBAA+C;AAC/C,yBAA2C;AAC3C,sCAAyC;AAelC,MAAM,gBAAgB,CAAC,EAAE,2BAA2B,MAAuC;AAChG,QAAM,EAAE,eAAe,UAAU,IAAI;AACrC,QAAM,EAAE,iBAAiB,QAAI,0DAAyB;AACtD,QAAM,CAAC,gBAAgB,iBAAiB,QAAI
|
|
4
|
+
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-statements */\n/* eslint-disable max-lines */\nimport { useMemo, useCallback, useState } from 'react';\nimport { compareTwoDatesDayEquality } from '../../../utils/dateHelpers.js';\nimport { useGetStartingFocusedDay } from '../../../utils/hooks/useGetStartingFocusedDay.js';\nimport type { useCurrentDisplayedMonthYearLogic } from './useCurrentDisplayedMonthYearLogic.js';\nimport type { DSControlledDateTimePickerT } from '../../../react-desc-prop-types.js';\n\ninterface UseFocusLogicArgsT {\n currentDisplayedMonthLogic: ReturnType<typeof useCurrentDisplayedMonthYearLogic>;\n showCalendar: boolean;\n}\ninterface FocusLogicT {\n focusedDay?: DSControlledDateTimePickerT.MetaMonthDay;\n resetFocusedDayToStartDate: () => void;\n handleFocusMetaDay: (metaDayToFocus: DSControlledDateTimePickerT.MetaMonthDay) => void;\n handleFocusMetaDayByDay: (day: Date) => void;\n}\n\nexport const useFocusLogic = ({ currentDisplayedMonthLogic }: UseFocusLogicArgsT): FocusLogicT => {\n const { daysArraysRef, daysArray } = currentDisplayedMonthLogic;\n const { startFocusedDate } = useGetStartingFocusedDay();\n const [metadayToFocus, setMetadayToFocus] = useState<DSControlledDateTimePickerT.MetaMonthDay | undefined>(undefined);\n\n // this is required because we have to focus based on the inputs values too,\n // useGetStartingFocusedDay does this already,\n // this \"useMemo\" is here just to trigger it functionally by changing the metadayToFocus state\n // which is required for arrow key navigation in the calendar\n const focusedDay = useMemo(() => {\n let newFocusedDay;\n\n if (metadayToFocus)\n newFocusedDay = daysArray.find(({ day: currDay }) => compareTwoDatesDayEquality(currDay, metadayToFocus.day));\n else if (startFocusedDate)\n newFocusedDay = daysArray.find(({ day: currDay }) => compareTwoDatesDayEquality(currDay, startFocusedDate));\n return newFocusedDay;\n }, [daysArray, startFocusedDate, metadayToFocus]);\n\n const handleFocusMetaDay = useCallback(\n (metaDayToFocus: DSControlledDateTimePickerT.MetaMonthDay) => {\n // if focusedDay is inside current daysArray we set Focused day\n const newFocusedMetaDay = daysArraysRef.current.find(({ day: currDay }) =>\n compareTwoDatesDayEquality(currDay, metaDayToFocus.day),\n );\n if (focusedDay !== newFocusedMetaDay) setMetadayToFocus(newFocusedMetaDay);\n },\n [daysArraysRef, focusedDay],\n );\n\n const handleFocusMetaDayByDay = useCallback(\n (dayDate: Date) => {\n // if focusedDay is inside current daysArray we set Focused day\n const newFocusedMetaDay = daysArraysRef.current.find(({ day: currDay }) =>\n compareTwoDatesDayEquality(currDay, dayDate),\n );\n if (focusedDay !== newFocusedMetaDay) setMetadayToFocus(newFocusedMetaDay);\n },\n [daysArraysRef, focusedDay],\n );\n\n const resetFocusedDayToStartDate = useCallback(() => {\n setMetadayToFocus(undefined);\n }, []);\n\n return useMemo(\n () => ({\n focusedDay,\n resetFocusedDayToStartDate,\n handleFocusMetaDay,\n handleFocusMetaDayByDay,\n }),\n [focusedDay, resetFocusedDayToStartDate, handleFocusMetaDay, handleFocusMetaDayByDay],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,mBAA+C;AAC/C,yBAA2C;AAC3C,sCAAyC;AAelC,MAAM,gBAAgB,CAAC,EAAE,2BAA2B,MAAuC;AAChG,QAAM,EAAE,eAAe,UAAU,IAAI;AACrC,QAAM,EAAE,iBAAiB,QAAI,0DAAyB;AACtD,QAAM,CAAC,gBAAgB,iBAAiB,QAAI,uBAA+D,MAAS;AAMpH,QAAM,iBAAa,sBAAQ,MAAM;AAC/B,QAAI;AAEJ,QAAI;AACF,sBAAgB,UAAU,KAAK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