@elliemae/ds-form-date-time-picker 3.60.0-next.9 → 3.61.0-rc.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/useControlledDateTimePicker.js +4 -0
- package/dist/cjs/config/useControlledDateTimePicker.js.map +2 -2
- package/dist/cjs/config/useFocusTracker.js +23 -12
- package/dist/cjs/config/useFocusTracker.js.map +2 -2
- package/dist/cjs/constants/index.js +15 -1
- package/dist/cjs/constants/index.js.map +2 -2
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/package.json +1 -4
- package/dist/cjs/parts/ControlledDateTimePickerContent.js +1 -1
- package/dist/cjs/parts/ControlledDateTimePickerContent.js.map +2 -2
- package/dist/cjs/parts/DateInputs/DDInput.js +9 -1
- package/dist/cjs/parts/DateInputs/DDInput.js.map +3 -3
- package/dist/cjs/parts/DateInputs/MMInput.js +9 -1
- package/dist/cjs/parts/DateInputs/MMInput.js.map +3 -3
- package/dist/cjs/parts/DateInputs/YYYYInput.js +9 -1
- package/dist/cjs/parts/DateInputs/YYYYInput.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarContent.js +1 -1
- package/dist/cjs/parts/Pickers/Calendar/CalendarContent.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarDaysList.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarFooter.js +1 -1
- package/dist/cjs/parts/Pickers/Calendar/CalendarFooter.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/Day.js +59 -74
- package/dist/cjs/parts/Pickers/Calendar/Day.js.map +3 -3
- package/dist/cjs/parts/Pickers/Calendar/Styleds.js +201 -73
- 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/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js +1 -1
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js.map +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js +1 -1
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js.map +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/Styleds.js +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/Styleds.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js +36 -23
- package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js +121 -60
- package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js +46 -33
- package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/Styleds.js +111 -92
- package/dist/cjs/parts/Pickers/TimeWheel/Styleds.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContent.js +1 -1
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContent.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelFooter.js +1 -1
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelFooter.js.map +2 -2
- package/dist/cjs/parts/Styleds.js +7 -4
- package/dist/cjs/parts/Styleds.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/HHInput.js +8 -1
- package/dist/cjs/parts/TimeInputs/HHInput.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/MinutesInput.js +8 -1
- package/dist/cjs/parts/TimeInputs/MinutesInput.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +3 -0
- package/dist/cjs/react-desc-prop-types.js.map +3 -3
- 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/constants.js +9 -9
- package/dist/cjs/utils/constants.js.map +1 -1
- package/dist/cjs/utils/dateHelpers.js.map +2 -2
- package/dist/esm/config/useControlledDateTimePicker.js +5 -1
- package/dist/esm/config/useControlledDateTimePicker.js.map +2 -2
- package/dist/esm/config/useFocusTracker.js +23 -12
- package/dist/esm/config/useFocusTracker.js.map +2 -2
- package/dist/esm/constants/index.js +15 -1
- package/dist/esm/constants/index.js.map +2 -2
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/package.json +1 -4
- package/dist/esm/parts/ControlledDateTimePickerContent.js +1 -1
- package/dist/esm/parts/ControlledDateTimePickerContent.js.map +2 -2
- package/dist/esm/parts/DateInputs/DDInput.js +9 -1
- package/dist/esm/parts/DateInputs/DDInput.js.map +2 -2
- package/dist/esm/parts/DateInputs/MMInput.js +9 -1
- package/dist/esm/parts/DateInputs/MMInput.js.map +2 -2
- package/dist/esm/parts/DateInputs/YYYYInput.js +9 -1
- package/dist/esm/parts/DateInputs/YYYYInput.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarContent.js +1 -1
- package/dist/esm/parts/Pickers/Calendar/CalendarContent.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarDaysList.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarFooter.js +1 -1
- package/dist/esm/parts/Pickers/Calendar/CalendarFooter.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/Day.js +61 -82
- package/dist/esm/parts/Pickers/Calendar/Day.js.map +3 -3
- package/dist/esm/parts/Pickers/Calendar/Styleds.js +201 -73
- 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/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js +1 -1
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js.map +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js +1 -1
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js.map +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/Styleds.js +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/Styleds.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/HoursList.js +37 -24
- package/dist/esm/parts/Pickers/TimeWheel/HoursList.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js +123 -62
- package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js +47 -34
- package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/Styleds.js +111 -92
- package/dist/esm/parts/Pickers/TimeWheel/Styleds.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContent.js +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContent.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelFooter.js +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelFooter.js.map +2 -2
- package/dist/esm/parts/Styleds.js +7 -4
- package/dist/esm/parts/Styleds.js.map +2 -2
- package/dist/esm/parts/TimeInputs/HHInput.js +8 -1
- package/dist/esm/parts/TimeInputs/HHInput.js.map +2 -2
- package/dist/esm/parts/TimeInputs/MinutesInput.js +8 -1
- package/dist/esm/parts/TimeInputs/MinutesInput.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js +3 -0
- package/dist/esm/react-desc-prop-types.js.map +3 -3
- 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/constants.js +9 -9
- package/dist/esm/utils/constants.js.map +1 -1
- package/dist/esm/utils/dateHelpers.js.map +2 -2
- package/dist/types/config/useControlledDateTimePicker.d.ts +1 -0
- package/dist/types/config/useFocusTracker.d.ts +1 -1
- package/dist/types/config/useGetFlags.d.ts +2 -2
- package/dist/types/config/useGetReferences.d.ts +2 -2
- package/dist/types/constants/index.d.ts +6 -0
- 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 +15 -14
- 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/CalendarWithTimeWheel/Styleds.d.ts +2 -2
- package/dist/types/parts/Pickers/TimeWheel/Styleds.d.ts +19 -17
- package/dist/types/parts/Styleds.d.ts +1 -1
- package/dist/types/react-desc-prop-types.d.ts +51 -35
- package/dist/types/sharedTypes.d.ts +0 -9
- package/dist/types/slot-arguments-polymorphic-typescript.d.ts +80 -0
- package/dist/types/tests/DSControlledDateTimePicker.data-testid.test.d.ts +1 -0
- package/dist/types/tests/DSControlledDateTimePicker.exports.test.d.ts +1 -0
- package/dist/types/tests/custom-props/customProps.d.ts +4 -4
- package/dist/types/tests/playwright-tests/full/ControlledTestRenderer.d.ts +2 -0
- package/dist/types/tests/playwright-tests/full/DSControlledDateTimePicker.full.navigation.test.playwright.d.ts +1 -0
- package/dist/types/typescript-testing/slot-arguments-engine.d.ts +95 -0
- package/dist/types/utils/constants.d.ts +9 -9
- package/dist/types/utils/dateHelpers.d.ts +1 -1
- package/package.json +31 -32
- /package/dist/types/tests/{date-time-picker.calendar-navigation-days.test.d.ts → DSControlledDateTimePicker.PUI-17323.test.d.ts} +0 -0
|
@@ -34,6 +34,7 @@ module.exports = __toCommonJS(useControlledDateTimePicker_exports);
|
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
37
|
+
var import_uid = require("uid");
|
|
37
38
|
var import_useGetPropsWithDefault = require("./useGetPropsWithDefault.js");
|
|
38
39
|
var import_useFocusTracker = require("./useFocusTracker.js");
|
|
39
40
|
var import_useGetFlags = require("./useGetFlags.js");
|
|
@@ -46,6 +47,7 @@ var import_useGlobalKeyHandlers = require("./useGlobalKeyHandlers.js");
|
|
|
46
47
|
var import_useValidateProps = require("./useValidateProps.js");
|
|
47
48
|
const useControlledDateTimePicker = (props) => {
|
|
48
49
|
(0, import_useValidateProps.useValidateProps)(props);
|
|
50
|
+
const instanceUid = (0, import_react.useMemo)(() => `ds-dtp-${(0, import_uid.uid)(6)}`, []);
|
|
49
51
|
const propsWithDefaults = (0, import_useGetPropsWithDefault.useGetDatePickerWithDefaultsProps)(props);
|
|
50
52
|
const flags = (0, import_useGetFlags.useGetFlags)(propsWithDefaults);
|
|
51
53
|
const DOMRefs = (0, import_useGetReferences.useGetReferences)(flags);
|
|
@@ -72,6 +74,7 @@ const useControlledDateTimePicker = (props) => {
|
|
|
72
74
|
props: propsWithDefaults,
|
|
73
75
|
getProps,
|
|
74
76
|
ariaCurrentValueForInputs,
|
|
77
|
+
instanceUid,
|
|
75
78
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
76
79
|
xstyledAttrs,
|
|
77
80
|
globalAttrs,
|
|
@@ -88,6 +91,7 @@ const useControlledDateTimePicker = (props) => {
|
|
|
88
91
|
propsWithDefaults,
|
|
89
92
|
getProps,
|
|
90
93
|
ariaCurrentValueForInputs,
|
|
94
|
+
instanceUid,
|
|
91
95
|
xstyledAttrs,
|
|
92
96
|
globalAttrs,
|
|
93
97
|
focusTrackers,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useControlledDateTimePicker.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useCallback } from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';\nimport { useGetDatePickerWithDefaultsProps } from './useGetPropsWithDefault.js';\nimport { useFocusTracker } from './useFocusTracker.js';\nimport { useGetFlags } from './useGetFlags.js';\nimport { useGetReferences } from './useGetReferences.js';\nimport { useRelevantValueFromProps } from './useRelevantValueFromProps.js';\nimport { useGetPropsBasedOnType } from './useGetPropsBasedOnType.js';\nimport { useGetDestructuredValues } from './useGetDestructuredValues.js';\nimport { useChangeHandlers } from './useChangeHandlers.js';\nimport { useGlobalKeyHandlers } from './useGlobalKeyHandlers.js';\nimport { useValidateProps } from './useValidateProps.js';\nimport type { DSControlledDateTimePickerT } from '../react-desc-prop-types.js';\n\nexport type ControlledDateTimePickerContextT = ReturnType<typeof useGetFlags> &\n ReturnType<typeof useFocusTracker> &\n ReturnType<typeof useGetReferences> &\n ReturnType<typeof useGetPropsBasedOnType> &\n ReturnType<typeof useRelevantValueFromProps> &\n ReturnType<typeof useGetDestructuredValues> &\n ReturnType<typeof useChangeHandlers> &\n ReturnType<typeof useGlobalKeyHandlers> & {\n props: DSControlledDateTimePickerT.InternalProps;\n getProps: () => DSControlledDateTimePickerT.InternalProps;\n ariaCurrentValueForInputs: string;\n globalAttrs: Record<string, unknown>;\n xstyledAttrs: Record<string, unknown>;\n };\n\nexport const useControlledDateTimePicker = (\n props: DSControlledDateTimePickerT.Props,\n): ControlledDateTimePickerContextT => {\n // if we detect wrong props configuration we throw meaningful errors\n useValidateProps(props);\n\n const propsWithDefaults = useGetDatePickerWithDefaultsProps(props);\n\n const flags = useGetFlags(propsWithDefaults);\n const DOMRefs = useGetReferences(flags); // refs are used for \"auto-advance\" feature\n const focusTrackers = useFocusTracker({ DOMRefs, flags });\n const relevantValues = useRelevantValueFromProps(propsWithDefaults);\n const propsBasedOnType = useGetPropsBasedOnType(propsWithDefaults);\n const destructuredValues = useGetDestructuredValues({ ...propsBasedOnType, ...flags });\n const changeHandlers = useChangeHandlers({\n relevantValues,\n destructuredValues,\n propsBasedOnType,\n DOMRefs,\n focusTrackers,\n });\n\n const globalKeyHandlers = useGlobalKeyHandlers({ changeHandlers, propsBasedOnType, DOMRefs, flags, focusTrackers });\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n // const dataAttrs = getDataProps<DSControlledDateTimePickerT.InternalProps>(propsWithDefaults);\n\n const xstyledAttrs = useGetXstyledProps(propsWithDefaults) as Record<string, unknown>;\n\n const globalAttrs = useGetGlobalAttributes(propsWithDefaults) as Record<string, unknown>;\n\n const { announcedDateValues, announcedTimeValues } = destructuredValues;\n const { isWithDateInputs, isDateTimeSelector, isWithTimeInputs } = flags;\n\n const ariaCurrentValueForInputs = `current values: ${isWithDateInputs ? `${announcedDateValues}` : ''}${\n isDateTimeSelector ? ', ' : ''\n }${isWithTimeInputs ? `${announcedTimeValues}` : ''}`;\n\n const getProps = useCallback(() => propsWithDefaults, [propsWithDefaults]);\n\n const ctx = React.useMemo(\n () => ({\n props: propsWithDefaults,\n getProps,\n ariaCurrentValueForInputs,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n xstyledAttrs,\n globalAttrs,\n ...focusTrackers,\n ...flags,\n ...DOMRefs,\n ...relevantValues,\n ...propsBasedOnType,\n ...destructuredValues,\n ...changeHandlers,\n ...globalKeyHandlers,\n }),\n [\n propsWithDefaults,\n getProps,\n ariaCurrentValueForInputs,\n xstyledAttrs,\n globalAttrs,\n focusTrackers,\n flags,\n DOMRefs,\n relevantValues,\n propsBasedOnType,\n destructuredValues,\n changeHandlers,\n globalKeyHandlers,\n ],\n );\n\n return ctx;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,
|
|
4
|
+
"sourcesContent": ["import React, { useCallback, useMemo } from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { useGetDatePickerWithDefaultsProps } from './useGetPropsWithDefault.js';\nimport { useFocusTracker } from './useFocusTracker.js';\nimport { useGetFlags } from './useGetFlags.js';\nimport { useGetReferences } from './useGetReferences.js';\nimport { useRelevantValueFromProps } from './useRelevantValueFromProps.js';\nimport { useGetPropsBasedOnType } from './useGetPropsBasedOnType.js';\nimport { useGetDestructuredValues } from './useGetDestructuredValues.js';\nimport { useChangeHandlers } from './useChangeHandlers.js';\nimport { useGlobalKeyHandlers } from './useGlobalKeyHandlers.js';\nimport { useValidateProps } from './useValidateProps.js';\nimport type { DSControlledDateTimePickerT } from '../react-desc-prop-types.js';\n\nexport type ControlledDateTimePickerContextT = ReturnType<typeof useGetFlags> &\n ReturnType<typeof useFocusTracker> &\n ReturnType<typeof useGetReferences> &\n ReturnType<typeof useGetPropsBasedOnType> &\n ReturnType<typeof useRelevantValueFromProps> &\n ReturnType<typeof useGetDestructuredValues> &\n ReturnType<typeof useChangeHandlers> &\n ReturnType<typeof useGlobalKeyHandlers> & {\n props: DSControlledDateTimePickerT.InternalProps;\n getProps: () => DSControlledDateTimePickerT.InternalProps;\n ariaCurrentValueForInputs: string;\n globalAttrs: Record<string, unknown>;\n xstyledAttrs: Record<string, unknown>;\n instanceUid: string;\n };\n\nexport const useControlledDateTimePicker = (\n props: DSControlledDateTimePickerT.Props,\n): ControlledDateTimePickerContextT => {\n // if we detect wrong props configuration we throw meaningful errors\n useValidateProps(props);\n\n const instanceUid = useMemo(() => `ds-dtp-${uid(6)}`, []);\n const propsWithDefaults = useGetDatePickerWithDefaultsProps(props);\n\n const flags = useGetFlags(propsWithDefaults);\n const DOMRefs = useGetReferences(flags); // refs are used for \"auto-advance\" feature\n const focusTrackers = useFocusTracker({ DOMRefs, flags });\n const relevantValues = useRelevantValueFromProps(propsWithDefaults);\n const propsBasedOnType = useGetPropsBasedOnType(propsWithDefaults);\n const destructuredValues = useGetDestructuredValues({ ...propsBasedOnType, ...flags });\n const changeHandlers = useChangeHandlers({\n relevantValues,\n destructuredValues,\n propsBasedOnType,\n DOMRefs,\n focusTrackers,\n });\n\n const globalKeyHandlers = useGlobalKeyHandlers({ changeHandlers, propsBasedOnType, DOMRefs, flags, focusTrackers });\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n // const dataAttrs = getDataProps<DSControlledDateTimePickerT.InternalProps>(propsWithDefaults);\n\n const xstyledAttrs = useGetXstyledProps(propsWithDefaults) as Record<string, unknown>;\n\n const globalAttrs = useGetGlobalAttributes(propsWithDefaults) as Record<string, unknown>;\n\n const { announcedDateValues, announcedTimeValues } = destructuredValues;\n const { isWithDateInputs, isDateTimeSelector, isWithTimeInputs } = flags;\n\n const ariaCurrentValueForInputs = `current values: ${isWithDateInputs ? `${announcedDateValues}` : ''}${\n isDateTimeSelector ? ', ' : ''\n }${isWithTimeInputs ? `${announcedTimeValues}` : ''}`;\n\n const getProps = useCallback(() => propsWithDefaults, [propsWithDefaults]);\n\n const ctx = React.useMemo(\n () => ({\n props: propsWithDefaults,\n getProps,\n ariaCurrentValueForInputs,\n instanceUid,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n xstyledAttrs,\n globalAttrs,\n ...focusTrackers,\n ...flags,\n ...DOMRefs,\n ...relevantValues,\n ...propsBasedOnType,\n ...destructuredValues,\n ...changeHandlers,\n ...globalKeyHandlers,\n }),\n [\n propsWithDefaults,\n getProps,\n ariaCurrentValueForInputs,\n instanceUid,\n xstyledAttrs,\n globalAttrs,\n focusTrackers,\n flags,\n DOMRefs,\n relevantValues,\n propsBasedOnType,\n destructuredValues,\n changeHandlers,\n globalKeyHandlers,\n ],\n );\n\n return ctx;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA4C;AAC5C,8BAA2D;AAC3D,iBAAoB;AACpB,oCAAkD;AAClD,6BAAgC;AAChC,yBAA4B;AAC5B,8BAAiC;AACjC,uCAA0C;AAC1C,oCAAuC;AACvC,sCAAyC;AACzC,+BAAkC;AAClC,kCAAqC;AACrC,8BAAiC;AAmB1B,MAAM,8BAA8B,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AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -37,7 +37,7 @@ const useFocusTracker = ({ DOMRefs, flags }) => {
|
|
|
37
37
|
const [latestInteractionRegion, setLatestInteractionRegion] = (0, import_react.useState)("");
|
|
38
38
|
const [currFocusDescriber, setCurrFocusDescriber] = (0, import_react.useState)("");
|
|
39
39
|
const { firstSegment, lastSegment } = DOMRefs;
|
|
40
|
-
const { isDateSelector, isTimeSelector } = flags;
|
|
40
|
+
const { isDateSelector, isTimeSelector, isControllerOnly } = flags;
|
|
41
41
|
const trackFocusPicker = (0, import_react.useCallback)(() => {
|
|
42
42
|
let picker = "datetime-picker-icon";
|
|
43
43
|
if (isDateSelector) picker = "date-picker-icon";
|
|
@@ -68,17 +68,28 @@ const useFocusTracker = ({ DOMRefs, flags }) => {
|
|
|
68
68
|
if (latestInteractionRegion !== "") setLatestInteractionRegion("");
|
|
69
69
|
if (currFocusDescriber !== "") setCurrFocusDescriber("");
|
|
70
70
|
}, [currFocusDescriber, latestInteractionRegion]);
|
|
71
|
-
const handleComponentBlurs = (0, import_react.useCallback)(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
71
|
+
const handleComponentBlurs = (0, import_react.useCallback)(
|
|
72
|
+
(e) => {
|
|
73
|
+
if (isControllerOnly) {
|
|
74
|
+
const relatedTarget = e.relatedTarget;
|
|
75
|
+
if (relatedTarget && e.currentTarget.contains(relatedTarget)) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
trackFocusResetter();
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
let shouldShortCircuit = false;
|
|
82
|
+
if (latestInteractionRegion === "calendar-days" && currFocusDescriber === "calendar-metafocused-day")
|
|
83
|
+
shouldShortCircuit = true;
|
|
84
|
+
if (latestInteractionRegion === "calendar-head" && currFocusDescriber === "calendar-prev-month")
|
|
85
|
+
shouldShortCircuit = true;
|
|
86
|
+
if (latestInteractionRegion === "timewheel" && currFocusDescriber === "timewheel-curr-hour")
|
|
87
|
+
shouldShortCircuit = true;
|
|
88
|
+
if (shouldShortCircuit) return;
|
|
89
|
+
trackFocusResetter();
|
|
90
|
+
},
|
|
91
|
+
[currFocusDescriber, isControllerOnly, latestInteractionRegion, trackFocusResetter]
|
|
92
|
+
);
|
|
82
93
|
return (0, import_react.useMemo)(
|
|
83
94
|
() => ({
|
|
84
95
|
latestInteractionRegion,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useFocusTracker.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-lines */\n/* eslint-disable indent */\n/* eslint-disable max-params */\n/* eslint-disable max-statements */\nimport { useCallback, useMemo, useState } from 'react';\nimport type { useGetReferences } from './useGetReferences.js';\nimport type { useGetFlags } from './useGetFlags.js';\n\ntype LatestInteractionRegion =\n | 'calendar-days'\n | 'calendar-head'\n | 'timewheel'\n | 'date-inputs'\n | 'time-inputs'\n | 'clear-btn'\n | 'picker-icon'\n | '';\ntype CurrFocusDescriber =\n | 'first-segment'\n | 'month-input'\n | 'day-input'\n | 'year-input'\n | 'hour-input'\n | 'minute-input'\n | 'meridiem-input'\n | 'last-segment'\n | 'clear-btn'\n | 'date-picker-icon'\n | 'time-picker-icon'\n | 'datetime-picker-icon'\n | 'calendar-prev-month'\n | 'calendar-next-month'\n | 'calendar-prev-year'\n | 'calendar-next-year'\n | 'calendar-metafocused-day'\n | 'timewheel-curr-hour'\n | 'timewheel-curr-minute'\n | 'timewheel-curr-meridiem'\n | '';\n\ninterface Config {\n DOMRefs: ReturnType<typeof useGetReferences>;\n flags: ReturnType<typeof useGetFlags>;\n}\nexport const useFocusTracker = ({ DOMRefs, flags }: Config) => {\n const [latestInteractionRegion, setLatestInteractionRegion] = useState<LatestInteractionRegion>('');\n const [currFocusDescriber, setCurrFocusDescriber] = useState<CurrFocusDescriber>('');\n const { firstSegment, lastSegment } = DOMRefs;\n const { isDateSelector, isTimeSelector } = flags;\n\n const trackFocusPicker = useCallback(() => {\n let picker = 'datetime-picker-icon' as CurrFocusDescriber;\n if (isDateSelector) picker = 'date-picker-icon';\n if (isTimeSelector) picker = 'time-picker-icon';\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (picker !== currFocusDescriber) setCurrFocusDescriber(picker);\n }, [currFocusDescriber, isDateSelector, isTimeSelector, latestInteractionRegion]);\n\n /*\n depending on the polymorphic props, the first segment can be:\n - month-input (when date inputs are present)\n - hour-input (when ONLY time inputs are present)\n - datetime-picker-icon (when picker is present and we are selecting both date and time)\n - date-picker-icon (when picker is present and no time selection is involved)\n - time-picker-icon (when picker is present and no date selection is involved)\n */\n const trackFocusFirstSegment = useCallback(() => {\n let region = 'date-inputs' as LatestInteractionRegion;\n if (firstSegment === 'hour-input') region = 'time-inputs';\n if (firstSegment === 'date-picker-icon') region = 'picker-icon';\n if (firstSegment === 'time-picker-icon') region = 'picker-icon';\n if (firstSegment === 'datetime-picker-icon') region = 'picker-icon';\n if (region !== latestInteractionRegion) setLatestInteractionRegion(region);\n if (firstSegment !== currFocusDescriber) setCurrFocusDescriber(firstSegment);\n }, [currFocusDescriber, firstSegment, latestInteractionRegion]);\n\n /*\n depending on the polymorphic props, the last segment can be:\n - year-input (when ONLY date inputs are present)\n - meridiem-input (when time inputs are present)\n - clear-btn (when clearable is true and there is no picker)\n - datetime-picker-icon (when picker is present and we are selecting both date and time)\n - date-picker-icon (when picker is present and no time selection is involved)\n - time-picker-icon (when picker is present and no date selection is involved)\n */\n const trackFocusLastSegment = useCallback(() => {\n let region = 'date-inputs' as LatestInteractionRegion;\n if (lastSegment === 'meridiem-input') region = 'time-inputs';\n if (lastSegment === 'clear-btn') region = 'clear-btn';\n if (lastSegment === 'date-picker-icon') region = 'picker-icon';\n if (lastSegment === 'time-picker-icon') region = 'picker-icon';\n if (lastSegment === 'datetime-picker-icon') region = 'picker-icon';\n if (region !== latestInteractionRegion) setLatestInteractionRegion(region);\n if (lastSegment !== currFocusDescriber) setCurrFocusDescriber(lastSegment);\n }, [currFocusDescriber, lastSegment, latestInteractionRegion]);\n\n const trackFocusResetter = useCallback(() => {\n if (latestInteractionRegion !== '') setLatestInteractionRegion('');\n if (currFocusDescriber !== '') setCurrFocusDescriber('');\n }, [currFocusDescriber, latestInteractionRegion]);\n\n const handleComponentBlurs = useCallback(() => {\n /* our code base is trying to avoid side-effects and we also try to be imperative\n due to how \"portals\" work, when we open a portal the \"blur\" event is triggered\n we need to distinguish between\n - a blur that is caused by a portal opening\n vs\n - a blur that is caused by a user moving focus to another element\n we can do this by checking the currFocusDescriber and latestInteractionRegion\n we know that blur is triggered by portal opening when:\n - latestInteractionRegion === 'calendar-days' && currFocusDescriber === 'calendar-metafocused-day'\n (this is the case when we open the calendar or calendarWithTimeWheel with a preselected date)\n - latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-prev-month'\n (this is the case when we open the calendar or calendarWithTimeWheel without a preselected date)\n - latestInteractionRegion === 'timewheel' && currFocusDescriber === 'timewheel-curr-hour'\n (this is the case when we open any timewheel ONLY)\n */\n let shouldShortCircuit = false;\n // preselected date OR filled date value OR onCalendarOpenFocusedDay is present\n if (latestInteractionRegion === 'calendar-days' && currFocusDescriber === 'calendar-metafocused-day')\n shouldShortCircuit = true;\n // empty date value AND no onCalendarOpenFocusedDay is present\n if (latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-prev-month')\n shouldShortCircuit = true;\n\n // only time wheel is present in the contextual region\n if (latestInteractionRegion === 'timewheel' && currFocusDescriber === 'timewheel-curr-hour')\n shouldShortCircuit = true;\n\n if (shouldShortCircuit) return;\n trackFocusResetter();\n }, [currFocusDescriber, latestInteractionRegion, trackFocusResetter]);\n\n return useMemo(\n () => ({\n latestInteractionRegion,\n setLatestInteractionRegion,\n currFocusDescriber,\n setCurrFocusDescriber,\n trackFocusResetter,\n trackFocusMonthInput: () => {\n if (latestInteractionRegion !== 'date-inputs') setLatestInteractionRegion('date-inputs');\n if (currFocusDescriber !== 'month-input') setCurrFocusDescriber('month-input');\n },\n trackFocusDayInput: () => {\n if (latestInteractionRegion !== 'date-inputs') setLatestInteractionRegion('date-inputs');\n if (currFocusDescriber !== 'day-input') setCurrFocusDescriber('day-input');\n },\n trackFocusYearInput: () => {\n if (latestInteractionRegion !== 'date-inputs') setLatestInteractionRegion('date-inputs');\n if (currFocusDescriber !== 'year-input') setCurrFocusDescriber('year-input');\n },\n trackFocusHourInput: () => {\n if (latestInteractionRegion !== 'time-inputs') setLatestInteractionRegion('time-inputs');\n if (currFocusDescriber !== 'hour-input') setCurrFocusDescriber('hour-input');\n },\n trackFocusMinuteInput: () => {\n if (latestInteractionRegion !== 'time-inputs') setLatestInteractionRegion('time-inputs');\n if (currFocusDescriber !== 'minute-input') setCurrFocusDescriber('minute-input');\n },\n trackFocusMeridiemInput: () => {\n if (latestInteractionRegion !== 'time-inputs') setLatestInteractionRegion('time-inputs');\n if (currFocusDescriber !== 'meridiem-input') setCurrFocusDescriber('meridiem-input');\n },\n trackFocusClearBtn: () => {\n if (latestInteractionRegion !== 'clear-btn') setLatestInteractionRegion('clear-btn');\n if (currFocusDescriber !== 'clear-btn') setCurrFocusDescriber('clear-btn');\n },\n trackFocusDatePickerIcon: () => {\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (currFocusDescriber !== 'date-picker-icon') setCurrFocusDescriber('date-picker-icon');\n },\n trackFocusTimePickerIcon: () => {\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (currFocusDescriber !== 'time-picker-icon') setCurrFocusDescriber('time-picker-icon');\n },\n trackFocusDatetimePickerIcon: () => {\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (currFocusDescriber !== 'datetime-picker-icon') setCurrFocusDescriber('datetime-picker-icon');\n },\n trackFocusCalendarPrevMonth: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-prev-month') setCurrFocusDescriber('calendar-prev-month');\n },\n trackFocusCalendarNextMonth: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-next-month') setCurrFocusDescriber('calendar-next-month');\n },\n trackFocusCalendarPrevYear: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-prev-year') setCurrFocusDescriber('calendar-prev-year');\n },\n trackFocusCalendarNextYear: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-next-year') setCurrFocusDescriber('calendar-next-year');\n },\n trackFocusCalendarMetafocusedDay: () => {\n if (latestInteractionRegion !== 'calendar-days') setLatestInteractionRegion('calendar-days');\n if (currFocusDescriber !== 'calendar-metafocused-day') setCurrFocusDescriber('calendar-metafocused-day');\n },\n trackFocusTimewheelCurrHour: () => {\n if (latestInteractionRegion !== 'timewheel') setLatestInteractionRegion('timewheel');\n if (currFocusDescriber !== 'timewheel-curr-hour') setCurrFocusDescriber('timewheel-curr-hour');\n },\n trackFocusTimewheelCurrMinute: () => {\n if (latestInteractionRegion !== 'timewheel') setLatestInteractionRegion('timewheel');\n if (currFocusDescriber !== 'timewheel-curr-minute') setCurrFocusDescriber('timewheel-curr-minute');\n },\n trackFocusTimewheelCurrMeridiem: () => {\n if (latestInteractionRegion !== 'timewheel') setLatestInteractionRegion('timewheel');\n if (currFocusDescriber !== 'timewheel-curr-meridiem') setCurrFocusDescriber('timewheel-curr-meridiem');\n },\n trackFocusPicker,\n trackFocusFirstSegment,\n trackFocusLastSegment,\n handleComponentBlurs,\n }),\n [\n latestInteractionRegion,\n currFocusDescriber,\n trackFocusResetter,\n trackFocusPicker,\n trackFocusFirstSegment,\n trackFocusLastSegment,\n handleComponentBlurs,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADKvB,mBAA+C;AAwCxC,MAAM,kBAAkB,CAAC,EAAE,SAAS,MAAM,MAAc;AAC7D,QAAM,CAAC,yBAAyB,0BAA0B,QAAI,uBAAkC,EAAE;AAClG,QAAM,CAAC,oBAAoB,qBAAqB,QAAI,uBAA6B,EAAE;AACnF,QAAM,EAAE,cAAc,YAAY,IAAI;AACtC,QAAM,EAAE,gBAAgB,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-lines */\n/* eslint-disable indent */\n/* eslint-disable max-params */\n/* eslint-disable max-statements */\nimport { useCallback, useMemo, useState } from 'react';\nimport type { useGetReferences } from './useGetReferences.js';\nimport type { useGetFlags } from './useGetFlags.js';\n\ntype LatestInteractionRegion =\n | 'calendar-days'\n | 'calendar-head'\n | 'timewheel'\n | 'date-inputs'\n | 'time-inputs'\n | 'clear-btn'\n | 'picker-icon'\n | '';\ntype CurrFocusDescriber =\n | 'first-segment'\n | 'month-input'\n | 'day-input'\n | 'year-input'\n | 'hour-input'\n | 'minute-input'\n | 'meridiem-input'\n | 'last-segment'\n | 'clear-btn'\n | 'date-picker-icon'\n | 'time-picker-icon'\n | 'datetime-picker-icon'\n | 'calendar-prev-month'\n | 'calendar-next-month'\n | 'calendar-prev-year'\n | 'calendar-next-year'\n | 'calendar-metafocused-day'\n | 'timewheel-curr-hour'\n | 'timewheel-curr-minute'\n | 'timewheel-curr-meridiem'\n | '';\n\ninterface Config {\n DOMRefs: ReturnType<typeof useGetReferences>;\n flags: ReturnType<typeof useGetFlags>;\n}\nexport const useFocusTracker = ({ DOMRefs, flags }: Config) => {\n const [latestInteractionRegion, setLatestInteractionRegion] = useState<LatestInteractionRegion>('');\n const [currFocusDescriber, setCurrFocusDescriber] = useState<CurrFocusDescriber>('');\n const { firstSegment, lastSegment } = DOMRefs;\n const { isDateSelector, isTimeSelector, isControllerOnly } = flags;\n\n const trackFocusPicker = useCallback(() => {\n let picker = 'datetime-picker-icon' as CurrFocusDescriber;\n if (isDateSelector) picker = 'date-picker-icon';\n if (isTimeSelector) picker = 'time-picker-icon';\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (picker !== currFocusDescriber) setCurrFocusDescriber(picker);\n }, [currFocusDescriber, isDateSelector, isTimeSelector, latestInteractionRegion]);\n\n /*\n depending on the polymorphic props, the first segment can be:\n - month-input (when date inputs are present)\n - hour-input (when ONLY time inputs are present)\n - datetime-picker-icon (when picker is present and we are selecting both date and time)\n - date-picker-icon (when picker is present and no time selection is involved)\n - time-picker-icon (when picker is present and no date selection is involved)\n */\n const trackFocusFirstSegment = useCallback(() => {\n let region = 'date-inputs' as LatestInteractionRegion;\n if (firstSegment === 'hour-input') region = 'time-inputs';\n if (firstSegment === 'date-picker-icon') region = 'picker-icon';\n if (firstSegment === 'time-picker-icon') region = 'picker-icon';\n if (firstSegment === 'datetime-picker-icon') region = 'picker-icon';\n if (region !== latestInteractionRegion) setLatestInteractionRegion(region);\n if (firstSegment !== currFocusDescriber) setCurrFocusDescriber(firstSegment);\n }, [currFocusDescriber, firstSegment, latestInteractionRegion]);\n\n /*\n depending on the polymorphic props, the last segment can be:\n - year-input (when ONLY date inputs are present)\n - meridiem-input (when time inputs are present)\n - clear-btn (when clearable is true and there is no picker)\n - datetime-picker-icon (when picker is present and we are selecting both date and time)\n - date-picker-icon (when picker is present and no time selection is involved)\n - time-picker-icon (when picker is present and no date selection is involved)\n */\n const trackFocusLastSegment = useCallback(() => {\n let region = 'date-inputs' as LatestInteractionRegion;\n if (lastSegment === 'meridiem-input') region = 'time-inputs';\n if (lastSegment === 'clear-btn') region = 'clear-btn';\n if (lastSegment === 'date-picker-icon') region = 'picker-icon';\n if (lastSegment === 'time-picker-icon') region = 'picker-icon';\n if (lastSegment === 'datetime-picker-icon') region = 'picker-icon';\n if (region !== latestInteractionRegion) setLatestInteractionRegion(region);\n if (lastSegment !== currFocusDescriber) setCurrFocusDescriber(lastSegment);\n }, [currFocusDescriber, lastSegment, latestInteractionRegion]);\n\n const trackFocusResetter = useCallback(() => {\n if (latestInteractionRegion !== '') setLatestInteractionRegion('');\n if (currFocusDescriber !== '') setCurrFocusDescriber('');\n }, [currFocusDescriber, latestInteractionRegion]);\n\n const handleComponentBlurs = useCallback(\n (e: React.FocusEvent<HTMLElement>) => {\n /**\n * In controller only mode, we want to reset the focus tracker when the user moves focus outside of the component\n * this is because in controller only mode we don't have a portal that we need to account for,\n * so any blur event that happens when we are in controller only mode should be treated as a user moving focus outside of the component\n */\n if (isControllerOnly) {\n const relatedTarget = e.relatedTarget as HTMLElement | null;\n if (relatedTarget && (e.currentTarget as HTMLElement).contains(relatedTarget)) {\n return;\n }\n trackFocusResetter();\n return;\n }\n /* our code base is trying to avoid side-effects and we also try to be imperative\n due to how \"portals\" work, when we open a portal the \"blur\" event is triggered\n we need to distinguish between\n - a blur that is caused by a portal opening\n vs\n - a blur that is caused by a user moving focus to another element\n we can do this by checking the currFocusDescriber and latestInteractionRegion\n we know that blur is triggered by portal opening when:\n - latestInteractionRegion === 'calendar-days' && currFocusDescriber === 'calendar-metafocused-day'\n (this is the case when we open the calendar or calendarWithTimeWheel with a preselected date)\n - latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-prev-month'\n (this is the case when we open the calendar or calendarWithTimeWheel without a preselected date)\n - latestInteractionRegion === 'timewheel' && currFocusDescriber === 'timewheel-curr-hour'\n (this is the case when we open any timewheel ONLY)\n */\n let shouldShortCircuit = false;\n // preselected date OR filled date value OR onCalendarOpenFocusedDay is present\n if (latestInteractionRegion === 'calendar-days' && currFocusDescriber === 'calendar-metafocused-day')\n shouldShortCircuit = true;\n // empty date value AND no onCalendarOpenFocusedDay is present\n if (latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-prev-month')\n shouldShortCircuit = true;\n\n // only time wheel is present in the contextual region\n if (latestInteractionRegion === 'timewheel' && currFocusDescriber === 'timewheel-curr-hour')\n shouldShortCircuit = true;\n\n if (shouldShortCircuit) return;\n trackFocusResetter();\n },\n [currFocusDescriber, isControllerOnly, latestInteractionRegion, trackFocusResetter],\n );\n\n return useMemo(\n () => ({\n latestInteractionRegion,\n setLatestInteractionRegion,\n currFocusDescriber,\n setCurrFocusDescriber,\n trackFocusResetter,\n trackFocusMonthInput: () => {\n if (latestInteractionRegion !== 'date-inputs') setLatestInteractionRegion('date-inputs');\n if (currFocusDescriber !== 'month-input') setCurrFocusDescriber('month-input');\n },\n trackFocusDayInput: () => {\n if (latestInteractionRegion !== 'date-inputs') setLatestInteractionRegion('date-inputs');\n if (currFocusDescriber !== 'day-input') setCurrFocusDescriber('day-input');\n },\n trackFocusYearInput: () => {\n if (latestInteractionRegion !== 'date-inputs') setLatestInteractionRegion('date-inputs');\n if (currFocusDescriber !== 'year-input') setCurrFocusDescriber('year-input');\n },\n trackFocusHourInput: () => {\n if (latestInteractionRegion !== 'time-inputs') setLatestInteractionRegion('time-inputs');\n if (currFocusDescriber !== 'hour-input') setCurrFocusDescriber('hour-input');\n },\n trackFocusMinuteInput: () => {\n if (latestInteractionRegion !== 'time-inputs') setLatestInteractionRegion('time-inputs');\n if (currFocusDescriber !== 'minute-input') setCurrFocusDescriber('minute-input');\n },\n trackFocusMeridiemInput: () => {\n if (latestInteractionRegion !== 'time-inputs') setLatestInteractionRegion('time-inputs');\n if (currFocusDescriber !== 'meridiem-input') setCurrFocusDescriber('meridiem-input');\n },\n trackFocusClearBtn: () => {\n if (latestInteractionRegion !== 'clear-btn') setLatestInteractionRegion('clear-btn');\n if (currFocusDescriber !== 'clear-btn') setCurrFocusDescriber('clear-btn');\n },\n trackFocusDatePickerIcon: () => {\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (currFocusDescriber !== 'date-picker-icon') setCurrFocusDescriber('date-picker-icon');\n },\n trackFocusTimePickerIcon: () => {\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (currFocusDescriber !== 'time-picker-icon') setCurrFocusDescriber('time-picker-icon');\n },\n trackFocusDatetimePickerIcon: () => {\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (currFocusDescriber !== 'datetime-picker-icon') setCurrFocusDescriber('datetime-picker-icon');\n },\n trackFocusCalendarPrevMonth: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-prev-month') setCurrFocusDescriber('calendar-prev-month');\n },\n trackFocusCalendarNextMonth: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-next-month') setCurrFocusDescriber('calendar-next-month');\n },\n trackFocusCalendarPrevYear: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-prev-year') setCurrFocusDescriber('calendar-prev-year');\n },\n trackFocusCalendarNextYear: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-next-year') setCurrFocusDescriber('calendar-next-year');\n },\n trackFocusCalendarMetafocusedDay: () => {\n if (latestInteractionRegion !== 'calendar-days') setLatestInteractionRegion('calendar-days');\n if (currFocusDescriber !== 'calendar-metafocused-day') setCurrFocusDescriber('calendar-metafocused-day');\n },\n trackFocusTimewheelCurrHour: () => {\n if (latestInteractionRegion !== 'timewheel') setLatestInteractionRegion('timewheel');\n if (currFocusDescriber !== 'timewheel-curr-hour') setCurrFocusDescriber('timewheel-curr-hour');\n },\n trackFocusTimewheelCurrMinute: () => {\n if (latestInteractionRegion !== 'timewheel') setLatestInteractionRegion('timewheel');\n if (currFocusDescriber !== 'timewheel-curr-minute') setCurrFocusDescriber('timewheel-curr-minute');\n },\n trackFocusTimewheelCurrMeridiem: () => {\n if (latestInteractionRegion !== 'timewheel') setLatestInteractionRegion('timewheel');\n if (currFocusDescriber !== 'timewheel-curr-meridiem') setCurrFocusDescriber('timewheel-curr-meridiem');\n },\n trackFocusPicker,\n trackFocusFirstSegment,\n trackFocusLastSegment,\n handleComponentBlurs,\n }),\n [\n latestInteractionRegion,\n currFocusDescriber,\n trackFocusResetter,\n trackFocusPicker,\n trackFocusFirstSegment,\n trackFocusLastSegment,\n handleComponentBlurs,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADKvB,mBAA+C;AAwCxC,MAAM,kBAAkB,CAAC,EAAE,SAAS,MAAM,MAAc;AAC7D,QAAM,CAAC,yBAAyB,0BAA0B,QAAI,uBAAkC,EAAE;AAClG,QAAM,CAAC,oBAAoB,qBAAqB,QAAI,uBAA6B,EAAE;AACnF,QAAM,EAAE,cAAc,YAAY,IAAI;AACtC,QAAM,EAAE,gBAAgB,gBAAgB,iBAAiB,IAAI;AAE7D,QAAM,uBAAmB,0BAAY,MAAM;AACzC,QAAI,SAAS;AACb,QAAI,eAAgB,UAAS;AAC7B,QAAI,eAAgB,UAAS;AAC7B,QAAI,4BAA4B,cAAe,4BAA2B,aAAa;AACvF,QAAI,WAAW,mBAAoB,uBAAsB,MAAM;AAAA,EACjE,GAAG,CAAC,oBAAoB,gBAAgB,gBAAgB,uBAAuB,CAAC;AA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;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -110,6 +110,18 @@ const PRE_EXISTING_DATA_TESTID = {
|
|
|
110
110
|
TIMEWHEEL_MERIDIEM: "ds-controlled-date-time-picker-timewheel-meridiem",
|
|
111
111
|
TIMEWHEEL_CURRENT_MERIDIEM: "ds-controlled-date-time-picker-timewheel-current-meridiem",
|
|
112
112
|
TIMEWHEEL_NEXT_MERIDIEM: "ds-controlled-date-time-picker-timewheel-next-meridiem",
|
|
113
|
+
// MeridiemList renders a dual-layer pattern (see KNOWN_INTENTIONAL_DEVIATIONS.md DEV-001):
|
|
114
|
+
// - A11y layer: invisible semantic listbox — the real focus target, owns CURRENT_MERIDIEM above.
|
|
115
|
+
// - Visual layer: aria-hidden StyledTimeBtn elements — presentation only, no focus capability.
|
|
116
|
+
//
|
|
117
|
+
// CURRENT_MERIDIEM / MERIDIEM originally lived on the visual elements. When the a11y layer became
|
|
118
|
+
// the focus target, CURRENT_MERIDIEM moved to the listbox. The visual elements received
|
|
119
|
+
// -visual-element-suffixed testids to prevent DOM query duplication (getByTestId would otherwise
|
|
120
|
+
// return two elements with the same testid and throw in most automation frameworks).
|
|
121
|
+
//
|
|
122
|
+
// data-dimsum-slot on StyledTimeBtn (TIMEWHEEL_TIME_BUTTON) is unaffected — theming via slots is unchanged.
|
|
123
|
+
TIMEWHEEL_MERIDIEM_VISUAL_ELEMENT: "ds-controlled-date-time-picker-timewheel-meridiem-visual-element",
|
|
124
|
+
TIMEWHEEL_CURRENT_MERIDIEM_VISUAL_ELEMENT: "ds-controlled-date-time-picker-timewheel-current-meridiem-visual-element",
|
|
113
125
|
CONTEXTUAL_MENU_CALENDAR: "ds-controlled-date-time-picker-calendar-context-content-wrapper",
|
|
114
126
|
CONTEXTUAL_MENU_TIMEWHEEL: "ds-controlled-date-time-picker-timewheel-context-content-wrapper",
|
|
115
127
|
CONTEXTUAL_MENU_CALENDAR_TIMEWHEEL: "ds-controlled-date-time-picker-calendar-timewheel-context-content-wrapper",
|
|
@@ -217,7 +229,9 @@ const ControlledDateTimePickerDatatestid = {
|
|
|
217
229
|
PREV_MERIDIEM: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_PREV_MERIDIEM,
|
|
218
230
|
MERIDIEM: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_MERIDIEM,
|
|
219
231
|
CURRENT_MERIDIEM: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_CURRENT_MERIDIEM,
|
|
220
|
-
NEXT_MERIDIEM: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_NEXT_MERIDIEM
|
|
232
|
+
NEXT_MERIDIEM: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_NEXT_MERIDIEM,
|
|
233
|
+
MERIDIEM_VISUAL_ELEMENT: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_MERIDIEM_VISUAL_ELEMENT,
|
|
234
|
+
CURRENT_MERIDIEM_VISUAL_ELEMENT: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_CURRENT_MERIDIEM_VISUAL_ELEMENT
|
|
221
235
|
},
|
|
222
236
|
CONTEXTUAL_MENU: {
|
|
223
237
|
CALENDAR: FORM_DATE_TIME_PICKER_DATA_TESTID.CONTEXTUAL_MENU_CALENDAR,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/constants/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSControlledDateTimePickerName = 'DSControlleddatetimepicker';\n\n// we are naming this with the ${component_name}_slots convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const FORM_DATE_TIME_PICKER_SLOTS = {\n CONTAINER: 'root',\n // THE SLOT IS ABOUT \"DATE\" EVEN IF THE STRING SAYS \"time-...\"\n // When this was first defined there was a typo in the string, now we can't change because it is a deliverable and would impact application space.\n DATE_INPUTS_MONTH: 'time-picker-month-input',\n DATE_INPUTS_DAY: 'time-picker-day-input',\n DATE_INPUTS_YEAR: 'time-picker-year-input',\n // end of typo\n TIME_INPUTS_HOUR: 'time-picker-hour-input',\n TIME_INPUTS_MINUTE: 'time-picker-minute-input',\n TIME_INPUTS_MERIDIEM: 'time-picker-meridiem-input',\n PICKER_ICONS_CALENDAR: 'calendar-trigger-icon',\n PICKER_ICONS_TIMEWHEEL: 'timewheel-trigger-icon',\n PICKER_ICONS_CALENDAR_TIMEWHEEL: 'calendar-timewheel-trigger-icon',\n CALENDAR_DAY_BUTTON: 'calendar-day',\n CALENDAR_HEADER_LABEL: 'calendar-header-label',\n CALENDAR_HEADER_BUTTON: 'calendar-header-buttons',\n CALENDAR_HEADER_WEEKLY_DAY_LIST: 'calendar-header-weekly-day-list',\n TIMEWHEEL_TIME_BUTTON: 'timewheel-time-button',\n TIMEWHEEL_TIME_CHANGE_BUTTON: 'timewheel-time-change-button',\n TIMEWHEEL_HEADER_LABEL: 'timewheel-header-label',\n CONTEXTUAL_MENU_CALENDAR: 'calendar-context-content-wrapper',\n CONTEXTUAL_MENU_TIMEWHEEL: 'timewheel-context-content-wrapper',\n CONTEXTUAL_MENU_CALENDAR_TIMEWHEEL: 'calendar-timewheel-context-content-wrapper',\n FOOTERS_CALENDAR: 'calendar-context-footer',\n FOOTERS_TIMEWHEEL: 'timewheel-context-footer',\n FOOTERS_CALENDAR_TIMEWHEEL: 'calendar-timewheel-context-footer',\n CONTROLLER_COMPONENT_CALENDAR: 'calendar-controller-wrapper',\n CONTROLLER_COMPONENT_TIMEWHEEL: 'timewheel-controller-wrapper',\n CONTROLLER_COMPONENT_CALENDAR_TIMEWHEEL: 'calendar-timewheel-controller-wrapper',\n CLEAR_BUTTON: 'clear-btn',\n} as const;\n\nconst PRE_EXISTING_DATA_TESTID = {\n // we are keeping the old names for backward compatibility...\n CONTAINER: 'ds-controlled-date-time-picker-container',\n DATE_INPUTS_MONTH: 'ds-controlled-date-time-picker-month-input',\n DATE_INPUTS_DAY: 'ds-controlled-date-time-picker-day-input',\n DATE_INPUTS_YEAR: 'ds-controlled-date-time-picker-year-input',\n TIME_INPUTS_HOUR: 'ds-controlled-date-time-picker-hour-input',\n TIME_INPUTS_MINUTE: 'ds-controlled-date-time-picker-minute-input',\n TIME_INPUTS_MERIDIEM: 'ds-controlled-date-time-picker-meridiem-input',\n PICKER_ICONS_CALENDAR: 'ds-controlled-date-time-picker-calendar-trigger-icon',\n PICKER_ICONS_TIMEWHEEL: 'ds-controlled-date-time-picker-timewheel-trigger-icon',\n PICKER_ICONS_CALENDAR_TIMEWHEEL: 'ds-controlled-date-time-picker-calendar-timewheel-trigger-icon',\n CALENDAR_TABLE_WRAPPER: 'ds-controlled-date-time-picker-calendar-table-wrapper',\n CALENDAR_HEADER_LABEL: 'ds-controlled-date-time-picker-calendar-header-label',\n CALENDAR_PREV_YEAR: 'ds-controlled-date-time-picker-calendar-prev-year',\n CALENDAR_PREV_MONTH: 'ds-controlled-date-time-picker-calendar-prev-month',\n CALENDAR_DAY: 'ds-controlled-date-time-picker-calendar-day',\n CALENDAR_FOCUSED_DAY: 'ds-controlled-date-time-picker-calendar-focused-day',\n CALENDAR_START_RANGE_DAY: 'ds-controlled-date-time-picker-calendar-start-range-day',\n CALENDAR_IN_RANGE_DAY: 'ds-controlled-date-time-picker-calendar-in-range-day',\n CALENDAR_END_RANGE_DAY: 'ds-controlled-date-time-picker-calendar-end-range-day',\n CALENDAR_SELECTED_DAY: 'ds-controlled-date-time-picker-calendar-selected-day',\n CALENDAR_SELECTED_FOCUSED_DAY: 'ds-controlled-date-time-picker-calendar-selected-focused-day',\n CALENDAR_NEXT_MONTH: 'ds-controlled-date-time-picker-calendar-next-month',\n CALENDAR_NEXT_YEAR: 'ds-controlled-date-time-picker-calendar-next-year',\n TIMEWHEEL_HEADER_LABEL: 'ds-controlled-date-time-picker-timewheel-header-label',\n TIMEWHEEL_PREV_HOUR: 'ds-controlled-date-time-picker-timewheel-prev-hour',\n TIMEWHEEL_HOUR: 'ds-controlled-date-time-picker-timewheel-hour',\n TIMEWHEEL_CURRENT_HOUR: 'ds-controlled-date-time-picker-timewheel-current-hour',\n TIMEWHEEL_NEXT_HOUR: 'ds-controlled-date-time-picker-timewheel-next-hour',\n TIMEWHEEL_PREV_MINUTE: 'ds-controlled-date-time-picker-timewheel-prev-minute',\n TIMEWHEEL_MINUTE: 'ds-controlled-date-time-picker-timewheel-minute',\n TIMEWHEEL_CURRENT_MINUTE: 'ds-controlled-date-time-picker-timewheel-current-minute',\n TIMEWHEEL_NEXT_MINUTE: 'ds-controlled-date-time-picker-timewheel-next-minute',\n TIMEWHEEL_PREV_MERIDIEM: 'ds-controlled-date-time-picker-timewheel-prev-meridiem',\n TIMEWHEEL_MERIDIEM: 'ds-controlled-date-time-picker-timewheel-meridiem',\n TIMEWHEEL_CURRENT_MERIDIEM: 'ds-controlled-date-time-picker-timewheel-current-meridiem',\n TIMEWHEEL_NEXT_MERIDIEM: 'ds-controlled-date-time-picker-timewheel-next-meridiem',\n CONTEXTUAL_MENU_CALENDAR: 'ds-controlled-date-time-picker-calendar-context-content-wrapper',\n CONTEXTUAL_MENU_TIMEWHEEL: 'ds-controlled-date-time-picker-timewheel-context-content-wrapper',\n CONTEXTUAL_MENU_CALENDAR_TIMEWHEEL: 'ds-controlled-date-time-picker-calendar-timewheel-context-content-wrapper',\n CONTROLLER_COMPONENT_CALENDAR: 'ds-controlled-date-time-picker-calendar-controller-wrapper',\n CONTROLLER_COMPONENT_TIMEWHEEL: 'ds-controlled-date-time-picker-timewheel-controller-wrapper',\n CONTROLLER_COMPONENT_CALENDAR_TIMEWHEEL: 'ds-controlled-date-time-picker-calendar-timewheel-controller-wrapper',\n FOOTERS_CALENDAR: 'ds-controlled-date-time-picker-calendar-context-footer',\n FOOTERS_TIMEWHEEL: 'ds-controlled-date-time-picker-timewheel-context-footer',\n FOOTERS_CALENDAR_TIMEWHEEL: 'ds-controlled-date-time-picker-calendar-timewheel-context-footer',\n CLEAR_BUTTON: 'ds-controlled-date-time-picker-clear-btn',\n} as const;\n\n// we are naming this with the ${component_name}_data_testid convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const FORM_DATE_TIME_PICKER_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSControlledDateTimePickerName, FORM_DATE_TIME_PICKER_SLOTS),\n ...PRE_EXISTING_DATA_TESTID,\n};\n\n/* ******************************************************************************************\nThis component was created before the team had a convention for data-testid and slots.\n*********************************************************************************************\n START OF LEGACY CODE (kept to avoid breaking changes)\n****************************************************************************************** */\nexport const DSControlledDateTimePickerSlotsFlatten = FORM_DATE_TIME_PICKER_SLOTS;\nexport const DSControlledDateTimePickerSlots = {\n CONTAINER: FORM_DATE_TIME_PICKER_SLOTS.CONTAINER,\n DATE_INPUTS: {\n MONTH: FORM_DATE_TIME_PICKER_SLOTS.DATE_INPUTS_MONTH,\n DAY: FORM_DATE_TIME_PICKER_SLOTS.DATE_INPUTS_DAY,\n YEAR: FORM_DATE_TIME_PICKER_SLOTS.DATE_INPUTS_YEAR,\n },\n TIME_INPUTS: {\n HOUR: FORM_DATE_TIME_PICKER_SLOTS.TIME_INPUTS_HOUR,\n MINUTE: FORM_DATE_TIME_PICKER_SLOTS.TIME_INPUTS_MINUTE,\n MERIDIEM: FORM_DATE_TIME_PICKER_SLOTS.TIME_INPUTS_MERIDIEM,\n },\n PICKER_ICONS: {\n CALENDAR: FORM_DATE_TIME_PICKER_SLOTS.PICKER_ICONS_CALENDAR,\n TIMEWHEEL: FORM_DATE_TIME_PICKER_SLOTS.PICKER_ICONS_TIMEWHEEL,\n CALENDAR_TIMEWHEEL: FORM_DATE_TIME_PICKER_SLOTS.PICKER_ICONS_CALENDAR_TIMEWHEEL,\n },\n CALENDAR: {\n DAY_BUTTON: FORM_DATE_TIME_PICKER_SLOTS.CALENDAR_DAY_BUTTON,\n HEADER_LABEL: FORM_DATE_TIME_PICKER_SLOTS.CALENDAR_HEADER_LABEL,\n HEADER_BUTTON: FORM_DATE_TIME_PICKER_SLOTS.CALENDAR_HEADER_BUTTON,\n HEADER_WEEKLY_DAY_LIST: FORM_DATE_TIME_PICKER_SLOTS.CALENDAR_HEADER_WEEKLY_DAY_LIST,\n },\n TIMEWHEEL: {\n TIME_BUTTON: FORM_DATE_TIME_PICKER_SLOTS.TIMEWHEEL_TIME_BUTTON,\n TIME_CHANGE_BUTTON: FORM_DATE_TIME_PICKER_SLOTS.TIMEWHEEL_TIME_CHANGE_BUTTON,\n HEADER_LABEL: FORM_DATE_TIME_PICKER_SLOTS.TIMEWHEEL_HEADER_LABEL,\n },\n CONTEXTUAL_MENU: {\n CALENDAR: FORM_DATE_TIME_PICKER_SLOTS.CONTEXTUAL_MENU_CALENDAR,\n TIMEWHEEL: FORM_DATE_TIME_PICKER_SLOTS.CONTEXTUAL_MENU_TIMEWHEEL,\n CALENDAR_TIMEWHEEL: FORM_DATE_TIME_PICKER_SLOTS.CONTEXTUAL_MENU_CALENDAR_TIMEWHEEL,\n },\n FOOTERS: {\n CALENDAR: FORM_DATE_TIME_PICKER_SLOTS.FOOTERS_CALENDAR,\n TIMEWHEEL: FORM_DATE_TIME_PICKER_SLOTS.FOOTERS_TIMEWHEEL,\n CALENDAR_TIMEWHEEL: FORM_DATE_TIME_PICKER_SLOTS.FOOTERS_CALENDAR_TIMEWHEEL,\n },\n CONTROLLER_COMPONENT: {\n CALENDAR: FORM_DATE_TIME_PICKER_SLOTS.CONTROLLER_COMPONENT_CALENDAR,\n TIMEWHEEL: FORM_DATE_TIME_PICKER_SLOTS.CONTROLLER_COMPONENT_TIMEWHEEL,\n CALENDAR_TIMEWHEEL: FORM_DATE_TIME_PICKER_SLOTS.CONTROLLER_COMPONENT_CALENDAR_TIMEWHEEL,\n },\n CLEAR_BUTTON: FORM_DATE_TIME_PICKER_SLOTS.CLEAR_BUTTON,\n};\nexport const ControlledDateTimePickerDatatestidFlattened = FORM_DATE_TIME_PICKER_DATA_TESTID;\nexport const ControlledDateTimePickerDatatestid = {\n CONTAINER: FORM_DATE_TIME_PICKER_DATA_TESTID.CONTAINER,\n DATE_INPUTS: {\n MONTH: FORM_DATE_TIME_PICKER_DATA_TESTID.DATE_INPUTS_MONTH,\n DAY: FORM_DATE_TIME_PICKER_DATA_TESTID.DATE_INPUTS_DAY,\n YEAR: FORM_DATE_TIME_PICKER_DATA_TESTID.DATE_INPUTS_YEAR,\n },\n TIME_INPUTS: {\n HOUR: FORM_DATE_TIME_PICKER_DATA_TESTID.TIME_INPUTS_HOUR,\n MINUTE: FORM_DATE_TIME_PICKER_DATA_TESTID.TIME_INPUTS_MINUTE,\n MERIDIEM: FORM_DATE_TIME_PICKER_DATA_TESTID.TIME_INPUTS_MERIDIEM,\n },\n PICKER_ICONS: {\n CALENDAR: FORM_DATE_TIME_PICKER_DATA_TESTID.PICKER_ICONS_CALENDAR,\n TIMEWHEEL: FORM_DATE_TIME_PICKER_DATA_TESTID.PICKER_ICONS_TIMEWHEEL,\n CALENDAR_TIMEWHEEL: FORM_DATE_TIME_PICKER_DATA_TESTID.PICKER_ICONS_CALENDAR_TIMEWHEEL,\n },\n CALENDAR: {\n TABLE_WRAPPER: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_TABLE_WRAPPER,\n HEADER_LABEL: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_HEADER_LABEL,\n PREV_YEAR: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_PREV_YEAR,\n PREV_MONTH: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_PREV_MONTH,\n DAY: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_DAY,\n FOCUSED_DAY: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_FOCUSED_DAY,\n START_RANGE_DAY: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_START_RANGE_DAY,\n IN_RANGE_DAY: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_IN_RANGE_DAY,\n END_RANGE_DAY: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_END_RANGE_DAY,\n SELECTED_DAY: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_SELECTED_DAY,\n SELECTED_FOCUSED_DAY: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_SELECTED_FOCUSED_DAY,\n NEXT_MONTH: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_NEXT_MONTH,\n NEXT_YEAR: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_NEXT_YEAR,\n },\n TIMEWHEEL: {\n HEADER_LABEL: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_HEADER_LABEL,\n PREV_HOUR: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_PREV_HOUR,\n HOUR: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_HOUR,\n CURRENT_HOUR: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_CURRENT_HOUR,\n NEXT_HOUR: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_NEXT_HOUR,\n PREV_MINUTE: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_PREV_MINUTE,\n MINUTE: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_MINUTE,\n CURRENT_MINUTE: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_CURRENT_MINUTE,\n NEXT_MINUTE: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_NEXT_MINUTE,\n PREV_MERIDIEM: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_PREV_MERIDIEM,\n MERIDIEM: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_MERIDIEM,\n CURRENT_MERIDIEM: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_CURRENT_MERIDIEM,\n NEXT_MERIDIEM: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_NEXT_MERIDIEM,\n },\n CONTEXTUAL_MENU: {\n CALENDAR: FORM_DATE_TIME_PICKER_DATA_TESTID.CONTEXTUAL_MENU_CALENDAR,\n TIMEWHEEL: FORM_DATE_TIME_PICKER_DATA_TESTID.CONTEXTUAL_MENU_TIMEWHEEL,\n CALENDAR_TIMEWHEEL: FORM_DATE_TIME_PICKER_DATA_TESTID.CONTEXTUAL_MENU_CALENDAR_TIMEWHEEL,\n },\n CONTROLLER_COMPONENT: {\n CALENDAR: FORM_DATE_TIME_PICKER_DATA_TESTID.CONTROLLER_COMPONENT_CALENDAR,\n TIMEWHEEL: FORM_DATE_TIME_PICKER_DATA_TESTID.CONTROLLER_COMPONENT_TIMEWHEEL,\n CALENDAR_TIMEWHEEL: FORM_DATE_TIME_PICKER_DATA_TESTID.CONTROLLER_COMPONENT_CALENDAR_TIMEWHEEL,\n },\n FOOTERS: {\n CALENDAR: FORM_DATE_TIME_PICKER_DATA_TESTID.FOOTERS_CALENDAR,\n TIMEWHEEL: FORM_DATE_TIME_PICKER_DATA_TESTID.FOOTERS_TIMEWHEEL,\n CALENDAR_TIMEWHEEL: FORM_DATE_TIME_PICKER_DATA_TESTID.FOOTERS_CALENDAR_TIMEWHEEL,\n },\n CLEAR_BUTTON: FORM_DATE_TIME_PICKER_DATA_TESTID.CLEAR_BUTTON,\n} as const;\n/* ******************************************************************************************\n END OF LEGACY CODE (kept to avoid breaking changes)\n****************************************************************************************** */\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAA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B;AAAA,EACrB,gBAAgB;AAAA,EAChB,wBAAwB;AAAA,EACxB,qBAAqB;AAAA,EACrB,uBAAuB;AAAA,EACvB,kBAAkB;AAAA,EAClB,0BAA0B;AAAA,EAC1B,uBAAuB;AAAA,EACvB,yBAAyB;AAAA,EACzB,oBAAoB;AAAA,EACpB,4BAA4B;AAAA,EAC5B,yBAAyB;AAAA,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSControlledDateTimePickerName = 'DSControlleddatetimepicker';\n\n// we are naming this with the ${component_name}_slots convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const FORM_DATE_TIME_PICKER_SLOTS = {\n CONTAINER: 'root',\n // THE SLOT IS ABOUT \"DATE\" EVEN IF THE STRING SAYS \"time-...\"\n // When this was first defined there was a typo in the string, now we can't change because it is a deliverable and would impact application space.\n DATE_INPUTS_MONTH: 'time-picker-month-input',\n DATE_INPUTS_DAY: 'time-picker-day-input',\n DATE_INPUTS_YEAR: 'time-picker-year-input',\n // end of typo\n TIME_INPUTS_HOUR: 'time-picker-hour-input',\n TIME_INPUTS_MINUTE: 'time-picker-minute-input',\n TIME_INPUTS_MERIDIEM: 'time-picker-meridiem-input',\n PICKER_ICONS_CALENDAR: 'calendar-trigger-icon',\n PICKER_ICONS_TIMEWHEEL: 'timewheel-trigger-icon',\n PICKER_ICONS_CALENDAR_TIMEWHEEL: 'calendar-timewheel-trigger-icon',\n CALENDAR_DAY_BUTTON: 'calendar-day',\n CALENDAR_HEADER_LABEL: 'calendar-header-label',\n CALENDAR_HEADER_BUTTON: 'calendar-header-buttons',\n CALENDAR_HEADER_WEEKLY_DAY_LIST: 'calendar-header-weekly-day-list',\n TIMEWHEEL_TIME_BUTTON: 'timewheel-time-button',\n TIMEWHEEL_TIME_CHANGE_BUTTON: 'timewheel-time-change-button',\n TIMEWHEEL_HEADER_LABEL: 'timewheel-header-label',\n CONTEXTUAL_MENU_CALENDAR: 'calendar-context-content-wrapper',\n CONTEXTUAL_MENU_TIMEWHEEL: 'timewheel-context-content-wrapper',\n CONTEXTUAL_MENU_CALENDAR_TIMEWHEEL: 'calendar-timewheel-context-content-wrapper',\n FOOTERS_CALENDAR: 'calendar-context-footer',\n FOOTERS_TIMEWHEEL: 'timewheel-context-footer',\n FOOTERS_CALENDAR_TIMEWHEEL: 'calendar-timewheel-context-footer',\n CONTROLLER_COMPONENT_CALENDAR: 'calendar-controller-wrapper',\n CONTROLLER_COMPONENT_TIMEWHEEL: 'timewheel-controller-wrapper',\n CONTROLLER_COMPONENT_CALENDAR_TIMEWHEEL: 'calendar-timewheel-controller-wrapper',\n CLEAR_BUTTON: 'clear-btn',\n} as const;\n\nconst PRE_EXISTING_DATA_TESTID = {\n // we are keeping the old names for backward compatibility...\n CONTAINER: 'ds-controlled-date-time-picker-container',\n DATE_INPUTS_MONTH: 'ds-controlled-date-time-picker-month-input',\n DATE_INPUTS_DAY: 'ds-controlled-date-time-picker-day-input',\n DATE_INPUTS_YEAR: 'ds-controlled-date-time-picker-year-input',\n TIME_INPUTS_HOUR: 'ds-controlled-date-time-picker-hour-input',\n TIME_INPUTS_MINUTE: 'ds-controlled-date-time-picker-minute-input',\n TIME_INPUTS_MERIDIEM: 'ds-controlled-date-time-picker-meridiem-input',\n PICKER_ICONS_CALENDAR: 'ds-controlled-date-time-picker-calendar-trigger-icon',\n PICKER_ICONS_TIMEWHEEL: 'ds-controlled-date-time-picker-timewheel-trigger-icon',\n PICKER_ICONS_CALENDAR_TIMEWHEEL: 'ds-controlled-date-time-picker-calendar-timewheel-trigger-icon',\n CALENDAR_TABLE_WRAPPER: 'ds-controlled-date-time-picker-calendar-table-wrapper',\n CALENDAR_HEADER_LABEL: 'ds-controlled-date-time-picker-calendar-header-label',\n CALENDAR_PREV_YEAR: 'ds-controlled-date-time-picker-calendar-prev-year',\n CALENDAR_PREV_MONTH: 'ds-controlled-date-time-picker-calendar-prev-month',\n CALENDAR_DAY: 'ds-controlled-date-time-picker-calendar-day',\n CALENDAR_FOCUSED_DAY: 'ds-controlled-date-time-picker-calendar-focused-day',\n CALENDAR_START_RANGE_DAY: 'ds-controlled-date-time-picker-calendar-start-range-day',\n CALENDAR_IN_RANGE_DAY: 'ds-controlled-date-time-picker-calendar-in-range-day',\n CALENDAR_END_RANGE_DAY: 'ds-controlled-date-time-picker-calendar-end-range-day',\n CALENDAR_SELECTED_DAY: 'ds-controlled-date-time-picker-calendar-selected-day',\n CALENDAR_SELECTED_FOCUSED_DAY: 'ds-controlled-date-time-picker-calendar-selected-focused-day',\n CALENDAR_NEXT_MONTH: 'ds-controlled-date-time-picker-calendar-next-month',\n CALENDAR_NEXT_YEAR: 'ds-controlled-date-time-picker-calendar-next-year',\n TIMEWHEEL_HEADER_LABEL: 'ds-controlled-date-time-picker-timewheel-header-label',\n TIMEWHEEL_PREV_HOUR: 'ds-controlled-date-time-picker-timewheel-prev-hour',\n TIMEWHEEL_HOUR: 'ds-controlled-date-time-picker-timewheel-hour',\n TIMEWHEEL_CURRENT_HOUR: 'ds-controlled-date-time-picker-timewheel-current-hour',\n TIMEWHEEL_NEXT_HOUR: 'ds-controlled-date-time-picker-timewheel-next-hour',\n TIMEWHEEL_PREV_MINUTE: 'ds-controlled-date-time-picker-timewheel-prev-minute',\n TIMEWHEEL_MINUTE: 'ds-controlled-date-time-picker-timewheel-minute',\n TIMEWHEEL_CURRENT_MINUTE: 'ds-controlled-date-time-picker-timewheel-current-minute',\n TIMEWHEEL_NEXT_MINUTE: 'ds-controlled-date-time-picker-timewheel-next-minute',\n TIMEWHEEL_PREV_MERIDIEM: 'ds-controlled-date-time-picker-timewheel-prev-meridiem',\n TIMEWHEEL_MERIDIEM: 'ds-controlled-date-time-picker-timewheel-meridiem',\n TIMEWHEEL_CURRENT_MERIDIEM: 'ds-controlled-date-time-picker-timewheel-current-meridiem',\n TIMEWHEEL_NEXT_MERIDIEM: 'ds-controlled-date-time-picker-timewheel-next-meridiem',\n // MeridiemList renders a dual-layer pattern (see KNOWN_INTENTIONAL_DEVIATIONS.md DEV-001):\n // - A11y layer: invisible semantic listbox \u2014 the real focus target, owns CURRENT_MERIDIEM above.\n // - Visual layer: aria-hidden StyledTimeBtn elements \u2014 presentation only, no focus capability.\n //\n // CURRENT_MERIDIEM / MERIDIEM originally lived on the visual elements. When the a11y layer became\n // the focus target, CURRENT_MERIDIEM moved to the listbox. The visual elements received\n // -visual-element-suffixed testids to prevent DOM query duplication (getByTestId would otherwise\n // return two elements with the same testid and throw in most automation frameworks).\n //\n // data-dimsum-slot on StyledTimeBtn (TIMEWHEEL_TIME_BUTTON) is unaffected \u2014 theming via slots is unchanged.\n TIMEWHEEL_MERIDIEM_VISUAL_ELEMENT: 'ds-controlled-date-time-picker-timewheel-meridiem-visual-element',\n TIMEWHEEL_CURRENT_MERIDIEM_VISUAL_ELEMENT: 'ds-controlled-date-time-picker-timewheel-current-meridiem-visual-element',\n CONTEXTUAL_MENU_CALENDAR: 'ds-controlled-date-time-picker-calendar-context-content-wrapper',\n CONTEXTUAL_MENU_TIMEWHEEL: 'ds-controlled-date-time-picker-timewheel-context-content-wrapper',\n CONTEXTUAL_MENU_CALENDAR_TIMEWHEEL: 'ds-controlled-date-time-picker-calendar-timewheel-context-content-wrapper',\n CONTROLLER_COMPONENT_CALENDAR: 'ds-controlled-date-time-picker-calendar-controller-wrapper',\n CONTROLLER_COMPONENT_TIMEWHEEL: 'ds-controlled-date-time-picker-timewheel-controller-wrapper',\n CONTROLLER_COMPONENT_CALENDAR_TIMEWHEEL: 'ds-controlled-date-time-picker-calendar-timewheel-controller-wrapper',\n FOOTERS_CALENDAR: 'ds-controlled-date-time-picker-calendar-context-footer',\n FOOTERS_TIMEWHEEL: 'ds-controlled-date-time-picker-timewheel-context-footer',\n FOOTERS_CALENDAR_TIMEWHEEL: 'ds-controlled-date-time-picker-calendar-timewheel-context-footer',\n CLEAR_BUTTON: 'ds-controlled-date-time-picker-clear-btn',\n} as const;\n\n// we are naming this with the ${component_name}_data_testid convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const FORM_DATE_TIME_PICKER_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSControlledDateTimePickerName, FORM_DATE_TIME_PICKER_SLOTS),\n ...PRE_EXISTING_DATA_TESTID,\n};\n\n/* ******************************************************************************************\nThis component was created before the team had a convention for data-testid and slots.\n*********************************************************************************************\n START OF LEGACY CODE (kept to avoid breaking changes)\n****************************************************************************************** */\nexport const DSControlledDateTimePickerSlotsFlatten = FORM_DATE_TIME_PICKER_SLOTS;\nexport const DSControlledDateTimePickerSlots = {\n CONTAINER: FORM_DATE_TIME_PICKER_SLOTS.CONTAINER,\n DATE_INPUTS: {\n MONTH: FORM_DATE_TIME_PICKER_SLOTS.DATE_INPUTS_MONTH,\n DAY: FORM_DATE_TIME_PICKER_SLOTS.DATE_INPUTS_DAY,\n YEAR: FORM_DATE_TIME_PICKER_SLOTS.DATE_INPUTS_YEAR,\n },\n TIME_INPUTS: {\n HOUR: FORM_DATE_TIME_PICKER_SLOTS.TIME_INPUTS_HOUR,\n MINUTE: FORM_DATE_TIME_PICKER_SLOTS.TIME_INPUTS_MINUTE,\n MERIDIEM: FORM_DATE_TIME_PICKER_SLOTS.TIME_INPUTS_MERIDIEM,\n },\n PICKER_ICONS: {\n CALENDAR: FORM_DATE_TIME_PICKER_SLOTS.PICKER_ICONS_CALENDAR,\n TIMEWHEEL: FORM_DATE_TIME_PICKER_SLOTS.PICKER_ICONS_TIMEWHEEL,\n CALENDAR_TIMEWHEEL: FORM_DATE_TIME_PICKER_SLOTS.PICKER_ICONS_CALENDAR_TIMEWHEEL,\n },\n CALENDAR: {\n DAY_BUTTON: FORM_DATE_TIME_PICKER_SLOTS.CALENDAR_DAY_BUTTON,\n HEADER_LABEL: FORM_DATE_TIME_PICKER_SLOTS.CALENDAR_HEADER_LABEL,\n HEADER_BUTTON: FORM_DATE_TIME_PICKER_SLOTS.CALENDAR_HEADER_BUTTON,\n HEADER_WEEKLY_DAY_LIST: FORM_DATE_TIME_PICKER_SLOTS.CALENDAR_HEADER_WEEKLY_DAY_LIST,\n },\n TIMEWHEEL: {\n TIME_BUTTON: FORM_DATE_TIME_PICKER_SLOTS.TIMEWHEEL_TIME_BUTTON,\n TIME_CHANGE_BUTTON: FORM_DATE_TIME_PICKER_SLOTS.TIMEWHEEL_TIME_CHANGE_BUTTON,\n HEADER_LABEL: FORM_DATE_TIME_PICKER_SLOTS.TIMEWHEEL_HEADER_LABEL,\n },\n CONTEXTUAL_MENU: {\n CALENDAR: FORM_DATE_TIME_PICKER_SLOTS.CONTEXTUAL_MENU_CALENDAR,\n TIMEWHEEL: FORM_DATE_TIME_PICKER_SLOTS.CONTEXTUAL_MENU_TIMEWHEEL,\n CALENDAR_TIMEWHEEL: FORM_DATE_TIME_PICKER_SLOTS.CONTEXTUAL_MENU_CALENDAR_TIMEWHEEL,\n },\n FOOTERS: {\n CALENDAR: FORM_DATE_TIME_PICKER_SLOTS.FOOTERS_CALENDAR,\n TIMEWHEEL: FORM_DATE_TIME_PICKER_SLOTS.FOOTERS_TIMEWHEEL,\n CALENDAR_TIMEWHEEL: FORM_DATE_TIME_PICKER_SLOTS.FOOTERS_CALENDAR_TIMEWHEEL,\n },\n CONTROLLER_COMPONENT: {\n CALENDAR: FORM_DATE_TIME_PICKER_SLOTS.CONTROLLER_COMPONENT_CALENDAR,\n TIMEWHEEL: FORM_DATE_TIME_PICKER_SLOTS.CONTROLLER_COMPONENT_TIMEWHEEL,\n CALENDAR_TIMEWHEEL: FORM_DATE_TIME_PICKER_SLOTS.CONTROLLER_COMPONENT_CALENDAR_TIMEWHEEL,\n },\n CLEAR_BUTTON: FORM_DATE_TIME_PICKER_SLOTS.CLEAR_BUTTON,\n};\nexport const ControlledDateTimePickerDatatestidFlattened = FORM_DATE_TIME_PICKER_DATA_TESTID;\nexport const ControlledDateTimePickerDatatestid = {\n CONTAINER: FORM_DATE_TIME_PICKER_DATA_TESTID.CONTAINER,\n DATE_INPUTS: {\n MONTH: FORM_DATE_TIME_PICKER_DATA_TESTID.DATE_INPUTS_MONTH,\n DAY: FORM_DATE_TIME_PICKER_DATA_TESTID.DATE_INPUTS_DAY,\n YEAR: FORM_DATE_TIME_PICKER_DATA_TESTID.DATE_INPUTS_YEAR,\n },\n TIME_INPUTS: {\n HOUR: FORM_DATE_TIME_PICKER_DATA_TESTID.TIME_INPUTS_HOUR,\n MINUTE: FORM_DATE_TIME_PICKER_DATA_TESTID.TIME_INPUTS_MINUTE,\n MERIDIEM: FORM_DATE_TIME_PICKER_DATA_TESTID.TIME_INPUTS_MERIDIEM,\n },\n PICKER_ICONS: {\n CALENDAR: FORM_DATE_TIME_PICKER_DATA_TESTID.PICKER_ICONS_CALENDAR,\n TIMEWHEEL: FORM_DATE_TIME_PICKER_DATA_TESTID.PICKER_ICONS_TIMEWHEEL,\n CALENDAR_TIMEWHEEL: FORM_DATE_TIME_PICKER_DATA_TESTID.PICKER_ICONS_CALENDAR_TIMEWHEEL,\n },\n CALENDAR: {\n TABLE_WRAPPER: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_TABLE_WRAPPER,\n HEADER_LABEL: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_HEADER_LABEL,\n PREV_YEAR: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_PREV_YEAR,\n PREV_MONTH: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_PREV_MONTH,\n DAY: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_DAY,\n FOCUSED_DAY: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_FOCUSED_DAY,\n START_RANGE_DAY: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_START_RANGE_DAY,\n IN_RANGE_DAY: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_IN_RANGE_DAY,\n END_RANGE_DAY: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_END_RANGE_DAY,\n SELECTED_DAY: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_SELECTED_DAY,\n SELECTED_FOCUSED_DAY: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_SELECTED_FOCUSED_DAY,\n NEXT_MONTH: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_NEXT_MONTH,\n NEXT_YEAR: FORM_DATE_TIME_PICKER_DATA_TESTID.CALENDAR_NEXT_YEAR,\n },\n TIMEWHEEL: {\n HEADER_LABEL: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_HEADER_LABEL,\n PREV_HOUR: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_PREV_HOUR,\n HOUR: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_HOUR,\n CURRENT_HOUR: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_CURRENT_HOUR,\n NEXT_HOUR: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_NEXT_HOUR,\n PREV_MINUTE: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_PREV_MINUTE,\n MINUTE: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_MINUTE,\n CURRENT_MINUTE: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_CURRENT_MINUTE,\n NEXT_MINUTE: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_NEXT_MINUTE,\n PREV_MERIDIEM: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_PREV_MERIDIEM,\n MERIDIEM: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_MERIDIEM,\n CURRENT_MERIDIEM: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_CURRENT_MERIDIEM,\n NEXT_MERIDIEM: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_NEXT_MERIDIEM,\n MERIDIEM_VISUAL_ELEMENT: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_MERIDIEM_VISUAL_ELEMENT,\n CURRENT_MERIDIEM_VISUAL_ELEMENT: FORM_DATE_TIME_PICKER_DATA_TESTID.TIMEWHEEL_CURRENT_MERIDIEM_VISUAL_ELEMENT,\n },\n CONTEXTUAL_MENU: {\n CALENDAR: FORM_DATE_TIME_PICKER_DATA_TESTID.CONTEXTUAL_MENU_CALENDAR,\n TIMEWHEEL: FORM_DATE_TIME_PICKER_DATA_TESTID.CONTEXTUAL_MENU_TIMEWHEEL,\n CALENDAR_TIMEWHEEL: FORM_DATE_TIME_PICKER_DATA_TESTID.CONTEXTUAL_MENU_CALENDAR_TIMEWHEEL,\n },\n CONTROLLER_COMPONENT: {\n CALENDAR: FORM_DATE_TIME_PICKER_DATA_TESTID.CONTROLLER_COMPONENT_CALENDAR,\n TIMEWHEEL: FORM_DATE_TIME_PICKER_DATA_TESTID.CONTROLLER_COMPONENT_TIMEWHEEL,\n CALENDAR_TIMEWHEEL: FORM_DATE_TIME_PICKER_DATA_TESTID.CONTROLLER_COMPONENT_CALENDAR_TIMEWHEEL,\n },\n FOOTERS: {\n CALENDAR: FORM_DATE_TIME_PICKER_DATA_TESTID.FOOTERS_CALENDAR,\n TIMEWHEEL: FORM_DATE_TIME_PICKER_DATA_TESTID.FOOTERS_TIMEWHEEL,\n CALENDAR_TIMEWHEEL: FORM_DATE_TIME_PICKER_DATA_TESTID.FOOTERS_CALENDAR_TIMEWHEEL,\n },\n CLEAR_BUTTON: FORM_DATE_TIME_PICKER_DATA_TESTID.CLEAR_BUTTON,\n} as const;\n/* ******************************************************************************************\n END OF LEGACY CODE (kept to avoid breaking changes)\n****************************************************************************************** */\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCv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IACxC,cAAc,kCAAkC;AAAA,IAChD,WAAW,kCAAkC;AAAA,IAC7C,aAAa,kCAAkC;AAAA,IAC/C,QAAQ,kCAAkC;AAAA,IAC1C,gBAAgB,kCAAkC;AAAA,IAClD,aAAa,kCAAkC;AAAA,IAC/C,eAAe,kCAAkC;AAAA,IACjD,UAAU,kCAAkC;AAAA,IAC5C,kBAAkB,kCAAkC;AAAA,IACpD,eAAe,kCAAkC;AAAA,IACjD,yBAAyB,kCAAkC;AAAA,IAC3D,iCAAiC,kCAAkC;AAAA,EACrE;AAAA,EACA,iBAAiB;AAAA,IACf,UAAU,kCAAkC;AAAA,IAC5C,WAAW,kCAAkC;AAAA,IAC7C,oBAAoB,kCAAkC;AAAA,EACxD;AAAA,EACA,sBAAsB;AAAA,IACpB,UAAU,kCAAkC;AAAA,IAC5C,WAAW,kCAAkC;AAAA,IAC7C,oBAAoB,kCAAkC;AAAA,EACxD;AAAA,EACA,SAAS;AAAA,IACP,UAAU,kCAAkC;AAAA,IAC5C,WAAW,kCAAkC;AAAA,IAC7C,oBAAoB,kCAAkC;AAAA,EACxD;AAAA,EACA,cAAc,kCAAkC;AAClD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
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
|
}
|
package/dist/cjs/package.json
CHANGED
|
@@ -84,7 +84,7 @@ const ControlledDateTimePickerContent = () => {
|
|
|
84
84
|
"data-testid": import_constants.ControlledDateTimePickerDatatestid.CONTAINER,
|
|
85
85
|
getOwnerProps: getProps,
|
|
86
86
|
onlyPicker,
|
|
87
|
-
readOnlyStyles: readOnly || applyAriaDisabled,
|
|
87
|
+
$readOnlyStyles: readOnly || applyAriaDisabled,
|
|
88
88
|
...styledsAttrs,
|
|
89
89
|
...(0, import_lodash_es.omit)(globalAttrs, "tabIndex", "autoFocus"),
|
|
90
90
|
...xstyledAttrs,
|
|
@@ -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 { Grid } from '@elliemae/ds-grid';\nimport { omit } from 'lodash-es';\nimport { useContext } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../constants/index.js';\nimport { ControlledDateTimePickerContext } from '../ControlledDateTimePickerCTX.js';\nimport { ClearButton } from './ClearButton/ClearButton.js';\nimport { DateInputs } from './DateInputs/DateInputs.js';\nimport { PickersIcons } from './Pickers/PickersIcons.js';\nimport { StyledInputsWrapperGrid } from './Styleds.js';\nimport { TimeInputs } from './TimeInputs/TimeInputs.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,qBAAqB;AACrB,uBAAqB;AACrB,mBAA2B;AAC3B,uBAAmD;AACnD,yCAAgD;AAChD,yBAA4B;AAC5B,wBAA2B;AAC3B,0BAA6B;AAC7B,qBAAwC;AACxC,wBAA2B;AAEpB,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,oDAAmC;AAAA,MAChD,eAAe;AAAA,MACf;AAAA,MACA,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable complexity */\nimport { Grid } from '@elliemae/ds-grid';\nimport { omit } from 'lodash-es';\nimport { useContext } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../constants/index.js';\nimport { ControlledDateTimePickerContext } from '../ControlledDateTimePickerCTX.js';\nimport { ClearButton } from './ClearButton/ClearButton.js';\nimport { DateInputs } from './DateInputs/DateInputs.js';\nimport { PickersIcons } from './Pickers/PickersIcons.js';\nimport { StyledInputsWrapperGrid } from './Styleds.js';\nimport { TimeInputs } from './TimeInputs/TimeInputs.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,qBAAqB;AACrB,uBAAqB;AACrB,mBAA2B;AAC3B,uBAAmD;AACnD,yCAAgD;AAChD,yBAA4B;AAC5B,wBAA2B;AAC3B,0BAA6B;AAC7B,qBAAwC;AACxC,wBAA2B;AAEpB,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,oDAAmC;AAAA,MAChD,eAAe;AAAA,MACf;AAAA,MACA,iBAAiB,YAAY;AAAA,MAC5B,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
|
}
|
|
@@ -36,6 +36,8 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
37
|
var import_constants = require("../../constants/index.js");
|
|
38
38
|
var import_Styleds = require("../Styleds.js");
|
|
39
|
+
var import_constants2 = require("../../utils/constants.js");
|
|
40
|
+
var import_numberHelpers = require("../../utils/numberHelpers.js");
|
|
39
41
|
const regExpNumbers = /^[0-9]+$/;
|
|
40
42
|
const isInvalidDay = (day) => {
|
|
41
43
|
if (day === "") return false;
|
|
@@ -70,6 +72,7 @@ const DDInput = import_react.default.memo(
|
|
|
70
72
|
},
|
|
71
73
|
[onChange]
|
|
72
74
|
);
|
|
75
|
+
const dayNum = (0, import_numberHelpers.convertToPositiveNumberIfPossible)(value);
|
|
73
76
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
74
77
|
import_Styleds.StyledDateInput,
|
|
75
78
|
{
|
|
@@ -90,7 +93,12 @@ const DDInput = import_react.default.memo(
|
|
|
90
93
|
"aria-disabled": applyAriaDisabled,
|
|
91
94
|
"aria-invalid": hasError,
|
|
92
95
|
getOwnerProps: getProps,
|
|
93
|
-
readOnly
|
|
96
|
+
readOnly,
|
|
97
|
+
role: "spinbutton",
|
|
98
|
+
"aria-valuemin": 1,
|
|
99
|
+
"aria-valuemax": 31,
|
|
100
|
+
"aria-valuenow": dayNum === -1 ? void 0 : dayNum,
|
|
101
|
+
"aria-valuetext": dayNum === -1 ? "empty" : import_constants2.announcableCardinalDays[dayNum]
|
|
94
102
|
}
|
|
95
103
|
);
|
|
96
104
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/DateInputs/DDInput.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport React, { useCallback } from 'react';\nimport type { ControlledDateTimePickerContextT } from '../../config/useControlledDateTimePicker.js';\nimport { ControlledDateTimePickerDatatestid } from '../../constants/index.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\nimport { StyledDateInput } from '../Styleds.js';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidDay = (day: string) => {\n if (day === '') return false;\n const numberOnly = regExpNumbers.test(day);\n return day.length > 2 || day === '00' || !numberOnly || Number.parseInt(day, 10) > 31;\n};\n\ninterface DDInputsPropsT {\n onChange: DSControlledDateTimePickerInternalsT.OnChangeFunc;\n onBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc;\n onFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc;\n onKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown;\n value: string;\n disabled: boolean;\n applyAriaDisabled?: boolean;\n hasError: boolean;\n placeholder: string;\n ariaCurrentValueForInputs: string;\n contextRef: React.MutableRefObject<HTMLInputElement | null>;\n tabIndex?: TypescriptHelpersT.WCAGTabIndex;\n isFocused: boolean;\n getProps: ControlledDateTimePickerContextT['getProps'];\n readOnly: boolean;\n}\nexport const DDInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n applyAriaDisabled,\n hasError,\n contextRef,\n tabIndex,\n placeholder,\n ariaCurrentValueForInputs,\n isFocused,\n getProps,\n readOnly,\n }: DDInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidDay(e?.currentTarget?.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n return (\n <StyledDateInput\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n innerRef={(DomElem: HTMLInputElement) => {\n (contextRef as React.MutableRefObject<HTMLInputElement>).current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n tabIndex={tabIndex}\n placeholder={placeholder}\n aria-label={`day input field, ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.DATE_INPUTS.DAY}\n disabled={disabled}\n aria-disabled={applyAriaDisabled}\n aria-invalid={hasError}\n getOwnerProps={getProps}\n readOnly={readOnly}\n />\n );\n },\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
6
|
-
"names": ["React"]
|
|
4
|
+
"sourcesContent": ["import { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport React, { useCallback } from 'react';\nimport type { ControlledDateTimePickerContextT } from '../../config/useControlledDateTimePicker.js';\nimport { ControlledDateTimePickerDatatestid } from '../../constants/index.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\nimport { StyledDateInput } from '../Styleds.js';\nimport { announcableCardinalDays } from '../../utils/constants.js';\nimport { convertToPositiveNumberIfPossible } from '../../utils/numberHelpers.js';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidDay = (day: string) => {\n if (day === '') return false;\n const numberOnly = regExpNumbers.test(day);\n return day.length > 2 || day === '00' || !numberOnly || Number.parseInt(day, 10) > 31;\n};\n\ninterface DDInputsPropsT {\n onChange: DSControlledDateTimePickerInternalsT.OnChangeFunc;\n onBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc;\n onFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc;\n onKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown;\n value: string;\n disabled: boolean;\n applyAriaDisabled?: boolean;\n hasError: boolean;\n placeholder: string;\n ariaCurrentValueForInputs: string;\n contextRef: React.MutableRefObject<HTMLInputElement | null>;\n tabIndex?: TypescriptHelpersT.WCAGTabIndex;\n isFocused: boolean;\n getProps: ControlledDateTimePickerContextT['getProps'];\n readOnly: boolean;\n}\nexport const DDInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n applyAriaDisabled,\n hasError,\n contextRef,\n tabIndex,\n placeholder,\n ariaCurrentValueForInputs,\n isFocused,\n getProps,\n readOnly,\n }: DDInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidDay(e?.currentTarget?.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n const dayNum = convertToPositiveNumberIfPossible(value) as DSControlledDateTimePickerInternalsT.DateDay | -1;\n\n return (\n <StyledDateInput\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n innerRef={(DomElem: HTMLInputElement) => {\n (contextRef as React.MutableRefObject<HTMLInputElement>).current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n tabIndex={tabIndex}\n placeholder={placeholder}\n aria-label={`day input field, ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.DATE_INPUTS.DAY}\n disabled={disabled}\n aria-disabled={applyAriaDisabled}\n aria-invalid={hasError}\n getOwnerProps={getProps}\n readOnly={readOnly}\n role=\"spinbutton\"\n aria-valuemin={1}\n aria-valuemax={31}\n aria-valuenow={dayNum === -1 ? undefined : dayNum}\n aria-valuetext={dayNum === -1 ? 'empty' : announcableCardinalDays[dayNum]}\n />\n );\n },\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADgEjB;AA/DN,mBAAmC;AAEnC,uBAAmD;AAEnD,qBAAgC;AAChC,IAAAA,oBAAwC;AACxC,2BAAkD;AAElD,MAAM,gBAAgB;AACtB,MAAM,eAAe,CAAC,QAAgB;AACpC,MAAI,QAAQ,GAAI,QAAO;AACvB,QAAM,aAAa,cAAc,KAAK,GAAG;AACzC,SAAO,IAAI,SAAS,KAAK,QAAQ,QAAQ,CAAC,cAAc,OAAO,SAAS,KAAK,EAAE,IAAI;AACrF;AAmBO,MAAM,UAAU,aAAAC,QAAM;AAAA,EAC3B,CAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,MAAmC;AACjC,UAAM,uBAAmB;AAAA,MACvB,CAAC,MAA2C;AAC1C,YAAI,aAAa,GAAG,eAAe,KAAK,GAAG;AACzC,YAAE,eAAe;AACjB;AAAA,QACF;AACA,iBAAS,CAAC;AAAA,MACZ;AAAA,MACA,CAAC,QAAQ;AAAA,IACX;AACA,UAAM,aAAS,wDAAkC,KAAK;AAEtD,WACE;AAAA,MAAC;AAAA;AAAA,QACC,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,UAAU,CAAC,YAA8B;AACvC,UAAC,WAAwD,UAAU;AACnE,cAAI,UAAW,UAAS,QAAQ;AAAA,QAClC;AAAA,QACA;AAAA,QACA;AAAA,QACA,cAAY,oBAAoB,yBAAyB;AAAA,QACzD,eAAa,oDAAmC,YAAY;AAAA,QAC5D;AAAA,QACA,iBAAe;AAAA,QACf,gBAAc;AAAA,QACd,eAAe;AAAA,QACf;AAAA,QACA,MAAK;AAAA,QACL,iBAAe;AAAA,QACf,iBAAe;AAAA,QACf,iBAAe,WAAW,KAAK,SAAY;AAAA,QAC3C,kBAAgB,WAAW,KAAK,UAAU,0CAAwB,MAAM;AAAA;AAAA,IAC1E;AAAA,EAEJ;AACF;",
|
|
6
|
+
"names": ["import_constants", "React"]
|
|
7
7
|
}
|
|
@@ -37,6 +37,8 @@ var import_ds_system = require("@elliemae/ds-system");
|
|
|
37
37
|
var import_react = __toESM(require("react"));
|
|
38
38
|
var import_constants = require("../../constants/index.js");
|
|
39
39
|
var import_Styleds = require("../Styleds.js");
|
|
40
|
+
var import_numberHelpers = require("../../utils/numberHelpers.js");
|
|
41
|
+
var import_constants2 = require("../../utils/constants.js");
|
|
40
42
|
const regExpNumbers = /^[0-9]+$/;
|
|
41
43
|
const isInvalidMonth = (month) => {
|
|
42
44
|
if (month === "") return false;
|
|
@@ -86,6 +88,7 @@ const MMInput = import_react.default.memo(
|
|
|
86
88
|
}
|
|
87
89
|
return handleRef;
|
|
88
90
|
}, [handleRef, innerRef]);
|
|
91
|
+
const monthNum = (0, import_numberHelpers.convertToPositiveNumberIfPossible)(value);
|
|
89
92
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
90
93
|
import_Styleds.StyledMonthInput,
|
|
91
94
|
{
|
|
@@ -104,7 +107,12 @@ const MMInput = import_react.default.memo(
|
|
|
104
107
|
"aria-disabled": applyAriaDisabled,
|
|
105
108
|
"aria-invalid": hasError,
|
|
106
109
|
getOwnerProps: getProps,
|
|
107
|
-
readOnly
|
|
110
|
+
readOnly,
|
|
111
|
+
role: "spinbutton",
|
|
112
|
+
"aria-valuemin": 1,
|
|
113
|
+
"aria-valuemax": 12,
|
|
114
|
+
"aria-valuenow": monthNum === -1 ? void 0 : monthNum,
|
|
115
|
+
"aria-valuetext": monthNum === -1 ? "empty" : import_constants2.monthNames[monthNum - 1]
|
|
108
116
|
}
|
|
109
117
|
);
|
|
110
118
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/DateInputs/MMInput.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { setMultipleRefs } from '@elliemae/ds-system';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport React, { useCallback, useMemo } from 'react';\nimport type { ControlledDateTimePickerContextT } from '../../config/useControlledDateTimePicker.js';\nimport { ControlledDateTimePickerDatatestid } from '../../constants/index.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\nimport { StyledMonthInput } from '../Styleds.js';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidMonth = (month: string) => {\n if (month === '') return false;\n const numberOnly = regExpNumbers.test(month);\n return month.length > 2 || month === '00' || !numberOnly || Number.parseInt(month, 10) > 12;\n};\ninterface MMInputsPropsT {\n onChange: DSControlledDateTimePickerInternalsT.OnChangeFunc;\n onBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc;\n onFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc;\n onKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown;\n autoFocusMonthInput: boolean;\n value: string;\n disabled: boolean;\n applyAriaDisabled?: boolean;\n hasError: boolean;\n contextRef: React.MutableRefObject<HTMLInputElement | null>;\n placeholder: string;\n ariaCurrentValueForInputs: string;\n isFocused: boolean;\n innerRef?:\n | React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null>\n | ((ref: HTMLInputElement | HTMLButtonElement | null) => void);\n tabIndex?: TypescriptHelpersT.WCAGTabIndex;\n getProps: ControlledDateTimePickerContextT['getProps'];\n readOnly: boolean;\n}\nexport const MMInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n applyAriaDisabled,\n hasError,\n placeholder,\n contextRef,\n innerRef,\n tabIndex,\n autoFocusMonthInput,\n ariaCurrentValueForInputs,\n isFocused,\n getProps,\n readOnly,\n }: MMInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidMonth(e?.target?.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n\n const handleRef = useCallback(\n (DomElem: HTMLInputElement) => {\n (contextRef as React.MutableRefObject<HTMLInputElement>).current = DomElem;\n if (isFocused) DomElem?.focus?.();\n },\n [contextRef, isFocused],\n );\n\n const currentRef = useMemo(() => {\n if (innerRef) {\n return setMultipleRefs([handleRef, innerRef]);\n }\n return handleRef;\n }, [handleRef, innerRef]);\n\n return (\n <StyledMonthInput\n autoFocus={autoFocusMonthInput}\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n innerRef={currentRef}\n tabIndex={tabIndex}\n placeholder={placeholder}\n aria-label={`month input field, ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.DATE_INPUTS.MONTH}\n disabled={disabled}\n aria-disabled={applyAriaDisabled}\n aria-invalid={hasError}\n getOwnerProps={getProps}\n readOnly={readOnly}\n />\n );\n },\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
6
|
-
"names": ["React"]
|
|
4
|
+
"sourcesContent": ["import { setMultipleRefs } from '@elliemae/ds-system';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport React, { useCallback, useMemo } from 'react';\nimport type { ControlledDateTimePickerContextT } from '../../config/useControlledDateTimePicker.js';\nimport { ControlledDateTimePickerDatatestid } from '../../constants/index.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\nimport { StyledMonthInput } from '../Styleds.js';\nimport { convertToPositiveNumberIfPossible } from '../../utils/numberHelpers.js';\nimport { monthNames } from '../../utils/constants.js';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidMonth = (month: string) => {\n if (month === '') return false;\n const numberOnly = regExpNumbers.test(month);\n return month.length > 2 || month === '00' || !numberOnly || Number.parseInt(month, 10) > 12;\n};\ninterface MMInputsPropsT {\n onChange: DSControlledDateTimePickerInternalsT.OnChangeFunc;\n onBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc;\n onFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc;\n onKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown;\n autoFocusMonthInput: boolean;\n value: string;\n disabled: boolean;\n applyAriaDisabled?: boolean;\n hasError: boolean;\n contextRef: React.MutableRefObject<HTMLInputElement | null>;\n placeholder: string;\n ariaCurrentValueForInputs: string;\n isFocused: boolean;\n innerRef?:\n | React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null>\n | ((ref: HTMLInputElement | HTMLButtonElement | null) => void);\n tabIndex?: TypescriptHelpersT.WCAGTabIndex;\n getProps: ControlledDateTimePickerContextT['getProps'];\n readOnly: boolean;\n}\nexport const MMInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n applyAriaDisabled,\n hasError,\n placeholder,\n contextRef,\n innerRef,\n tabIndex,\n autoFocusMonthInput,\n ariaCurrentValueForInputs,\n isFocused,\n getProps,\n readOnly,\n }: MMInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidMonth(e?.target?.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n\n const handleRef = useCallback(\n (DomElem: HTMLInputElement) => {\n (contextRef as React.MutableRefObject<HTMLInputElement>).current = DomElem;\n if (isFocused) DomElem?.focus?.();\n },\n [contextRef, isFocused],\n );\n\n const currentRef = useMemo(() => {\n if (innerRef) {\n return setMultipleRefs([handleRef, innerRef]);\n }\n return handleRef;\n }, [handleRef, innerRef]);\n\n const monthNum = convertToPositiveNumberIfPossible(value);\n\n return (\n <StyledMonthInput\n autoFocus={autoFocusMonthInput}\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n innerRef={currentRef}\n tabIndex={tabIndex}\n placeholder={placeholder}\n aria-label={`month input field, ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.DATE_INPUTS.MONTH}\n disabled={disabled}\n aria-disabled={applyAriaDisabled}\n aria-invalid={hasError}\n getOwnerProps={getProps}\n readOnly={readOnly}\n role=\"spinbutton\"\n aria-valuemin={1}\n aria-valuemax={12}\n aria-valuenow={monthNum === -1 ? undefined : monthNum}\n aria-valuetext={monthNum === -1 ? 'empty' : monthNames[monthNum - 1]}\n />\n );\n },\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADsFjB;AAt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AAA,QACV;AAAA,QACA;AAAA,QACA,cAAY,sBAAsB,yBAAyB;AAAA,QAC3D,eAAa,oDAAmC,YAAY;AAAA,QAC5D;AAAA,QACA,iBAAe;AAAA,QACf,gBAAc;AAAA,QACd,eAAe;AAAA,QACf;AAAA,QACA,MAAK;AAAA,QACL,iBAAe;AAAA,QACf,iBAAe;AAAA,QACf,iBAAe,aAAa,KAAK,SAAY;AAAA,QAC7C,kBAAgB,aAAa,KAAK,UAAU,6BAAW,WAAW,CAAC;AAAA;AAAA,IACrE;AAAA,EAEJ;AACF;",
|
|
6
|
+
"names": ["import_constants", "React"]
|
|
7
7
|
}
|
|
@@ -36,6 +36,8 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
37
|
var import_constants = require("../../constants/index.js");
|
|
38
38
|
var import_Styleds = require("../Styleds.js");
|
|
39
|
+
var import_numberHelpers = require("../../utils/numberHelpers.js");
|
|
40
|
+
var import_stringHelpers = require("../../utils/stringHelpers.js");
|
|
39
41
|
const regExpNumbers = /^[0-9]+$/;
|
|
40
42
|
const isInvalidYear = (year) => {
|
|
41
43
|
if (year === "") return false;
|
|
@@ -70,6 +72,7 @@ const YYYYInput = import_react.default.memo(
|
|
|
70
72
|
},
|
|
71
73
|
[onChange]
|
|
72
74
|
);
|
|
75
|
+
const yearNum = (0, import_numberHelpers.convertToPositiveNumberIfPossible)(value);
|
|
73
76
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
74
77
|
import_Styleds.StyledYearInput,
|
|
75
78
|
{
|
|
@@ -90,7 +93,12 @@ const YYYYInput = import_react.default.memo(
|
|
|
90
93
|
"aria-disabled": applyAriaDisabled,
|
|
91
94
|
"aria-invalid": hasError,
|
|
92
95
|
getOwnerProps: getProps,
|
|
93
|
-
readOnly
|
|
96
|
+
readOnly,
|
|
97
|
+
role: "spinbutton",
|
|
98
|
+
"aria-valuemin": 0,
|
|
99
|
+
"aria-valuemax": 9999,
|
|
100
|
+
"aria-valuenow": yearNum === -1 ? void 0 : yearNum,
|
|
101
|
+
"aria-valuetext": yearNum === -1 ? "empty" : (0, import_stringHelpers.fillStringWithPlaceHolders)(`${yearNum}`, 4, "0")
|
|
94
102
|
}
|
|
95
103
|
);
|
|
96
104
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/DateInputs/YYYYInput.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport React, { useCallback } from 'react';\nimport type { ControlledDateTimePickerContextT } from '../../config/useControlledDateTimePicker.js';\nimport { ControlledDateTimePickerDatatestid } from '../../constants/index.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\nimport { StyledYearInput } from '../Styleds.js';\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidYear = (year: string) => {\n if (year === '') return false;\n const numberOnly = regExpNumbers.test(year);\n return year.length > 4 || !numberOnly || Number.parseInt(year, 10) > 9999;\n};\n\ninterface YYYYInputsPropsT {\n onChange: DSControlledDateTimePickerInternalsT.OnChangeFunc;\n onBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc;\n onFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc;\n onKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown;\n value: string;\n disabled: boolean;\n applyAriaDisabled?: boolean;\n hasError: boolean;\n contextRef: React.MutableRefObject<HTMLInputElement | null>;\n tabIndex?: TypescriptHelpersT.WCAGTabIndex;\n placeholder: string;\n ariaCurrentValueForInputs: string;\n isFocused: boolean;\n getProps: ControlledDateTimePickerContextT['getProps'];\n readOnly: boolean;\n}\nexport const YYYYInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n applyAriaDisabled,\n hasError,\n placeholder,\n contextRef,\n tabIndex,\n ariaCurrentValueForInputs,\n isFocused,\n getProps,\n readOnly,\n }: YYYYInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidYear(e?.currentTarget?.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n return (\n <StyledYearInput\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n innerRef={(DomElem: HTMLInputElement) => {\n (contextRef as React.MutableRefObject<HTMLInputElement>).current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n tabIndex={tabIndex}\n data-testid={ControlledDateTimePickerDatatestid.DATE_INPUTS.YEAR}\n placeholder={placeholder}\n aria-label={`year input field, ${ariaCurrentValueForInputs}`}\n disabled={disabled}\n aria-disabled={applyAriaDisabled}\n aria-invalid={hasError}\n getOwnerProps={getProps}\n readOnly={readOnly}\n />\n );\n },\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport React, { useCallback } from 'react';\nimport type { ControlledDateTimePickerContextT } from '../../config/useControlledDateTimePicker.js';\nimport { ControlledDateTimePickerDatatestid } from '../../constants/index.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\nimport { StyledYearInput } from '../Styleds.js';\nimport { convertToPositiveNumberIfPossible } from '../../utils/numberHelpers.js';\nimport { fillStringWithPlaceHolders } from '../../utils/stringHelpers.js';\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidYear = (year: string) => {\n if (year === '') return false;\n const numberOnly = regExpNumbers.test(year);\n return year.length > 4 || !numberOnly || Number.parseInt(year, 10) > 9999;\n};\n\ninterface YYYYInputsPropsT {\n onChange: DSControlledDateTimePickerInternalsT.OnChangeFunc;\n onBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc;\n onFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc;\n onKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown;\n value: string;\n disabled: boolean;\n applyAriaDisabled?: boolean;\n hasError: boolean;\n contextRef: React.MutableRefObject<HTMLInputElement | null>;\n tabIndex?: TypescriptHelpersT.WCAGTabIndex;\n placeholder: string;\n ariaCurrentValueForInputs: string;\n isFocused: boolean;\n getProps: ControlledDateTimePickerContextT['getProps'];\n readOnly: boolean;\n}\nexport const YYYYInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n applyAriaDisabled,\n hasError,\n placeholder,\n contextRef,\n tabIndex,\n ariaCurrentValueForInputs,\n isFocused,\n getProps,\n readOnly,\n }: YYYYInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidYear(e?.currentTarget?.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n\n const yearNum = convertToPositiveNumberIfPossible(value);\n\n return (\n <StyledYearInput\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n innerRef={(DomElem: HTMLInputElement) => {\n (contextRef as React.MutableRefObject<HTMLInputElement>).current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n tabIndex={tabIndex}\n data-testid={ControlledDateTimePickerDatatestid.DATE_INPUTS.YEAR}\n placeholder={placeholder}\n aria-label={`year input field, ${ariaCurrentValueForInputs}`}\n disabled={disabled}\n aria-disabled={applyAriaDisabled}\n aria-invalid={hasError}\n getOwnerProps={getProps}\n readOnly={readOnly}\n role=\"spinbutton\"\n aria-valuemin={0}\n aria-valuemax={9999}\n aria-valuenow={yearNum === -1 ? undefined : yearNum}\n aria-valuetext={yearNum === -1 ? 'empty' : fillStringWithPlaceHolders(`${yearNum}`, 4, '0')}\n />\n );\n },\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADgEjB;AA/DN,mBAAmC;AAEnC,uBAAmD;AAEnD,qBAAgC;AAChC,2BAAkD;AAClD,2BAA2C;AAC3C,MAAM,gBAAgB;AACtB,MAAM,gBAAgB,CAAC,SAAiB;AACtC,MAAI,SAAS,GAAI,QAAO;AACxB,QAAM,aAAa,cAAc,KAAK,IAAI;AAC1C,SAAO,KAAK,SAAS,KAAK,CAAC,cAAc,OAAO,SAAS,MAAM,EAAE,IAAI;AACvE;AAmBO,MAAM,YAAY,aAAAA,QAAM;AAAA,EAC7B,CAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,MAAqC;AACnC,UAAM,uBAAmB;AAAA,MACvB,CAAC,MAA2C;AAC1C,YAAI,cAAc,GAAG,eAAe,KAAK,GAAG;AAC1C,YAAE,eAAe;AACjB;AAAA,QACF;AACA,iBAAS,CAAC;AAAA,MACZ;AAAA,MACA,CAAC,QAAQ;AAAA,IACX;AAEA,UAAM,cAAU,wDAAkC,KAAK;AAEvD,WACE;AAAA,MAAC;AAAA;AAAA,QACC,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,UAAU,CAAC,YAA8B;AACvC,UAAC,WAAwD,UAAU;AACnE,cAAI,UAAW,UAAS,QAAQ;AAAA,QAClC;AAAA,QACA;AAAA,QACA,eAAa,oDAAmC,YAAY;AAAA,QAC5D;AAAA,QACA,cAAY,qBAAqB,yBAAyB;AAAA,QAC1D;AAAA,QACA,iBAAe;AAAA,QACf,gBAA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