@elliemae/ds-form-date-time-picker 3.52.0-rc.9 → 3.52.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/config/useGetPropsWithDefault.js +17 -1
- package/dist/cjs/config/useGetPropsWithDefault.js.map +2 -2
- package/dist/cjs/parts/ControlledDateTimePickerContent.js +6 -3
- package/dist/cjs/parts/ControlledDateTimePickerContent.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarContent.js +5 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarContent.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarFooter.js +16 -3
- package/dist/cjs/parts/Pickers/Calendar/CalendarFooter.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarHead.js +1 -0
- package/dist/cjs/parts/Pickers/Calendar/CalendarHead.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarIconTrigger.js +2 -4
- package/dist/cjs/parts/Pickers/Calendar/CalendarIconTrigger.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarWrapper.js +1 -0
- package/dist/cjs/parts/Pickers/Calendar/CalendarWrapper.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/Day.js +6 -2
- package/dist/cjs/parts/Pickers/Calendar/Day.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/Styleds.js +40 -7
- package/dist/cjs/parts/Pickers/Calendar/Styleds.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/useConfigCalendarCTX.js +2 -1
- package/dist/cjs/parts/Pickers/Calendar/useConfigCalendarCTX.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js +8 -2
- package/dist/cjs/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/useFocusLogic.js +5 -9
- package/dist/cjs/parts/Pickers/Calendar/useFocusLogic.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/useKeyboardHandlers.js +6 -3
- package/dist/cjs/parts/Pickers/Calendar/useKeyboardHandlers.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/usePopperTriggerLogic.js +4 -2
- package/dist/cjs/parts/Pickers/Calendar/usePopperTriggerLogic.js.map +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js +5 -1
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js.map +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js +16 -3
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js.map +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +2 -5
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js +1 -0
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js.map +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/Styleds.js +4 -11
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/Styleds.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js +7 -3
- package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js +6 -2
- package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js +5 -2
- package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/Styleds.js +37 -9
- package/dist/cjs/parts/Pickers/TimeWheel/Styleds.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContent.js +9 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContent.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelFooter.js +16 -3
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelFooter.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +2 -6
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelWrapper.js +2 -0
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelWrapper.js.map +2 -2
- package/dist/cjs/parts/Styleds.js +13 -1
- package/dist/cjs/parts/Styleds.js.map +2 -2
- package/dist/cjs/utils/dateHelpers.js +6 -0
- package/dist/cjs/utils/dateHelpers.js.map +2 -2
- package/dist/cjs/utils/hooks/useGetStartingFocusedDay.js +5 -1
- package/dist/cjs/utils/hooks/useGetStartingFocusedDay.js.map +2 -2
- package/dist/esm/config/useGetPropsWithDefault.js +17 -1
- package/dist/esm/config/useGetPropsWithDefault.js.map +2 -2
- package/dist/esm/parts/ControlledDateTimePickerContent.js +5 -2
- package/dist/esm/parts/ControlledDateTimePickerContent.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarContent.js +5 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarContent.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarFooter.js +17 -4
- package/dist/esm/parts/Pickers/Calendar/CalendarFooter.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarHead.js +1 -0
- package/dist/esm/parts/Pickers/Calendar/CalendarHead.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarIconTrigger.js +2 -4
- package/dist/esm/parts/Pickers/Calendar/CalendarIconTrigger.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarWrapper.js +1 -0
- package/dist/esm/parts/Pickers/Calendar/CalendarWrapper.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/Day.js +6 -2
- package/dist/esm/parts/Pickers/Calendar/Day.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/Styleds.js +40 -7
- package/dist/esm/parts/Pickers/Calendar/Styleds.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/useConfigCalendarCTX.js +2 -1
- package/dist/esm/parts/Pickers/Calendar/useConfigCalendarCTX.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js +8 -2
- package/dist/esm/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/useFocusLogic.js +5 -9
- package/dist/esm/parts/Pickers/Calendar/useFocusLogic.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/useKeyboardHandlers.js +6 -3
- package/dist/esm/parts/Pickers/Calendar/useKeyboardHandlers.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/usePopperTriggerLogic.js +4 -2
- package/dist/esm/parts/Pickers/Calendar/usePopperTriggerLogic.js.map +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js +5 -1
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js.map +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js +17 -4
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js.map +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +2 -5
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js +1 -0
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js.map +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/Styleds.js +4 -11
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/Styleds.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/HoursList.js +7 -3
- package/dist/esm/parts/Pickers/TimeWheel/HoursList.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js +6 -2
- package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js +5 -2
- package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/Styleds.js +37 -9
- package/dist/esm/parts/Pickers/TimeWheel/Styleds.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContent.js +9 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContent.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelFooter.js +17 -4
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelFooter.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +2 -6
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelWrapper.js +2 -0
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelWrapper.js.map +2 -2
- package/dist/esm/parts/Styleds.js +13 -1
- package/dist/esm/parts/Styleds.js.map +2 -2
- package/dist/esm/utils/dateHelpers.js +6 -0
- package/dist/esm/utils/dateHelpers.js.map +2 -2
- package/dist/esm/utils/hooks/useGetStartingFocusedDay.js +5 -1
- package/dist/esm/utils/hooks/useGetStartingFocusedDay.js.map +2 -2
- package/dist/types/parts/Pickers/Calendar/Styleds.d.ts +9 -3
- package/dist/types/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.d.ts +1 -0
- package/dist/types/parts/Pickers/Calendar/usePopperTriggerLogic.d.ts +2 -1
- package/dist/types/parts/Pickers/CalendarWithTimeWheel/Styleds.d.ts +6 -2
- package/dist/types/parts/Pickers/TimeWheel/Styleds.d.ts +6 -2
- package/dist/types/parts/Styleds.d.ts +2 -0
- package/dist/types/tests/DSControlledDateTimePicker.PUI-16014.test.d.ts +1 -0
- package/dist/types/utils/dateHelpers.d.ts +1 -0
- package/package.json +13 -13
|
@@ -33,6 +33,22 @@ __export(useGetPropsWithDefault_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(useGetPropsWithDefault_exports);
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
35
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
36
|
+
var import_dateHelpers = require("../utils/dateHelpers.js");
|
|
36
37
|
var import_react_desc_prop_types = require("../react-desc-prop-types.js");
|
|
37
|
-
const useGetDatePickerWithDefaultsProps = (props) =>
|
|
38
|
+
const useGetDatePickerWithDefaultsProps = (props) => {
|
|
39
|
+
const today = /* @__PURE__ */ new Date();
|
|
40
|
+
const todayString = (0, import_dateHelpers.getDateStringFromDay)(today);
|
|
41
|
+
const todayStartMonthString = (0, import_dateHelpers.getMonthStringFromDay)(today);
|
|
42
|
+
const emptyPickerStartingMonthUser = props.emptyPickerStartingMonth;
|
|
43
|
+
const canFillToday = emptyPickerStartingMonthUser === void 0 || todayStartMonthString === emptyPickerStartingMonthUser;
|
|
44
|
+
const newProps = canFillToday ? {
|
|
45
|
+
onCalendarOpenFocusedDay: todayString,
|
|
46
|
+
emptyPickerStartingMonth: todayStartMonthString
|
|
47
|
+
} : {};
|
|
48
|
+
const defaultPropsWithToday = {
|
|
49
|
+
...import_react_desc_prop_types.defaultProps,
|
|
50
|
+
...newProps
|
|
51
|
+
};
|
|
52
|
+
return (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, defaultPropsWithToday);
|
|
53
|
+
};
|
|
38
54
|
//# sourceMappingURL=useGetPropsWithDefault.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useGetPropsWithDefault.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport type { DSControlledDateTimePickerT } from '../react-desc-prop-types.js';\nimport { defaultProps } from '../react-desc-prop-types.js';\n// we have to merge the \"default\" nested default values with what the user gives us...\nexport const useGetDatePickerWithDefaultsProps = (\n props: DSControlledDateTimePickerT.Props,\n): DSControlledDateTimePickerT.InternalProps
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA6C;AAE7C,mCAA6B;
|
|
4
|
+
"sourcesContent": ["import { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport type { DSControlledDateTimePickerT } from '../react-desc-prop-types.js';\nimport { getDateStringFromDay, getMonthStringFromDay } from '../utils/dateHelpers.js';\nimport { defaultProps } from '../react-desc-prop-types.js';\n// we have to merge the \"default\" nested default values with what the user gives us...\n\nexport const useGetDatePickerWithDefaultsProps = (\n props: DSControlledDateTimePickerT.Props,\n): DSControlledDateTimePickerT.InternalProps => {\n const today = new Date();\n const todayString = getDateStringFromDay(today);\n const todayStartMonthString = getMonthStringFromDay(today);\n const emptyPickerStartingMonthUser = (props as DSControlledDateTimePickerT.DatePickerProps).emptyPickerStartingMonth;\n const canFillToday =\n emptyPickerStartingMonthUser === undefined || todayStartMonthString === emptyPickerStartingMonthUser;\n const newProps = canFillToday\n ? ({\n onCalendarOpenFocusedDay: todayString,\n emptyPickerStartingMonth: todayStartMonthString,\n } as DSControlledDateTimePickerT.DatePickerProps)\n : {};\n const defaultPropsWithToday: Partial<DSControlledDateTimePickerT.Props> = {\n ...defaultProps,\n ...newProps,\n };\n\n return useMemoMergePropsWithDefault<DSControlledDateTimePickerT.InternalProps>(props, defaultPropsWithToday);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA6C;AAE7C,yBAA4D;AAC5D,mCAA6B;AAGtB,MAAM,oCAAoC,CAC/C,UAC8C;AAC9C,QAAM,QAAQ,oBAAI,KAAK;AACvB,QAAM,kBAAc,yCAAqB,KAAK;AAC9C,QAAM,4BAAwB,0CAAsB,KAAK;AACzD,QAAM,+BAAgC,MAAsD;AAC5F,QAAM,eACJ,iCAAiC,UAAa,0BAA0B;AAC1E,QAAM,WAAW,eACZ;AAAA,IACC,0BAA0B;AAAA,IAC1B,0BAA0B;AAAA,EAC5B,IACA,CAAC;AACL,QAAM,wBAAoE;AAAA,IACxE,GAAG;AAAA,IACH,GAAG;AAAA,EACL;AAEA,aAAO,sDAAwE,OAAO,qBAAqB;AAC7G;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -35,7 +35,7 @@ var React = __toESM(require("react"));
|
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
36
|
var import_react = require("react");
|
|
37
37
|
var import_ds_grid = require("@elliemae/ds-grid");
|
|
38
|
-
var
|
|
38
|
+
var import_lodash_es = require("lodash-es");
|
|
39
39
|
var import_ControlledDateTimePickerCTX = require("../ControlledDateTimePickerCTX.js");
|
|
40
40
|
var import_Styleds = require("./Styleds.js");
|
|
41
41
|
var import_DateInputs = require("./DateInputs/DateInputs.js");
|
|
@@ -45,7 +45,7 @@ var import_ClearButton = require("./ClearButton/ClearButton.js");
|
|
|
45
45
|
var import_ControlledDateTimePickerDatatestid = require("../ControlledDateTimePickerDatatestid.js");
|
|
46
46
|
const ControlledDateTimePickerContent = () => {
|
|
47
47
|
const {
|
|
48
|
-
props: { hasError, disabled },
|
|
48
|
+
props: { hasError, disabled, readOnly, applyAriaDisabled },
|
|
49
49
|
getProps,
|
|
50
50
|
hideDate,
|
|
51
51
|
hideTime,
|
|
@@ -71,6 +71,7 @@ const ControlledDateTimePickerContent = () => {
|
|
|
71
71
|
const rightControlCols = [];
|
|
72
72
|
if (shouldPreserveClearableSpace) rightControlCols.push("28px");
|
|
73
73
|
if (withAnyPicker) rightControlCols.push("auto");
|
|
74
|
+
const onlyPicker = hideDate && hideTime;
|
|
74
75
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
75
76
|
import_Styleds.StyledInputsWrapperGrid,
|
|
76
77
|
{
|
|
@@ -82,8 +83,10 @@ const ControlledDateTimePickerContent = () => {
|
|
|
82
83
|
onBlur: handleComponentBlurs,
|
|
83
84
|
"data-testid": import_ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.CONTAINER,
|
|
84
85
|
getOwnerProps: getProps,
|
|
86
|
+
onlyPicker,
|
|
87
|
+
readOnlyStyles: readOnly || applyAriaDisabled,
|
|
85
88
|
...styledsAttrs,
|
|
86
|
-
...(0,
|
|
89
|
+
...(0, import_lodash_es.omit)(globalAttrs, "tabIndex", "autoFocus"),
|
|
87
90
|
...xstyledAttrs,
|
|
88
91
|
children: [
|
|
89
92
|
hideDate ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DateInputs.DateInputs, {}),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/parts/ControlledDateTimePickerContent.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable complexity */\nimport React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { omit } from 'lodash';\nimport { ControlledDateTimePickerContext } from '../ControlledDateTimePickerCTX.js';\nimport { StyledInputsWrapperGrid } from './Styleds.js';\nimport { DateInputs } from './DateInputs/DateInputs.js';\nimport { TimeInputs } from './TimeInputs/TimeInputs.js';\nimport { PickersIcons } from './Pickers/PickersIcons.js';\nimport { ClearButton } from './ClearButton/ClearButton.js';\nimport { ControlledDateTimePickerDatatestid } from '../ControlledDateTimePickerDatatestid.js';\n\nexport const ControlledDateTimePickerContent = (): JSX.Element => {\n const {\n props: { hasError, disabled },\n getProps,\n hideDate,\n hideTime,\n withAnyPicker,\n withAnyRightController,\n shouldPreserveClearableSpace,\n isControllerOnly,\n globalAttrs,\n xstyledAttrs,\n onGlobalKeyDown,\n handleComponentBlurs,\n } = useContext(ControlledDateTimePickerContext);\n\n const styledsAttrs = {\n justPicker: hideDate && hideTime,\n withAnyPicker,\n hasError,\n isControllerOnly,\n };\n\n const mainCols = [];\n if (!hideDate) mainCols.push('auto');\n if (!hideTime) mainCols.push('auto');\n if (withAnyRightController) mainCols.push('auto');\n\n const rightControlCols = [];\n if (shouldPreserveClearableSpace) rightControlCols.push('28px');\n if (withAnyPicker) rightControlCols.push('auto');\n\n return (\n <>\n {/* The <div> element is catching the component-wise global hotkeys, there is no valid aria role for this */}\n {/* eslint-disable-next-line max-len */}\n {/* https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md#case-the-event-handler-is-only-being-used-to-capture-bubbled-events */}\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}\n <StyledInputsWrapperGrid\n cols={mainCols}\n gutter=\"xxs\"\n pr={!withAnyRightController ? '2px' : '0px'}\n onKeyDown={onGlobalKeyDown}\n disabled={disabled}\n onBlur={handleComponentBlurs}\n data-testid={ControlledDateTimePickerDatatestid.CONTAINER}\n getOwnerProps={getProps}\n {...styledsAttrs}\n {...omit(globalAttrs, 'tabIndex', 'autoFocus')}\n {...xstyledAttrs}\n >\n {hideDate ? null : <DateInputs />}\n {hideTime ? null : <TimeInputs />}\n {withAnyRightController ? (\n <Grid cols={rightControlCols}>\n {shouldPreserveClearableSpace ? <ClearButton /> : null}\n {withAnyPicker ? <PickersIcons /> : null}\n </Grid>\n ) : null}\n </StyledInputsWrapperGrid>\n </>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable complexity */\nimport React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { omit } from 'lodash-es';\nimport { ControlledDateTimePickerContext } from '../ControlledDateTimePickerCTX.js';\nimport { StyledInputsWrapperGrid } from './Styleds.js';\nimport { DateInputs } from './DateInputs/DateInputs.js';\nimport { TimeInputs } from './TimeInputs/TimeInputs.js';\nimport { PickersIcons } from './Pickers/PickersIcons.js';\nimport { ClearButton } from './ClearButton/ClearButton.js';\nimport { ControlledDateTimePickerDatatestid } from '../ControlledDateTimePickerDatatestid.js';\n\nexport const ControlledDateTimePickerContent = (): JSX.Element => {\n const {\n props: { hasError, disabled, readOnly, applyAriaDisabled },\n getProps,\n hideDate,\n hideTime,\n withAnyPicker,\n withAnyRightController,\n shouldPreserveClearableSpace,\n isControllerOnly,\n globalAttrs,\n xstyledAttrs,\n onGlobalKeyDown,\n handleComponentBlurs,\n } = useContext(ControlledDateTimePickerContext);\n\n const styledsAttrs = {\n justPicker: hideDate && hideTime,\n withAnyPicker,\n hasError,\n isControllerOnly,\n };\n\n const mainCols = [];\n if (!hideDate) mainCols.push('auto');\n if (!hideTime) mainCols.push('auto');\n if (withAnyRightController) mainCols.push('auto');\n\n const rightControlCols = [];\n if (shouldPreserveClearableSpace) rightControlCols.push('28px');\n if (withAnyPicker) rightControlCols.push('auto');\n\n const onlyPicker = hideDate && hideTime;\n return (\n <>\n {/* The <div> element is catching the component-wise global hotkeys, there is no valid aria role for this */}\n {/* eslint-disable-next-line max-len */}\n {/* https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md#case-the-event-handler-is-only-being-used-to-capture-bubbled-events */}\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}\n <StyledInputsWrapperGrid\n cols={mainCols}\n gutter=\"xxs\"\n pr={!withAnyRightController ? '2px' : '0px'}\n onKeyDown={onGlobalKeyDown}\n disabled={disabled}\n onBlur={handleComponentBlurs}\n data-testid={ControlledDateTimePickerDatatestid.CONTAINER}\n getOwnerProps={getProps}\n onlyPicker={onlyPicker}\n readOnlyStyles={readOnly || applyAriaDisabled}\n {...styledsAttrs}\n {...omit(globalAttrs, 'tabIndex', 'autoFocus')}\n {...xstyledAttrs}\n >\n {hideDate ? null : <DateInputs />}\n {hideTime ? null : <TimeInputs />}\n {withAnyRightController ? (\n <Grid cols={rightControlCols}>\n {shouldPreserveClearableSpace ? <ClearButton /> : null}\n {withAnyPicker ? <PickersIcons /> : null}\n </Grid>\n ) : null}\n </StyledInputsWrapperGrid>\n </>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD8CnB;AA7CJ,mBAAkC;AAClC,qBAAqB;AACrB,uBAAqB;AACrB,yCAAgD;AAChD,qBAAwC;AACxC,wBAA2B;AAC3B,wBAA2B;AAC3B,0BAA6B;AAC7B,yBAA4B;AAC5B,gDAAmD;AAE5C,MAAM,kCAAkC,MAAmB;AAChE,QAAM;AAAA,IACJ,OAAO,EAAE,UAAU,UAAU,UAAU,kBAAkB;AAAA,IACzD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,kEAA+B;AAE9C,QAAM,eAAe;AAAA,IACnB,YAAY,YAAY;AAAA,IACxB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,WAAW,CAAC;AAClB,MAAI,CAAC,SAAU,UAAS,KAAK,MAAM;AACnC,MAAI,CAAC,SAAU,UAAS,KAAK,MAAM;AACnC,MAAI,uBAAwB,UAAS,KAAK,MAAM;AAEhD,QAAM,mBAAmB,CAAC;AAC1B,MAAI,6BAA8B,kBAAiB,KAAK,MAAM;AAC9D,MAAI,cAAe,kBAAiB,KAAK,MAAM;AAE/C,QAAM,aAAa,YAAY;AAC/B,SACE,2EAKE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,MACN,QAAO;AAAA,MACP,IAAI,CAAC,yBAAyB,QAAQ;AAAA,MACtC,WAAW;AAAA,MACX;AAAA,MACA,QAAQ;AAAA,MACR,eAAa,6EAAmC;AAAA,MAChD,eAAe;AAAA,MACf;AAAA,MACA,gBAAgB,YAAY;AAAA,MAC3B,GAAG;AAAA,MACH,OAAG,uBAAK,aAAa,YAAY,WAAW;AAAA,MAC5C,GAAG;AAAA,MAEH;AAAA,mBAAW,OAAO,4CAAC,gCAAW;AAAA,QAC9B,WAAW,OAAO,4CAAC,gCAAW;AAAA,QAC9B,yBACC,6CAAC,uBAAK,MAAM,kBACT;AAAA,yCAA+B,4CAAC,kCAAY,IAAK;AAAA,UACjD,gBAAgB,4CAAC,oCAAa,IAAK;AAAA,WACtC,IACE;AAAA;AAAA;AAAA,EACN,GACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -42,7 +42,10 @@ var import_ControlledDateTimePickerCTX = require("../../../ControlledDateTimePic
|
|
|
42
42
|
var import_CalendarContext = require("./CalendarContext.js");
|
|
43
43
|
var import_Styleds = require("./Styleds.js");
|
|
44
44
|
const CalendarContent = ({ className = "" }) => {
|
|
45
|
-
const {
|
|
45
|
+
const {
|
|
46
|
+
getProps,
|
|
47
|
+
props: { readOnly, applyAriaDisabled }
|
|
48
|
+
} = (0, import_react.useContext)(import_ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
46
49
|
const { daysMatrixByWeekday } = (0, import_react.useContext)(import_CalendarContext.CalendarContext);
|
|
47
50
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
48
51
|
import_Styleds.StyledShadowWrapper,
|
|
@@ -50,7 +53,7 @@ const CalendarContent = ({ className = "" }) => {
|
|
|
50
53
|
className,
|
|
51
54
|
"data-testid": import_ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.CONTROLLER_COMPONENT.CALENDAR,
|
|
52
55
|
getOwnerProps: getProps,
|
|
53
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Styleds.StyledCalendarWrapper, { children: [
|
|
56
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Styleds.StyledCalendarWrapper, { readOnlyStyles: readOnly || applyAriaDisabled, children: [
|
|
54
57
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_CalendarHead.CalendarHead, {}),
|
|
55
58
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_CalendarBody.CalendarBody, { weekRowsNum: daysMatrixByWeekday.length }),
|
|
56
59
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_CalendarFooter.CalendarFooter, {})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Pickers/Calendar/CalendarContent.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-len */\nimport React, { useContext } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid.js';\nimport { CalendarBody } from './CalendarBody.js';\nimport { CalendarHead } from './CalendarHead.js';\nimport { CalendarFooter } from './CalendarFooter.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { CalendarContext } from './CalendarContext.js';\nimport { StyledShadowWrapper, StyledCalendarWrapper } from './Styleds.js';\n\n// ({ className = '' }: { className?: string })\n// <StyledShadowWrapper className={className}>\n// is required for styled-components, without this we can't styled(CalendarContent)...\n// https://stackoverflow.com/questions/52542817/styled-components-not-applying-style-to-custom-functional-react-component\nexport const CalendarContent = ({ className = '' }: { className?: string }): JSX.Element => {\n const {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-len */\nimport React, { useContext } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid.js';\nimport { CalendarBody } from './CalendarBody.js';\nimport { CalendarHead } from './CalendarHead.js';\nimport { CalendarFooter } from './CalendarFooter.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { CalendarContext } from './CalendarContext.js';\nimport { StyledShadowWrapper, StyledCalendarWrapper } from './Styleds.js';\n\n// ({ className = '' }: { className?: string })\n// <StyledShadowWrapper className={className}>\n// is required for styled-components, without this we can't styled(CalendarContent)...\n// https://stackoverflow.com/questions/52542817/styled-components-not-applying-style-to-custom-functional-react-component\nexport const CalendarContent = ({ className = '' }: { className?: string }): JSX.Element => {\n const {\n getProps,\n props: { readOnly, applyAriaDisabled },\n } = useContext(ControlledDateTimePickerContext);\n const { daysMatrixByWeekday } = useContext(CalendarContext);\n\n return (\n <StyledShadowWrapper\n className={className}\n data-testid={ControlledDateTimePickerDatatestid.CONTROLLER_COMPONENT.CALENDAR}\n getOwnerProps={getProps}\n >\n <StyledCalendarWrapper readOnlyStyles={readOnly || applyAriaDisabled}>\n <CalendarHead />\n <CalendarBody weekRowsNum={daysMatrixByWeekday.length} />\n <CalendarFooter />\n </StyledCalendarWrapper>\n </StyledShadowWrapper>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2BjB;AA1BN,mBAAkC;AAClC,gDAAmD;AACnD,0BAA6B;AAC7B,0BAA6B;AAC7B,4BAA+B;AAC/B,yCAAgD;AAChD,6BAAgC;AAChC,qBAA2D;AAMpD,MAAM,kBAAkB,CAAC,EAAE,YAAY,GAAG,MAA2C;AAC1F,QAAM;AAAA,IACJ;AAAA,IACA,OAAO,EAAE,UAAU,kBAAkB;AAAA,EACvC,QAAI,yBAAW,kEAA+B;AAC9C,QAAM,EAAE,oBAAoB,QAAI,yBAAW,sCAAe;AAE1D,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,eAAa,6EAAmC,qBAAqB;AAAA,MACrE,eAAe;AAAA,MAEf,uDAAC,wCAAsB,gBAAgB,YAAY,mBACjD;AAAA,oDAAC,oCAAa;AAAA,QACd,4CAAC,oCAAa,aAAa,oBAAoB,QAAQ;AAAA,QACvD,4CAAC,wCAAe;AAAA,SAClB;AAAA;AAAA,EACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -34,23 +34,36 @@ module.exports = __toCommonJS(CalendarFooter_exports);
|
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
36
|
var import_react = require("react");
|
|
37
|
+
var import_ds_icons = require("@elliemae/ds-icons");
|
|
37
38
|
var import_ControlledDateTimePickerCTX = require("../../../ControlledDateTimePickerCTX.js");
|
|
38
39
|
var import_Styleds = require("./Styleds.js");
|
|
39
40
|
var import_ControlledDateTimePickerDatatestid = require("../../../ControlledDateTimePickerDatatestid.js");
|
|
40
41
|
const CalendarFooter = () => {
|
|
41
42
|
const {
|
|
42
|
-
props: { pickerFooterMsg, hasError },
|
|
43
|
+
props: { pickerFooterMsg, hasError, readOnly, applyAriaDisabled },
|
|
43
44
|
getProps,
|
|
44
45
|
isWithTimeWheelToo
|
|
45
46
|
} = (0, import_react.useContext)(import_ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
46
47
|
if (pickerFooterMsg !== void 0 && !isWithTimeWheelToo && hasError)
|
|
47
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.
|
|
48
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
48
49
|
import_Styleds.CalendarFooterMessage,
|
|
49
50
|
{
|
|
50
51
|
role: "alert",
|
|
51
52
|
getOwnerProps: getProps,
|
|
52
53
|
"data-testid": import_ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.FOOTERS.CALENDAR,
|
|
53
|
-
|
|
54
|
+
readOnlyStyles: readOnly || applyAriaDisabled,
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
57
|
+
import_ds_icons.AlertsSmallFill,
|
|
58
|
+
{
|
|
59
|
+
width: 8,
|
|
60
|
+
height: 8,
|
|
61
|
+
color: ["danger", "900"],
|
|
62
|
+
style: { marginRight: "0.5rem", marginBottom: "2px" }
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
pickerFooterMsg
|
|
66
|
+
]
|
|
54
67
|
}
|
|
55
68
|
);
|
|
56
69
|
return null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Pickers/Calendar/CalendarFooter.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useContext } from 'react';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { CalendarFooterMessage } from './Styleds.js';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid.js';\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React, { useContext } from 'react';\nimport { AlertsSmallFill } from '@elliemae/ds-icons';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\n\nimport { CalendarFooterMessage } from './Styleds.js';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid.js';\nexport const CalendarFooter: React.ComponentType = () => {\n const {\n props: { pickerFooterMsg, hasError, readOnly, applyAriaDisabled },\n getProps,\n isWithTimeWheelToo,\n } = useContext(ControlledDateTimePickerContext);\n if (pickerFooterMsg !== undefined && !isWithTimeWheelToo && hasError)\n return (\n <CalendarFooterMessage\n role=\"alert\"\n getOwnerProps={getProps}\n data-testid={ControlledDateTimePickerDatatestid.FOOTERS.CALENDAR}\n readOnlyStyles={readOnly || applyAriaDisabled}\n >\n <AlertsSmallFill\n width={8}\n height={8}\n color={['danger', '900']}\n style={{ marginRight: '0.5rem', marginBottom: '2px' }}\n />\n {pickerFooterMsg}\n </CalendarFooterMessage>\n );\n return null;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADcjB;AAdN,mBAAkC;AAClC,sBAAgC;AAChC,yCAAgD;AAEhD,qBAAsC;AACtC,gDAAmD;AAC5C,MAAM,iBAAsC,MAAM;AACvD,QAAM;AAAA,IACJ,OAAO,EAAE,iBAAiB,UAAU,UAAU,kBAAkB;AAAA,IAChE;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,kEAA+B;AAC9C,MAAI,oBAAoB,UAAa,CAAC,sBAAsB;AAC1D,WACE;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,eAAe;AAAA,QACf,eAAa,6EAAmC,QAAQ;AAAA,QACxD,gBAAgB,YAAY;AAAA,QAE5B;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,OAAO,CAAC,UAAU,KAAK;AAAA,cACvB,OAAO,EAAE,aAAa,UAAU,cAAc,MAAM;AAAA;AAAA,UACtD;AAAA,UACC;AAAA;AAAA;AAAA,IACH;AAEJ,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -143,6 +143,7 @@ const CalendarHead = () => {
|
|
|
143
143
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
144
144
|
import_Styleds.StyledHeaderLabel,
|
|
145
145
|
{
|
|
146
|
+
"aria-live": "polite",
|
|
146
147
|
"data-testid": import_ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.CALENDAR.HEADER_LABEL,
|
|
147
148
|
getOwnerProps: getProps,
|
|
148
149
|
children: currentFormatedDate
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Pickers/Calendar/CalendarHead.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable complexity, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */\nimport React, { useCallback, useContext, useMemo } from 'react';\nimport { BUTTON_SIZES } from '@elliemae/ds-button-v2';\nimport { ChevronDoubleLeft, ChevronLeft, ChevronDoubleRight, ChevronRight } from '@elliemae/ds-icons';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid.js';\nimport { getMonthNameByMonthNumber } from '../../../utils/dateHelpers.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { StyledHeader, StyledHeaderButton, StyledHeaderLabel } from './Styleds.js';\nimport { CalendarContext } from './CalendarContext.js';\n\nconst useGetFormattedCurrentDate = () => {\n const { currentMonth, currentYear } = useContext(CalendarContext);\n\n const monthString = currentMonth >= 0 && currentMonth <= 11 ? `${getMonthNameByMonthNumber(currentMonth)} ` : '';\n\n return useMemo(() => `${monthString}${currentYear}`, [monthString, currentYear]);\n};\nexport const CalendarHead = (): JSX.Element => {\n const currentFormatedDate = useGetFormattedCurrentDate();\n const {\n handlePrevYear,\n handlePrevMonth,\n handleNextMonth,\n handleNextYear,\n handlePrevYearKeyDown,\n handlePrevMonthKeyDown,\n handleNextMonthKeyDown,\n handleNextYearKeyDown,\n onPrevYearFocus,\n onPrevMonthFocus,\n onNextMonthFocus,\n onNextYearFocus,\n } = useContext(CalendarContext);\n\n const {\n isControllerOnly,\n autoFocusPrevMonthArrow,\n prevYearBtnRef,\n prevMonthBtnRef,\n nextMonthBtnRef,\n nextYearBtnRef,\n latestInteractionRegion,\n currFocusDescriber,\n getProps,\n } = useContext(ControlledDateTimePickerContext);\n\n const handlePrevYearRef = useCallback(\n (ButtonDomNode: HTMLButtonElement) => {\n prevYearBtnRef.current = ButtonDomNode;\n if (latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-prev-year')\n ButtonDomNode?.focus?.();\n },\n [currFocusDescriber, latestInteractionRegion, prevYearBtnRef],\n );\n const handlePrevMonthRef = useCallback(\n (ButtonDomNode: HTMLButtonElement) => {\n prevMonthBtnRef.current = ButtonDomNode;\n if (latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-prev-month')\n ButtonDomNode?.focus?.();\n },\n [currFocusDescriber, latestInteractionRegion, prevMonthBtnRef],\n );\n const handleNextMonthRef = useCallback(\n (ButtonDomNode: HTMLButtonElement) => {\n nextMonthBtnRef.current = ButtonDomNode;\n if (latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-next-month')\n ButtonDomNode?.focus?.();\n },\n [currFocusDescriber, latestInteractionRegion, nextMonthBtnRef],\n );\n const handleNextYearRef = useCallback(\n (ButtonDomNode: HTMLButtonElement) => {\n nextYearBtnRef.current = ButtonDomNode;\n if (latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-next-year')\n ButtonDomNode?.focus?.();\n },\n [currFocusDescriber, latestInteractionRegion, nextYearBtnRef],\n );\n\n return (\n <StyledHeader>\n <StyledHeaderButton\n aria-label=\"previous year\"\n buttonType=\"raw\"\n size={BUTTON_SIZES.M}\n onClick={handlePrevYear}\n innerRef={handlePrevYearRef}\n onKeyDown={handlePrevYearKeyDown}\n onFocus={onPrevYearFocus}\n tabIndex={isControllerOnly ? -1 : 0}\n data-testid={ControlledDateTimePickerDatatestid.CALENDAR.PREV_YEAR}\n type=\"button\"\n getOwnerProps={getProps}\n >\n <ChevronDoubleLeft height={14} width={14} fill=\"#25292f\" />\n </StyledHeaderButton>\n <StyledHeaderButton\n autoFocus={autoFocusPrevMonthArrow}\n aria-label=\"previous month\"\n buttonType=\"raw\"\n size={BUTTON_SIZES.M}\n onClick={handlePrevMonth}\n innerRef={handlePrevMonthRef}\n onKeyDown={handlePrevMonthKeyDown}\n onFocus={onPrevMonthFocus}\n data-testid={ControlledDateTimePickerDatatestid.CALENDAR.PREV_MONTH}\n type=\"button\"\n getOwnerProps={getProps}\n // this is a tabstop for when the calendar is open\n >\n <ChevronLeft height={14} width={14} fill=\"#25292f\" />\n </StyledHeaderButton>\n <StyledHeaderLabel\n data-testid={ControlledDateTimePickerDatatestid.CALENDAR.HEADER_LABEL}\n getOwnerProps={getProps}\n >\n {currentFormatedDate}\n </StyledHeaderLabel>\n <StyledHeaderButton\n aria-label=\"next month\"\n buttonType=\"raw\"\n size={BUTTON_SIZES.M}\n onClick={handleNextMonth}\n innerRef={handleNextMonthRef}\n onKeyDown={handleNextMonthKeyDown}\n onFocus={onNextMonthFocus}\n data-testid={ControlledDateTimePickerDatatestid.CALENDAR.NEXT_MONTH}\n type=\"button\"\n getOwnerProps={getProps}\n >\n <ChevronRight height={14} width={14} fill=\"#25292f\" />\n </StyledHeaderButton>\n <StyledHeaderButton\n aria-label=\"next year\"\n buttonType=\"raw\"\n size={BUTTON_SIZES.M}\n onClick={handleNextYear}\n innerRef={handleNextYearRef}\n onKeyDown={handleNextYearKeyDown}\n onFocus={onNextYearFocus}\n data-testid={ControlledDateTimePickerDatatestid.CALENDAR.NEXT_YEAR}\n type=\"button\"\n getOwnerProps={getProps}\n >\n <ChevronDoubleRight height={14} width={14} fill=\"#25292f\" />\n </StyledHeaderButton>\n </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A;AAAA,QACC,cAAW;AAAA,QACX,YAAW;AAAA,QACX,MAAM,iCAAa;AAAA,QACnB,SAAS;AAAA,QACT,UAAU;AAAA,QACV,WAAW;AAAA,QACX,SAAS;AAAA,QACT,eAAa,6EAAmC,SAAS;AAAA,QACzD,MAAK;AAAA,QACL,eAAe;AAAA,QAEf,sDAAC,gCAAa,QAAQ,IAAI,OAAO,IAAI,MAAK,WAAU;AAAA;AAAA,IACtD;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,cAAW;AAAA,QACX,YAAW;AAAA,QACX,MAAM,iCAAa;AAAA,QACnB,SAAS;AAAA,QACT,UAAU;AAAA,QACV,WAAW;AAAA,QACX,SAAS;AAAA,QACT,eAAa,6EAAmC,SAAS;AAAA,QACzD,MAAK;AAAA,QACL,eAAe;AAAA,QAEf,sDAAC,sCAAmB,QAAQ,IAAI,OAAO,IAAI,MAAK,WAAU;AAAA;AAAA,IAC5D;AAAA,KACF;AAEJ;",
|
|
4
|
+
"sourcesContent": ["/* eslint-disable complexity, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */\nimport React, { useCallback, useContext, useMemo } from 'react';\nimport { BUTTON_SIZES } from '@elliemae/ds-button-v2';\nimport { ChevronDoubleLeft, ChevronLeft, ChevronDoubleRight, ChevronRight } from '@elliemae/ds-icons';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid.js';\nimport { getMonthNameByMonthNumber } from '../../../utils/dateHelpers.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { StyledHeader, StyledHeaderButton, StyledHeaderLabel } from './Styleds.js';\nimport { CalendarContext } from './CalendarContext.js';\n\nconst useGetFormattedCurrentDate = () => {\n const { currentMonth, currentYear } = useContext(CalendarContext);\n\n const monthString = currentMonth >= 0 && currentMonth <= 11 ? `${getMonthNameByMonthNumber(currentMonth)} ` : '';\n\n return useMemo(() => `${monthString}${currentYear}`, [monthString, currentYear]);\n};\nexport const CalendarHead = (): JSX.Element => {\n const currentFormatedDate = useGetFormattedCurrentDate();\n const {\n handlePrevYear,\n handlePrevMonth,\n handleNextMonth,\n handleNextYear,\n handlePrevYearKeyDown,\n handlePrevMonthKeyDown,\n handleNextMonthKeyDown,\n handleNextYearKeyDown,\n onPrevYearFocus,\n onPrevMonthFocus,\n onNextMonthFocus,\n onNextYearFocus,\n } = useContext(CalendarContext);\n\n const {\n isControllerOnly,\n autoFocusPrevMonthArrow,\n prevYearBtnRef,\n prevMonthBtnRef,\n nextMonthBtnRef,\n nextYearBtnRef,\n latestInteractionRegion,\n currFocusDescriber,\n getProps,\n } = useContext(ControlledDateTimePickerContext);\n\n const handlePrevYearRef = useCallback(\n (ButtonDomNode: HTMLButtonElement) => {\n prevYearBtnRef.current = ButtonDomNode;\n if (latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-prev-year')\n ButtonDomNode?.focus?.();\n },\n [currFocusDescriber, latestInteractionRegion, prevYearBtnRef],\n );\n const handlePrevMonthRef = useCallback(\n (ButtonDomNode: HTMLButtonElement) => {\n prevMonthBtnRef.current = ButtonDomNode;\n if (latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-prev-month')\n ButtonDomNode?.focus?.();\n },\n [currFocusDescriber, latestInteractionRegion, prevMonthBtnRef],\n );\n const handleNextMonthRef = useCallback(\n (ButtonDomNode: HTMLButtonElement) => {\n nextMonthBtnRef.current = ButtonDomNode;\n if (latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-next-month')\n ButtonDomNode?.focus?.();\n },\n [currFocusDescriber, latestInteractionRegion, nextMonthBtnRef],\n );\n const handleNextYearRef = useCallback(\n (ButtonDomNode: HTMLButtonElement) => {\n nextYearBtnRef.current = ButtonDomNode;\n if (latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-next-year')\n ButtonDomNode?.focus?.();\n },\n [currFocusDescriber, latestInteractionRegion, nextYearBtnRef],\n );\n\n return (\n <StyledHeader>\n <StyledHeaderButton\n aria-label=\"previous year\"\n buttonType=\"raw\"\n size={BUTTON_SIZES.M}\n onClick={handlePrevYear}\n innerRef={handlePrevYearRef}\n onKeyDown={handlePrevYearKeyDown}\n onFocus={onPrevYearFocus}\n tabIndex={isControllerOnly ? -1 : 0}\n data-testid={ControlledDateTimePickerDatatestid.CALENDAR.PREV_YEAR}\n type=\"button\"\n getOwnerProps={getProps}\n >\n <ChevronDoubleLeft height={14} width={14} fill=\"#25292f\" />\n </StyledHeaderButton>\n <StyledHeaderButton\n autoFocus={autoFocusPrevMonthArrow}\n aria-label=\"previous month\"\n buttonType=\"raw\"\n size={BUTTON_SIZES.M}\n onClick={handlePrevMonth}\n innerRef={handlePrevMonthRef}\n onKeyDown={handlePrevMonthKeyDown}\n onFocus={onPrevMonthFocus}\n data-testid={ControlledDateTimePickerDatatestid.CALENDAR.PREV_MONTH}\n type=\"button\"\n getOwnerProps={getProps}\n // this is a tabstop for when the calendar is open\n >\n <ChevronLeft height={14} width={14} fill=\"#25292f\" />\n </StyledHeaderButton>\n <StyledHeaderLabel\n aria-live=\"polite\"\n data-testid={ControlledDateTimePickerDatatestid.CALENDAR.HEADER_LABEL}\n getOwnerProps={getProps}\n >\n {currentFormatedDate}\n </StyledHeaderLabel>\n <StyledHeaderButton\n aria-label=\"next month\"\n buttonType=\"raw\"\n size={BUTTON_SIZES.M}\n onClick={handleNextMonth}\n innerRef={handleNextMonthRef}\n onKeyDown={handleNextMonthKeyDown}\n onFocus={onNextMonthFocus}\n data-testid={ControlledDateTimePickerDatatestid.CALENDAR.NEXT_MONTH}\n type=\"button\"\n getOwnerProps={getProps}\n >\n <ChevronRight height={14} width={14} fill=\"#25292f\" />\n </StyledHeaderButton>\n <StyledHeaderButton\n aria-label=\"next year\"\n buttonType=\"raw\"\n size={BUTTON_SIZES.M}\n onClick={handleNextYear}\n innerRef={handleNextYearRef}\n onKeyDown={handleNextYearKeyDown}\n onFocus={onNextYearFocus}\n data-testid={ControlledDateTimePickerDatatestid.CALENDAR.NEXT_YEAR}\n type=\"button\"\n getOwnerProps={getProps}\n >\n <ChevronDoubleRight height={14} width={14} fill=\"#25292f\" />\n </StyledHeaderButton>\n </StyledHeader>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADgFnB;AA/EJ,mBAAwD;AACxD,0BAA6B;AAC7B,sBAAiF;AACjF,gDAAmD;AACnD,yBAA0C;AAC1C,yCAAgD;AAChD,qBAAoE;AACpE,6BAAgC;AAEhC,MAAM,6BAA6B,MAAM;AACvC,QAAM,EAAE,cAAc,YAAY,QAAI,yBAAW,sCAAe;AAEhE,QAAM,cAAc,gBAAgB,KAAK,gBAAgB,KAAK,OAAG,8CAA0B,YAAY,CAAC,MAAM;AAE9G,aAAO,sBAAQ,MAAM,GAAG,WAAW,GAAG,WAAW,IAAI,CAAC,aAAa,WAAW,CAAC;AACjF;AACO,MAAM,eAAe,MAAmB;AAC7C,QAAM,sBAAsB,2BAA2B;AACvD,QAAM;AAAA,IACJ;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,sCAAe;AAE9B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,kEAA+B;AAE9C,QAAM,wBAAoB;AAAA,IACxB,CAAC,kBAAqC;AACpC,qBAAe,UAAU;AACzB,UAAI,4BAA4B,mBAAmB,uBAAuB;AACxE,uBAAe,QAAQ;AAAA,IAC3B;AAAA,IACA,CAAC,oBAAoB,yBAAyB,cAAc;AAAA,EAC9D;AACA,QAAM,yBAAqB;AAAA,IACzB,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A,MAAC;AAAA;AAAA,QACC,aAAU;AAAA,QACV,eAAa,6EAAmC,SAAS;AAAA,QACzD,eAAe;AAAA,QAEd;AAAA;AAAA,IACH;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,cAAW;AAAA,QACX,YAAW;AAAA,QACX,MAAM,iCAAa;AAAA,QACnB,SAAS;AAAA,QACT,UAAU;AAAA,QACV,WAAW;AAAA,QACX,SAAS;AAAA,QACT,eAAa,6EAAmC,SAAS;AAAA,QACzD,MAAK;AAAA,QACL,eAAe;AAAA,QAEf,sDAAC,gCAAa,QAAQ,IAAI,OAAO,IAAI,MAAK,WAAU;AAAA;AAAA,IACtD;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,cAAW;AAAA,QACX,YAAW;AAAA,QACX,MAAM,iCAAa;AAAA,QACnB,SAAS;AAAA,QACT,UAAU;AAAA,QACV,WAAW;AAAA,QACX,SAAS;AAAA,QACT,eAAa,6EAAmC,SAAS;AAAA,QACzD,MAAK;AAAA,QACL,eAAe;AAAA,QAEf,sDAAC,sCAAmB,QAAQ,IAAI,OAAO,IAAI,MAAK,WAAU;AAAA;AAAA,IAC5D;AAAA,KACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -43,7 +43,7 @@ var import_Styleds = require("./Styleds.js");
|
|
|
43
43
|
const CalendarIconTrigger = () => {
|
|
44
44
|
const { handleToggleCalendar, handleSetTriggerRef, handlePickerIconKeyDown } = (0, import_react.useContext)(import_CalendarContext.CalendarContext);
|
|
45
45
|
const {
|
|
46
|
-
props: { disabled, tabIndex
|
|
46
|
+
props: { disabled, tabIndex },
|
|
47
47
|
getProps,
|
|
48
48
|
ariaCurrentValueForInputs
|
|
49
49
|
} = (0, import_react.useContext)(import_ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
@@ -60,10 +60,9 @@ const CalendarIconTrigger = () => {
|
|
|
60
60
|
onKeyDown: handlePickerIconKeyDown,
|
|
61
61
|
"data-testid": import_ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.PICKER_ICONS.CALENDAR,
|
|
62
62
|
disabled,
|
|
63
|
-
applyAriaDisabled,
|
|
64
63
|
type: "button",
|
|
65
64
|
getOwnerProps: getProps,
|
|
66
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.DatePicker, {})
|
|
65
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.DatePicker, { color: disabled ? ["neutral", "500"] : ["brand-primary", "800"] })
|
|
67
66
|
}
|
|
68
67
|
),
|
|
69
68
|
[
|
|
@@ -73,7 +72,6 @@ const CalendarIconTrigger = () => {
|
|
|
73
72
|
handleToggleCalendar,
|
|
74
73
|
handlePickerIconKeyDown,
|
|
75
74
|
disabled,
|
|
76
|
-
applyAriaDisabled,
|
|
77
75
|
getProps
|
|
78
76
|
]
|
|
79
77
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Pickers/Calendar/CalendarIconTrigger.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useContext, useMemo } from 'react';\nimport { BUTTON_SIZES } from '@elliemae/ds-button-v2';\nimport { DatePicker } from '@elliemae/ds-icons';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { CalendarContext } from './CalendarContext.js';\nimport { StyledIconTriggerButton } from './Styleds.js';\n// we memoize the Icon for maximum optimization\n// this is particularly usefull due to how usePopper needs to check the references\n// since references are saved in a immutable way, we make sure to shortcircuit useless-re-renders\nexport const CalendarIconTrigger = (): JSX.Element => {\n const { handleToggleCalendar, handleSetTriggerRef, handlePickerIconKeyDown } = useContext(CalendarContext);\n const {\n props: { disabled, tabIndex
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React, { useContext, useMemo } from 'react';\nimport { BUTTON_SIZES } from '@elliemae/ds-button-v2';\nimport { DatePicker } from '@elliemae/ds-icons';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { CalendarContext } from './CalendarContext.js';\nimport { StyledIconTriggerButton } from './Styleds.js';\n// we memoize the Icon for maximum optimization\n// this is particularly usefull due to how usePopper needs to check the references\n// since references are saved in a immutable way, we make sure to shortcircuit useless-re-renders\nexport const CalendarIconTrigger = (): JSX.Element => {\n const { handleToggleCalendar, handleSetTriggerRef, handlePickerIconKeyDown } = useContext(CalendarContext);\n const {\n props: { disabled, tabIndex },\n getProps,\n ariaCurrentValueForInputs,\n } = useContext(ControlledDateTimePickerContext);\n return useMemo(\n () => (\n <StyledIconTriggerButton\n aria-label={`date picker context menu trigger, ${ariaCurrentValueForInputs}`}\n buttonType=\"icon\"\n size={BUTTON_SIZES.M}\n innerRef={handleSetTriggerRef}\n tabIndex={tabIndex}\n onClick={handleToggleCalendar}\n onKeyDown={handlePickerIconKeyDown}\n data-testid={ControlledDateTimePickerDatatestid.PICKER_ICONS.CALENDAR}\n disabled={disabled}\n type=\"button\"\n getOwnerProps={getProps}\n >\n <DatePicker color={disabled ? ['neutral', '500'] : ['brand-primary', '800']} />\n </StyledIconTriggerButton>\n ),\n [\n ariaCurrentValueForInputs,\n handleSetTriggerRef,\n tabIndex,\n handleToggleCalendar,\n handlePickerIconKeyDown,\n disabled,\n getProps,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADgCf;AAhCR,mBAA2C;AAC3C,0BAA6B;AAC7B,sBAA2B;AAC3B,gDAAmD;AACnD,yCAAgD;AAChD,6BAAgC;AAChC,qBAAwC;AAIjC,MAAM,sBAAsB,MAAmB;AACpD,QAAM,EAAE,sBAAsB,qBAAqB,wBAAwB,QAAI,yBAAW,sCAAe;AACzG,QAAM;AAAA,IACJ,OAAO,EAAE,UAAU,SAAS;AAAA,IAC5B;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,kEAA+B;AAC9C,aAAO;AAAA,IACL,MACE;AAAA,MAAC;AAAA;AAAA,QACC,cAAY,qCAAqC,yBAAyB;AAAA,QAC1E,YAAW;AAAA,QACX,MAAM,iCAAa;AAAA,QACnB,UAAU;AAAA,QACV;AAAA,QACA,SAAS;AAAA,QACT,WAAW;AAAA,QACX,eAAa,6EAAmC,aAAa;AAAA,QAC7D;AAAA,QACA,MAAK;AAAA,QACL,eAAe;AAAA,QAEf,sDAAC,8BAAW,OAAO,WAAW,CAAC,WAAW,KAAK,IAAI,CAAC,iBAAiB,KAAK,GAAG;AAAA;AAAA,IAC/E;AAAA,IAEF;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Pickers/Calendar/CalendarWrapper.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useContext } from 'react';\nimport { DSPopperJS } from '@elliemae/ds-popperjs';\nimport { styled } from '@elliemae/ds-system';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { CalendarContent } from './CalendarContent.js';\nimport { CalendarContext } from './CalendarContext.js';\nimport {\n DSControlledDateTimePickerName,\n DSControlledDateTimePickerSlots,\n} from '../../../ControlledDateTimePickerDefinitions.js';\nconst StyledPopper = styled(DSPopperJS, {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.CONTEXTUAL_MENU.CALENDAR,\n})``;\nexport const CalendarWrapper = (): JSX.Element | null => {\n const { isControllerOnly, getProps } = useContext(ControlledDateTimePickerContext);\n const { referenceElement, closeCalendar } = useContext(CalendarContext);\n\n if (isControllerOnly) return <CalendarContent />;\n if (!referenceElement) return null;\n return (\n <StyledPopper\n showPopover\n data-testid={ControlledDateTimePickerDatatestid.CONTEXTUAL_MENU.CALENDAR}\n referenceElement={referenceElement}\n withoutArrow\n onClickOutside={closeCalendar}\n getOwnerProps={getProps}\n aria-label=\"calendar header\"\n >\n <CalendarContent />\n </StyledPopper>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmBQ;AAnB/B,mBAAkC;AAClC,yBAA2B;AAC3B,uBAAuB;AACvB,gDAAmD;AACnD,yCAAgD;AAChD,6BAAgC;AAChC,6BAAgC;AAChC,iDAGO;AACP,MAAM,mBAAe,yBAAO,+BAAY;AAAA,EACtC,MAAM;AAAA,EACN,MAAM,2EAAgC,gBAAgB;AACxD,CAAC;AACM,MAAM,kBAAkB,MAA0B;AACvD,QAAM,EAAE,kBAAkB,SAAS,QAAI,yBAAW,kEAA+B;AACjF,QAAM,EAAE,kBAAkB,cAAc,QAAI,yBAAW,sCAAe;AAEtE,MAAI,iBAAkB,QAAO,4CAAC,0CAAgB;AAC9C,MAAI,CAAC,iBAAkB,QAAO;AAC9B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAW;AAAA,MACX,eAAa,6EAAmC,gBAAgB;AAAA,MAChE;AAAA,MACA,cAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,eAAe;AAAA,MACf,cAAW;AAAA,
|
|
4
|
+
"sourcesContent": ["import React, { useContext } from 'react';\nimport { DSPopperJS } from '@elliemae/ds-popperjs';\nimport { styled } from '@elliemae/ds-system';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { CalendarContent } from './CalendarContent.js';\nimport { CalendarContext } from './CalendarContext.js';\nimport {\n DSControlledDateTimePickerName,\n DSControlledDateTimePickerSlots,\n} from '../../../ControlledDateTimePickerDefinitions.js';\nconst StyledPopper = styled(DSPopperJS, {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.CONTEXTUAL_MENU.CALENDAR,\n})``;\nexport const CalendarWrapper = (): JSX.Element | null => {\n const { isControllerOnly, getProps } = useContext(ControlledDateTimePickerContext);\n const { referenceElement, closeCalendar } = useContext(CalendarContext);\n\n if (isControllerOnly) return <CalendarContent />;\n if (!referenceElement) return null;\n return (\n <StyledPopper\n showPopover\n data-testid={ControlledDateTimePickerDatatestid.CONTEXTUAL_MENU.CALENDAR}\n referenceElement={referenceElement}\n withoutArrow\n onClickOutside={closeCalendar}\n getOwnerProps={getProps}\n aria-label=\"calendar header\"\n role=\"dialog\"\n >\n <CalendarContent />\n </StyledPopper>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmBQ;AAnB/B,mBAAkC;AAClC,yBAA2B;AAC3B,uBAAuB;AACvB,gDAAmD;AACnD,yCAAgD;AAChD,6BAAgC;AAChC,6BAAgC;AAChC,iDAGO;AACP,MAAM,mBAAe,yBAAO,+BAAY;AAAA,EACtC,MAAM;AAAA,EACN,MAAM,2EAAgC,gBAAgB;AACxD,CAAC;AACM,MAAM,kBAAkB,MAA0B;AACvD,QAAM,EAAE,kBAAkB,SAAS,QAAI,yBAAW,kEAA+B;AACjF,QAAM,EAAE,kBAAkB,cAAc,QAAI,yBAAW,sCAAe;AAEtE,MAAI,iBAAkB,QAAO,4CAAC,0CAAgB;AAC9C,MAAI,CAAC,iBAAkB,QAAO;AAC9B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAW;AAAA,MACX,eAAa,6EAAmC,gBAAgB;AAAA,MAChE;AAAA,MACA,cAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,eAAe;AAAA,MACf,cAAW;AAAA,MACX,MAAK;AAAA,MAEL,sDAAC,0CAAgB;AAAA;AAAA,EACnB;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -138,7 +138,8 @@ const Day = ({ metaDay, colIndex, isInvisible }) => {
|
|
|
138
138
|
trackFocusCalendarMetafocusedDay();
|
|
139
139
|
}, [trackFocusCalendarMetafocusedDay]);
|
|
140
140
|
const dayClassModifiers = (0, import_react.useMemo)(
|
|
141
|
-
() => `dayWrapper ${isSelected ? "selectedDay " : ""}${isDisabled ? "disabledDay " : ""}${isOutOfRange ? "outOfRangeDay " : ""}${isFocused ? "focusedDay " : ""}${isStartRangeDay ? "startRangeDay " : ""}${isDayInRangeImproper ? "inRangeImproperDay " : ""}${isDayInRange ? "inRangeDay " : ""}${isEndRangeDay ? "endRangeDay " : ""}${isCurrMonthDay ? "" : "notCurrentMonth"}
|
|
141
|
+
() => `dayWrapper ${isSelected ? "selectedDay " : ""}${isDisabled ? "disabledDay " : ""}${isOutOfRange ? "outOfRangeDay " : ""}${isFocused ? "focusedDay " : ""}${isStartRangeDay ? "startRangeDay " : ""}${isDayInRangeImproper ? "inRangeImproperDay " : ""}${isDayInRange ? "inRangeDay " : ""}${isEndRangeDay ? "endRangeDay " : ""}${isCurrMonthDay ? "" : "notCurrentMonth"}
|
|
142
|
+
${readOnly || applyAriaDisabled ? "readOnly" : ""}`,
|
|
142
143
|
[
|
|
143
144
|
isSelected,
|
|
144
145
|
isDisabled,
|
|
@@ -148,7 +149,9 @@ const Day = ({ metaDay, colIndex, isInvisible }) => {
|
|
|
148
149
|
isDayInRangeImproper,
|
|
149
150
|
isDayInRange,
|
|
150
151
|
isEndRangeDay,
|
|
151
|
-
isCurrMonthDay
|
|
152
|
+
isCurrMonthDay,
|
|
153
|
+
readOnly,
|
|
154
|
+
applyAriaDisabled
|
|
152
155
|
]
|
|
153
156
|
);
|
|
154
157
|
let dataTestid = import_ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.CALENDAR.DAY;
|
|
@@ -192,6 +195,7 @@ const Day = ({ metaDay, colIndex, isInvisible }) => {
|
|
|
192
195
|
"data-testid": dataTestid,
|
|
193
196
|
type: "button",
|
|
194
197
|
getOwnerProps: getProps,
|
|
198
|
+
readOnlyStyles: readOnly || applyAriaDisabled,
|
|
195
199
|
children: `${day.getDate()}`
|
|
196
200
|
}
|
|
197
201
|
),
|
|
@@ -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 React, { useContext, useCallback, useMemo } from 'react';\nimport { useLiveRegion } from '@elliemae/ds-accessibility';\nimport {\n getDateStringFromDay,\n getDayFromDateString,\n getDateValuesFromDate,\n isSameDateMoment,\n compareTwoDatesDayEquality,\n} from '../../../utils/dateHelpers.js';\nimport { defaultMetaInfo, weekDays } from '../../../utils/constants.js';\nimport { getAriaDayFromDateString } from '../../../utils/stringHelpers.js';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { CalendarContext } from './CalendarContext.js';\nimport { StyledDayBtn } from './Styleds.js';\nimport type { DSControlledDateTimePickerT } from '../../../react-desc-prop-types.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../../sharedTypes.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 [\n isSelected,\n isDisabled,\n isOutOfRange,\n isFocused,\n isStartRangeDay,\n isDayInRangeImproper,\n isDayInRange,\n isEndRangeDay,\n isCurrMonthDay,\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 >\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 React, { useContext, useCallback, useMemo } from 'react';\nimport { useLiveRegion } from '@elliemae/ds-accessibility';\nimport {\n getDateStringFromDay,\n getDayFromDateString,\n getDateValuesFromDate,\n isSameDateMoment,\n compareTwoDatesDayEquality,\n} from '../../../utils/dateHelpers.js';\nimport { defaultMetaInfo, weekDays } from '../../../utils/constants.js';\nimport { getAriaDayFromDateString } from '../../../utils/stringHelpers.js';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { CalendarContext } from './CalendarContext.js';\nimport { StyledDayBtn } from './Styleds.js';\nimport type { DSControlledDateTimePickerT } from '../../../react-desc-prop-types.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../../sharedTypes.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 </StyledDay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;AAAA,EACnF;AACA,MAAI,aAAc,cAAa,6EAAmC,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,YACV,UAAU;AAAA,YACV,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": []
|
|
7
7
|
}
|
|
@@ -88,7 +88,7 @@ const StyledIconTriggerButton = (0, import_ds_system.styled)(import_ds_button_v2
|
|
|
88
88
|
name: import_ControlledDateTimePickerDefinitions.DSControlledDateTimePickerName,
|
|
89
89
|
slot: import_ControlledDateTimePickerDefinitions.DSControlledDateTimePickerSlots.PICKER_ICONS.CALENDAR
|
|
90
90
|
})`
|
|
91
|
-
color: ${({ theme }) => theme.colors.brand["
|
|
91
|
+
color: ${({ theme }) => theme.colors.brand["800"]};
|
|
92
92
|
width: 2rem;
|
|
93
93
|
height: 2rem;
|
|
94
94
|
`;
|
|
@@ -99,7 +99,7 @@ const StyledShadowWrapper = (0, import_ds_system.styled)("div", {
|
|
|
99
99
|
const StyledCalendarWrapper = import_ds_system.styled.div`
|
|
100
100
|
display: grid;
|
|
101
101
|
min-width: 260px;
|
|
102
|
-
background-color: ${({ theme }) => theme.colors.neutral["000"]};
|
|
102
|
+
background-color: ${({ theme, readOnlyStyles }) => readOnlyStyles ? theme.colors.neutral["050"] : theme.colors.neutral["000"]};
|
|
103
103
|
grid-template-rows: auto auto;
|
|
104
104
|
`;
|
|
105
105
|
const StyledHeader = import_ds_system.styled.section`
|
|
@@ -192,7 +192,6 @@ const StyledWeekDaysListWrapper = (0, import_ds_system.styled)(import_ds_grid.Gr
|
|
|
192
192
|
color: ${({ theme }) => theme.colors.neutral["000"]};
|
|
193
193
|
font-weight: ${({ theme }) => theme.fontWeights.semibold};
|
|
194
194
|
}
|
|
195
|
-
|
|
196
195
|
&:not(.disabledDay),
|
|
197
196
|
&:not(.outOfRangeDay) {
|
|
198
197
|
${StyledDayBtn} {
|
|
@@ -249,12 +248,16 @@ const StyledWeekDaysListWrapper = (0, import_ds_system.styled)(import_ds_grid.Gr
|
|
|
249
248
|
.dayWrapper.focusedDay {
|
|
250
249
|
${StyledDayBtn} {
|
|
251
250
|
${focusBorder}
|
|
252
|
-
color: ${({ theme }) => theme.colors.brand[600]};
|
|
253
251
|
&:after {
|
|
254
252
|
border: 2px solid ${({ theme }) => theme.colors.brand[700]};
|
|
255
253
|
}
|
|
256
254
|
}
|
|
257
255
|
|
|
256
|
+
&:not(.readOnly) {
|
|
257
|
+
${StyledDayBtn} {
|
|
258
|
+
color: ${({ theme }) => theme.colors.brand[600]};
|
|
259
|
+
}
|
|
260
|
+
}
|
|
258
261
|
&.disabledDay,
|
|
259
262
|
&.outOfRangeDay {
|
|
260
263
|
${StyledDayBtn} {
|
|
@@ -264,6 +267,11 @@ const StyledWeekDaysListWrapper = (0, import_ds_system.styled)(import_ds_grid.Gr
|
|
|
264
267
|
}
|
|
265
268
|
}
|
|
266
269
|
}
|
|
270
|
+
&.selectedDay {
|
|
271
|
+
${StyledDayBtn} {
|
|
272
|
+
color: ${({ theme }) => theme.colors.neutral["000"]};
|
|
273
|
+
}
|
|
274
|
+
}
|
|
267
275
|
}
|
|
268
276
|
|
|
269
277
|
.dayWrapper.selectedDay.disabledDay.focusedDay {
|
|
@@ -275,6 +283,33 @@ const StyledWeekDaysListWrapper = (0, import_ds_system.styled)(import_ds_grid.Gr
|
|
|
275
283
|
}
|
|
276
284
|
}
|
|
277
285
|
|
|
286
|
+
.dayWrapper.readOnly {
|
|
287
|
+
${StyledDayBtn} {
|
|
288
|
+
:hover {
|
|
289
|
+
cursor: not-allowed;
|
|
290
|
+
background-color: ${({ theme }) => theme.colors.neutral["100"]};
|
|
291
|
+
color: ${({ theme }) => theme.colors.neutral["700"]};
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.dayWrapper.selectedDay.readOnly {
|
|
297
|
+
${StyledDayBtn} {
|
|
298
|
+
background-color: ${({ theme }) => theme.colors.neutral["500"]};
|
|
299
|
+
font-weight: semibold;
|
|
300
|
+
color: ${({ theme }) => theme.colors.neutral["000"]};
|
|
301
|
+
&:before {
|
|
302
|
+
background-color: ${({ theme }) => theme.colors.neutral["000"]};
|
|
303
|
+
}
|
|
304
|
+
:hover {
|
|
305
|
+
background-color: ${({ theme }) => theme.colors.neutral["700"]};
|
|
306
|
+
}
|
|
307
|
+
:focus {
|
|
308
|
+
background-color: ${({ theme }) => theme.colors.neutral["700"]};
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
278
313
|
.dayWrapper.notCurrentMonth {
|
|
279
314
|
${StyledDayBtn} {
|
|
280
315
|
color: ${({ theme }) => theme.colors.neutral[500]};
|
|
@@ -388,10 +423,8 @@ const CalendarFooterMessage = (0, import_ds_system.styled)("div", {
|
|
|
388
423
|
margin: 0 ${({ theme }) => theme.space.xxs2};
|
|
389
424
|
padding: ${({ theme }) => theme.space.xxs2} 0;
|
|
390
425
|
color: ${({ theme }) => theme.colors.danger[900]};
|
|
391
|
-
font-style: italic;
|
|
392
|
-
font-weight: ${({ theme }) => theme.fontWeights.thin};
|
|
393
426
|
font-size: ${({ theme }) => theme.fontSizes.microText[200]};
|
|
394
427
|
text-align: right;
|
|
395
|
-
background-color:
|
|
428
|
+
background-color: ${({ theme, readOnlyStyles }) => readOnlyStyles ? theme.colors.neutral["050"] : theme.colors.neutral["000"]};
|
|
396
429
|
`;
|
|
397
430
|
//# sourceMappingURL=Styleds.js.map
|