@elliemae/ds-form-date-time-picker 3.80.0-next.8 → 3.80.0-next.80
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 +14 -1
- package/dist/cjs/config/useControlledDateTimePicker.js.map +2 -2
- package/dist/cjs/config/useGlobalKeyHandlers.js +9 -2
- package/dist/cjs/config/useGlobalKeyHandlers.js.map +2 -2
- package/dist/cjs/constants/index.js +15 -1
- package/dist/cjs/constants/index.js.map +2 -2
- package/dist/cjs/parts/ClearButton/ClearButton.js +3 -1
- package/dist/cjs/parts/ClearButton/ClearButton.js.map +2 -2
- package/dist/cjs/parts/ClearButton/useClearButton.js +4 -2
- package/dist/cjs/parts/ClearButton/useClearButton.js.map +2 -2
- package/dist/cjs/parts/ControlledDateTimePickerContent.js +20 -6
- package/dist/cjs/parts/ControlledDateTimePickerContent.js.map +2 -2
- package/dist/cjs/parts/DateInputs/DDInput.js +4 -2
- package/dist/cjs/parts/DateInputs/DDInput.js.map +2 -2
- package/dist/cjs/parts/DateInputs/DateInputs.js +12 -8
- package/dist/cjs/parts/DateInputs/DateInputs.js.map +2 -2
- package/dist/cjs/parts/DateInputs/MMInput.js +4 -2
- package/dist/cjs/parts/DateInputs/MMInput.js.map +2 -2
- package/dist/cjs/parts/DateInputs/YYYYInput.js +4 -2
- package/dist/cjs/parts/DateInputs/YYYYInput.js.map +2 -2
- package/dist/cjs/parts/DateInputs/useDateInputs.js +2 -1
- package/dist/cjs/parts/DateInputs/useDateInputs.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarBody.js +18 -14
- package/dist/cjs/parts/Pickers/Calendar/CalendarBody.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/CalendarHead.js +1 -1
- package/dist/cjs/parts/Pickers/Calendar/CalendarHead.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarIconTrigger.js +6 -1
- package/dist/cjs/parts/Pickers/Calendar/CalendarIconTrigger.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarWeekDays.js +27 -22
- package/dist/cjs/parts/Pickers/Calendar/CalendarWeekDays.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/Day.js +4 -3
- package/dist/cjs/parts/Pickers/Calendar/Day.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/Styleds.js +18 -5
- package/dist/cjs/parts/Pickers/Calendar/Styleds.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/usePopperTriggerLogic.js +12 -3
- package/dist/cjs/parts/Pickers/Calendar/usePopperTriggerLogic.js.map +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +6 -1
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +2 -2
- package/dist/cjs/parts/Pickers/PickersIcons.js +2 -1
- package/dist/cjs/parts/Pickers/PickersIcons.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js +8 -7
- package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js +11 -9
- package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js +8 -7
- package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/Styleds.js +18 -5
- package/dist/cjs/parts/Pickers/TimeWheel/Styleds.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContent.js +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContent.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +6 -1
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +4 -3
- package/dist/cjs/parts/Pickers/TimeWheel/usePopperTriggerLogic.js.map +2 -2
- package/dist/cjs/parts/Styleds.js +19 -40
- package/dist/cjs/parts/Styleds.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/HHInput.js +4 -2
- package/dist/cjs/parts/TimeInputs/HHInput.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/MeridiemInput.js +4 -2
- package/dist/cjs/parts/TimeInputs/MeridiemInput.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/MinutesInput.js +4 -2
- package/dist/cjs/parts/TimeInputs/MinutesInput.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/TimeInputs.js +12 -11
- package/dist/cjs/parts/TimeInputs/TimeInputs.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/useTimeInputs.js +2 -1
- package/dist/cjs/parts/TimeInputs/useTimeInputs.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +6 -2
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/slot-arguments-polymorphic-typescript.js.map +1 -1
- package/dist/cjs/typescript-testing/slot-props.js +73 -0
- package/dist/cjs/typescript-testing/slot-props.js.map +2 -2
- package/dist/esm/config/useControlledDateTimePicker.js +14 -1
- package/dist/esm/config/useControlledDateTimePicker.js.map +2 -2
- package/dist/esm/config/useGlobalKeyHandlers.js +9 -2
- package/dist/esm/config/useGlobalKeyHandlers.js.map +2 -2
- package/dist/esm/constants/index.js +15 -1
- package/dist/esm/constants/index.js.map +2 -2
- package/dist/esm/parts/ClearButton/ClearButton.js +3 -1
- package/dist/esm/parts/ClearButton/ClearButton.js.map +2 -2
- package/dist/esm/parts/ClearButton/useClearButton.js +4 -2
- package/dist/esm/parts/ClearButton/useClearButton.js.map +2 -2
- package/dist/esm/parts/ControlledDateTimePickerContent.js +20 -6
- package/dist/esm/parts/ControlledDateTimePickerContent.js.map +2 -2
- package/dist/esm/parts/DateInputs/DDInput.js +4 -2
- package/dist/esm/parts/DateInputs/DDInput.js.map +2 -2
- package/dist/esm/parts/DateInputs/DateInputs.js +12 -8
- package/dist/esm/parts/DateInputs/DateInputs.js.map +2 -2
- package/dist/esm/parts/DateInputs/MMInput.js +4 -2
- package/dist/esm/parts/DateInputs/MMInput.js.map +2 -2
- package/dist/esm/parts/DateInputs/YYYYInput.js +4 -2
- package/dist/esm/parts/DateInputs/YYYYInput.js.map +2 -2
- package/dist/esm/parts/DateInputs/useDateInputs.js +2 -1
- package/dist/esm/parts/DateInputs/useDateInputs.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarBody.js +18 -14
- package/dist/esm/parts/Pickers/Calendar/CalendarBody.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/CalendarHead.js +1 -1
- package/dist/esm/parts/Pickers/Calendar/CalendarHead.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarIconTrigger.js +6 -1
- package/dist/esm/parts/Pickers/Calendar/CalendarIconTrigger.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarWeekDays.js +27 -22
- package/dist/esm/parts/Pickers/Calendar/CalendarWeekDays.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/Day.js +4 -3
- package/dist/esm/parts/Pickers/Calendar/Day.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/Styleds.js +24 -7
- package/dist/esm/parts/Pickers/Calendar/Styleds.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/usePopperTriggerLogic.js +12 -3
- package/dist/esm/parts/Pickers/Calendar/usePopperTriggerLogic.js.map +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +6 -1
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +2 -2
- package/dist/esm/parts/Pickers/PickersIcons.js +2 -1
- package/dist/esm/parts/Pickers/PickersIcons.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/HoursList.js +8 -7
- package/dist/esm/parts/Pickers/TimeWheel/HoursList.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js +11 -9
- package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js +8 -7
- package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/Styleds.js +24 -7
- package/dist/esm/parts/Pickers/TimeWheel/Styleds.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContent.js +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContent.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +6 -1
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +4 -3
- package/dist/esm/parts/Pickers/TimeWheel/usePopperTriggerLogic.js.map +2 -2
- package/dist/esm/parts/Styleds.js +25 -42
- package/dist/esm/parts/Styleds.js.map +2 -2
- package/dist/esm/parts/TimeInputs/HHInput.js +4 -2
- package/dist/esm/parts/TimeInputs/HHInput.js.map +2 -2
- package/dist/esm/parts/TimeInputs/MeridiemInput.js +4 -2
- package/dist/esm/parts/TimeInputs/MeridiemInput.js.map +2 -2
- package/dist/esm/parts/TimeInputs/MinutesInput.js +4 -2
- package/dist/esm/parts/TimeInputs/MinutesInput.js.map +2 -2
- package/dist/esm/parts/TimeInputs/TimeInputs.js +12 -11
- package/dist/esm/parts/TimeInputs/TimeInputs.js.map +2 -2
- package/dist/esm/parts/TimeInputs/useTimeInputs.js +2 -1
- package/dist/esm/parts/TimeInputs/useTimeInputs.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js +6 -2
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/typescript-testing/slot-props.js +73 -0
- package/dist/esm/typescript-testing/slot-props.js.map +2 -2
- package/dist/types/config/useControlledDateTimePicker.d.ts +2 -0
- package/dist/types/config/useGlobalKeyHandlers.d.ts +3 -1
- package/dist/types/constants/index.d.ts +48 -0
- package/dist/types/parts/DateInputs/DDInput.d.ts +2 -1
- package/dist/types/parts/DateInputs/MMInput.d.ts +2 -1
- package/dist/types/parts/DateInputs/YYYYInput.d.ts +2 -1
- package/dist/types/parts/Styleds.d.ts +8 -11
- package/dist/types/parts/TimeInputs/HHInput.d.ts +2 -1
- package/dist/types/parts/TimeInputs/MeridiemInput.d.ts +2 -1
- package/dist/types/parts/TimeInputs/MinutesInput.d.ts +2 -1
- package/dist/types/slot-arguments-polymorphic-typescript.d.ts +18 -2
- package/package.json +12 -12
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/DateInputs/DateInputs.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX.js';\nimport { MMInput } from './MMInput.js';\nimport { DDInput } from './DDInput.js';\nimport { YYYYInput } from './YYYYInput.js';\nimport { StyledFocusWithIn, StyledSeparator } from '../Styleds.js';\nimport { useDateInputs } from './useDateInputs.js';\nimport { fixedValues } from '../config.js';\n\nexport const DateInputs = (): JSX.Element => {\n const {\n month,\n day,\n year,\n autoFocusMonthInput,\n innerRefMonthInput,\n onMonthChange,\n onDayChange,\n onYearChange,\n onMonthBlur,\n onDayBlur,\n onYearBlur,\n onMonthFocus,\n onDayFocus,\n onYearFocus,\n onMonthKeyDown,\n onDayKeyDown,\n onYearKeyDown,\n disabled,\n applyAriaDisabled,\n } = useDateInputs();\n // we do this here so MMInput,DDInput,YYYYInput can be pure component memoized via React.memo\n const {\n monthInputRef,\n dayInputRef,\n yearInputRef,\n latestInteractionRegion,\n currFocusDescriber,\n getProps,\n props: { tabIndex, hasError, readOnly },\n } = useContext(ControlledDateTimePickerContext);\n\n return (\n <Grid\n cols={[\n fixedValues.smallInputWidth,\n fixedValues.separatorWidth,\n fixedValues.smallInputWidth,\n fixedValues.separatorWidth,\n fixedValues.largeInputWidth,\n ]}\n >\n <StyledFocusWithIn>\n <MMInput\n onChange={onMonthChange}\n onBlur={onMonthBlur}\n onFocus={onMonthFocus}\n onKeyDown={onMonthKeyDown}\n value={month}\n contextRef={monthInputRef}\n innerRef={innerRefMonthInput}\n tabIndex={tabIndex}\n autoFocusMonthInput={autoFocusMonthInput}\n placeholder=\"MM\"\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n hasError={hasError}\n isFocused={latestInteractionRegion === 'date-inputs' && currFocusDescriber === 'month-input'}\n getProps={getProps}\n readOnly={readOnly}\n />\n </StyledFocusWithIn>\n <StyledSeparator alignItems=\"center\"
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX.js';\nimport { MMInput } from './MMInput.js';\nimport { DDInput } from './DDInput.js';\nimport { YYYYInput } from './YYYYInput.js';\nimport { StyledFocusWithIn, StyledSeparator } from '../Styleds.js';\nimport { useDateInputs } from './useDateInputs.js';\nimport { fixedValues } from '../config.js';\n\nexport const DateInputs = (): JSX.Element => {\n const {\n month,\n day,\n year,\n autoFocusMonthInput,\n innerRefMonthInput,\n onMonthChange,\n onDayChange,\n onYearChange,\n onMonthBlur,\n onDayBlur,\n onYearBlur,\n onMonthFocus,\n onDayFocus,\n onYearFocus,\n onMonthKeyDown,\n onDayKeyDown,\n onYearKeyDown,\n disabled,\n applyAriaDisabled,\n } = useDateInputs();\n // we do this here so MMInput,DDInput,YYYYInput can be pure component memoized via React.memo\n const {\n monthInputRef,\n dayInputRef,\n yearInputRef,\n latestInteractionRegion,\n currFocusDescriber,\n getProps,\n readOnlyHelperMsgId,\n props: { tabIndex, hasError, readOnly },\n } = useContext(ControlledDateTimePickerContext);\n\n return (\n <Grid\n cols={[\n fixedValues.smallInputWidth,\n fixedValues.separatorWidth,\n fixedValues.smallInputWidth,\n fixedValues.separatorWidth,\n fixedValues.largeInputWidth,\n ]}\n >\n <StyledFocusWithIn getOwnerProps={getProps}>\n <MMInput\n onChange={onMonthChange}\n onBlur={onMonthBlur}\n onFocus={onMonthFocus}\n onKeyDown={onMonthKeyDown}\n value={month}\n contextRef={monthInputRef}\n innerRef={innerRefMonthInput}\n tabIndex={tabIndex}\n autoFocusMonthInput={autoFocusMonthInput}\n placeholder=\"MM\"\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n hasError={hasError}\n isFocused={latestInteractionRegion === 'date-inputs' && currFocusDescriber === 'month-input'}\n getProps={getProps}\n readOnly={readOnly}\n readOnlyHelperMsgId={readOnlyHelperMsgId}\n />\n </StyledFocusWithIn>\n <StyledSeparator alignItems=\"center\" getOwnerProps={getProps}>\n /\n </StyledSeparator>\n <StyledFocusWithIn getOwnerProps={getProps}>\n <DDInput\n onChange={onDayChange}\n onBlur={onDayBlur}\n onFocus={onDayFocus}\n onKeyDown={onDayKeyDown}\n value={day}\n contextRef={dayInputRef}\n tabIndex={tabIndex}\n placeholder=\"DD\"\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n hasError={hasError}\n isFocused={latestInteractionRegion === 'date-inputs' && currFocusDescriber === 'day-input'}\n getProps={getProps}\n readOnly={readOnly}\n readOnlyHelperMsgId={readOnlyHelperMsgId}\n />\n </StyledFocusWithIn>\n <StyledSeparator alignItems=\"center\" getOwnerProps={getProps}>\n /\n </StyledSeparator>\n <StyledFocusWithIn getOwnerProps={getProps}>\n <YYYYInput\n onChange={onYearChange}\n onBlur={onYearBlur}\n onFocus={onYearFocus}\n onKeyDown={onYearKeyDown}\n value={year}\n contextRef={yearInputRef}\n tabIndex={tabIndex}\n placeholder=\"YYYY\"\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n hasError={hasError}\n isFocused={latestInteractionRegion === 'date-inputs' && currFocusDescriber === 'year-input'}\n getProps={getProps}\n readOnly={readOnly}\n readOnlyHelperMsgId={readOnlyHelperMsgId}\n />\n </StyledFocusWithIn>\n </Grid>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD6CnB;AA7CJ,mBAAkC;AAClC,qBAAqB;AACrB,yCAAgD;AAChD,qBAAwB;AACxB,qBAAwB;AACxB,uBAA0B;AAC1B,qBAAmD;AACnD,2BAA8B;AAC9B,oBAA4B;AAErB,MAAM,aAAa,MAAmB;AAC3C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,oCAAc;AAElB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,EAAE,UAAU,UAAU,SAAS;AAAA,EACxC,QAAI,yBAAW,kEAA+B;AAE9C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,QACJ,0BAAY;AAAA,QACZ,0BAAY;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|
7
7
|
}
|
|
@@ -62,7 +62,8 @@ const MMInput = import_react.default.memo(
|
|
|
62
62
|
autoFocusMonthInput,
|
|
63
63
|
isFocused,
|
|
64
64
|
getProps,
|
|
65
|
-
readOnly
|
|
65
|
+
readOnly,
|
|
66
|
+
readOnlyHelperMsgId
|
|
66
67
|
}) => {
|
|
67
68
|
const validateOnChange = (0, import_react.useCallback)(
|
|
68
69
|
(e) => {
|
|
@@ -103,7 +104,8 @@ const MMInput = import_react.default.memo(
|
|
|
103
104
|
"aria-label": "month",
|
|
104
105
|
"data-testid": import_constants.ControlledDateTimePickerDatatestid.DATE_INPUTS.MONTH,
|
|
105
106
|
disabled,
|
|
106
|
-
"aria-disabled": applyAriaDisabled,
|
|
107
|
+
"aria-disabled": !disabled && (applyAriaDisabled || readOnly) ? true : void 0,
|
|
108
|
+
"aria-describedby": readOnly ? readOnlyHelperMsgId : void 0,
|
|
107
109
|
"aria-invalid": hasError,
|
|
108
110
|
getOwnerProps: getProps,
|
|
109
111
|
readOnly,
|
|
@@ -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';\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 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 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\"\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 // when empty, valuenow falls back to the min (not omitted) so VoiceOver honors\n // aria-valuetext=\"empty\" instead of announcing a computed position percentage\n aria-valuenow={monthNum === -1 ? 1 : 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;
|
|
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 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 readOnlyHelperMsgId: string;\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 isFocused,\n getProps,\n readOnly,\n readOnlyHelperMsgId,\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\"\n data-testid={ControlledDateTimePickerDatatestid.DATE_INPUTS.MONTH}\n disabled={disabled}\n aria-disabled={!disabled && (applyAriaDisabled || readOnly) ? true : undefined}\n aria-describedby={readOnly ? readOnlyHelperMsgId : undefined}\n aria-invalid={hasError}\n getOwnerProps={getProps}\n readOnly={readOnly}\n role=\"spinbutton\"\n aria-valuemin={1}\n aria-valuemax={12}\n // when empty, valuenow falls back to the min (not omitted) so VoiceOver honors\n // aria-valuetext=\"empty\" instead of announcing a computed position percentage\n aria-valuenow={monthNum === -1 ? 1 : 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;AAtFN,uBAAgC;AAEhC,mBAA4C;AAE5C,uBAAmD;AAEnD,qBAAiC;AACjC,2BAAkD;AAClD,IAAAA,oBAA2B;AAE3B,MAAM,gBAAgB;AACtB,MAAM,iBAAiB,CAAC,UAAkB;AACxC,MAAI,UAAU,GAAI,QAAO;AACzB,QAAM,aAAa,cAAc,KAAK,KAAK;AAC3C,SAAO,MAAM,SAAS,KAAK,UAAU,QAAQ,CAAC,cAAc,OAAO,SAAS,OAAO,EAAE,IAAI;AAC3F;AAsBO,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,IACA;AAAA,IACA;AAAA,EACF,MAAmC;AACjC,UAAM,uBAAmB;AAAA,MACvB,CAAC,MAA2C;AAC1C,YAAI,eAAe,GAAG,QAAQ,KAAK,GAAG;AACpC,YAAE,eAAe;AACjB;AAAA,QACF;AACA,iBAAS,CAAC;AAAA,MACZ;AAAA,MACA,CAAC,QAAQ;AAAA,IACX;AAEA,UAAM,gBAAY;AAAA,MAChB,CAAC,YAA8B;AAC7B,QAAC,WAAwD,UAAU;AACnE,YAAI,UAAW,UAAS,QAAQ;AAAA,MAClC;AAAA,MACA,CAAC,YAAY,SAAS;AAAA,IACxB;AAEA,UAAM,iBAAa,sBAAQ,MAAM;AAC/B,UAAI,UAAU;AACZ,mBAAO,kCAAgB,CAAC,WAAW,QAAQ,CAAC;AAAA,MAC9C;AACA,aAAO;AAAA,IACT,GAAG,CAAC,WAAW,QAAQ,CAAC;AAExB,UAAM,eAAW,wDAAkC,KAAK;AAExD,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,QACX,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA,cAAW;AAAA,QACX,eAAa,oDAAmC,YAAY;AAAA,QAC5D;AAAA,QACA,iBAAe,CAAC,aAAa,qBAAqB,YAAY,OAAO;AAAA,QACrE,oBAAkB,WAAW,sBAAsB;AAAA,QACnD,gBAAc;AAAA,QACd,eAAe;AAAA,QACf;AAAA,QACA,MAAK;AAAA,QACL,iBAAe;AAAA,QACf,iBAAe;AAAA,QAGf,iBAAe,aAAa,KAAK,IAAI;AAAA,QACrC,kBAAgB,aAAa,KAAK,UAAU,6BAAW,WAAW,CAAC;AAAA;AAAA,IACrE;AAAA,EAEJ;AACF;",
|
|
6
6
|
"names": ["import_constants", "React"]
|
|
7
7
|
}
|
|
@@ -59,7 +59,8 @@ const YYYYInput = import_react.default.memo(
|
|
|
59
59
|
tabIndex,
|
|
60
60
|
isFocused,
|
|
61
61
|
getProps,
|
|
62
|
-
readOnly
|
|
62
|
+
readOnly,
|
|
63
|
+
readOnlyHelperMsgId
|
|
63
64
|
}) => {
|
|
64
65
|
const validateOnChange = (0, import_react.useCallback)(
|
|
65
66
|
(e) => {
|
|
@@ -89,7 +90,8 @@ const YYYYInput = import_react.default.memo(
|
|
|
89
90
|
placeholder,
|
|
90
91
|
"aria-label": "year",
|
|
91
92
|
disabled,
|
|
92
|
-
"aria-disabled": applyAriaDisabled,
|
|
93
|
+
"aria-disabled": !disabled && (applyAriaDisabled || readOnly) ? true : void 0,
|
|
94
|
+
"aria-describedby": readOnly ? readOnlyHelperMsgId : void 0,
|
|
93
95
|
"aria-invalid": hasError,
|
|
94
96
|
getOwnerProps: getProps,
|
|
95
97
|
readOnly,
|
|
@@ -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';\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 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 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\"\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 // when empty, valuenow falls back to the min (not omitted) so VoiceOver honors\n // aria-valuetext=\"empty\" instead of announcing a computed position percentage\n aria-valuenow={yearNum === -1 ? 0 : 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;
|
|
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 isFocused: boolean;\n getProps: ControlledDateTimePickerContextT['getProps'];\n readOnly: boolean;\n readOnlyHelperMsgId: string;\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 isFocused,\n getProps,\n readOnly,\n readOnlyHelperMsgId,\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\"\n disabled={disabled}\n aria-disabled={!disabled && (applyAriaDisabled || readOnly) ? true : undefined}\n aria-describedby={readOnly ? readOnlyHelperMsgId : undefined}\n aria-invalid={hasError}\n getOwnerProps={getProps}\n readOnly={readOnly}\n role=\"spinbutton\"\n aria-valuemin={0}\n aria-valuemax={9999}\n // when empty, valuenow falls back to the min (not omitted) so VoiceOver honors\n // aria-valuetext=\"empty\" instead of announcing a computed position percentage\n aria-valuenow={yearNum === -1 ? 0 : 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,cAAW;AAAA,QACX;AAAA,QACA,iBAAe,CAAC,aAAa,qBAAqB,YAAY,OAAO;AAAA,QACrE,oBAAkB,WAAW,sBAAsB;AAAA,QACnD,gBAAc;AAAA,QACd,eAAe;AAAA,QACf;AAAA,QACA,MAAK;AAAA,QACL,iBAAe;AAAA,QACf,iBAAe;AAAA,QAGf,iBAAe,YAAY,KAAK,IAAI;AAAA,QACpC,kBAAgB,YAAY,KAAK,cAAU,iDAA2B,GAAG,OAAO,IAAI,GAAG,GAAG;AAAA;AAAA,IAC5F;AAAA,EAEJ;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -33,6 +33,7 @@ __export(useDateInputs_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(useDateInputs_exports);
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
35
|
var import_react = require("react");
|
|
36
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
36
37
|
var import_ControlledDateTimePickerCTX = require("../../ControlledDateTimePickerCTX.js");
|
|
37
38
|
var import_constants = require("../../utils/constants.js");
|
|
38
39
|
var import_dateHelpers = require("../../utils/dateHelpers.js");
|
|
@@ -65,7 +66,7 @@ const useDateInputs = () => {
|
|
|
65
66
|
trackFocusClearBtn,
|
|
66
67
|
trackFocusPicker
|
|
67
68
|
} = (0, import_react.useContext)(import_ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
68
|
-
const shouldPreventValueChanges = disabled
|
|
69
|
+
const shouldPreventValueChanges = (0, import_ds_props_helpers.isLocked)({ disabled, applyAriaDisabled, readOnly });
|
|
69
70
|
const onHomeKeyDown = (0, import_react.useCallback)(() => {
|
|
70
71
|
trackFocusFirstSegment();
|
|
71
72
|
}, [trackFocusFirstSegment]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/DateInputs/useDateInputs.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-statements */\n/* eslint-disable max-lines */\nimport { useCallback, useContext, useMemo } from 'react';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX.js';\nimport type { DSControlledDateTimePickerT } from '../../react-desc-prop-types.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\nimport { defaultMetaInfo } from '../../utils/constants.js';\nimport { getValidationDateStringMetaInfo } from '../../utils/dateHelpers.js';\nimport {\n fillStringWithPlaceHolders,\n getFormattedDateString,\n prependStringWithPlaceHolders,\n} from '../../utils/stringHelpers.js';\n\nexport const useDateInputs = (): DSControlledDateTimePickerInternalsT.UseDateInputsR => {\n const {\n props: { disabled, applyAriaDisabled, readOnly },\n appOnMonthChange,\n appOnDayChange,\n appOnYearChange,\n getIsDisabledDay,\n getIsOutOfRangeDay,\n month,\n day,\n year,\n hideTime,\n handleChangeComposedDateString,\n withClearBtn,\n withAnyPicker,\n withAnyRightController,\n autoFocusMonthInput,\n innerRefMonthInput,\n trackFocusResetter,\n trackFocusFirstSegment,\n trackFocusLastSegment,\n trackFocusDayInput,\n trackFocusMonthInput,\n trackFocusYearInput,\n trackFocusHourInput,\n trackFocusClearBtn,\n trackFocusPicker,\n } = useContext(ControlledDateTimePickerContext);\n\n const shouldPreventValueChanges = disabled || applyAriaDisabled || readOnly;\n\n const onHomeKeyDown = useCallback(() => {\n trackFocusFirstSegment();\n }, [trackFocusFirstSegment]);\n const onEndKeyDown = useCallback(() => {\n trackFocusLastSegment();\n }, [trackFocusLastSegment]);\n\n const handleChangeMonth = useCallback(\n (\n newMonth: string,\n e: DSControlledDateTimePickerT.OnInternalValuesChangeEvent,\n metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = defaultMetaInfo,\n ) => {\n if (shouldPreventValueChanges) return;\n const newDateString = getFormattedDateString({\n month: newMonth,\n day,\n year,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationDateStringMetaInfo(newDateString, getIsOutOfRangeDay, getIsDisabledDay),\n newDateString,\n };\n appOnMonthChange(newMonth, e, finalMetaInfo);\n handleChangeComposedDateString(newDateString, finalMetaInfo);\n },\n [\n shouldPreventValueChanges,\n day,\n year,\n getIsOutOfRangeDay,\n getIsDisabledDay,\n appOnMonthChange,\n handleChangeComposedDateString,\n ],\n );\n const onMonthFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc = useCallback(() => {\n trackFocusMonthInput();\n }, [trackFocusMonthInput]);\n const onMonthChange: DSControlledDateTimePickerInternalsT.OnChangeFunc = useCallback(\n (e) => {\n if (shouldPreventValueChanges) return;\n let newMonth = e?.target?.value;\n // converts months 2~9 to 02~09\n if (Number.parseInt(newMonth, 10) > 1) newMonth = prependStringWithPlaceHolders(newMonth, 2);\n handleChangeMonth(newMonth, e);\n // auto-advance functionality:\n if (newMonth.length === 2) trackFocusDayInput();\n },\n [handleChangeMonth, shouldPreventValueChanges, trackFocusDayInput],\n );\n const onMonthKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown = useCallback(\n (e) => {\n const { key, ctrlKey, metaKey } = e;\n const monthStringConvertedToInteger = Number.parseInt(month, 10);\n /* ***** CODE TO HANDLE FOCUS CHANGES ***** */\n if (['Home', 'End', 'ArrowUp', 'ArrowDown', '-', '/', '\\\\'].includes(key)) e.preventDefault();\n if (['Home', 'End', 'ArrowUp', 'ArrowDown', '-', '/', '\\\\'].includes(key)) e.stopPropagation();\n if (key === 'Home') onHomeKeyDown();\n if (key === 'End') onEndKeyDown();\n // focus last fragment on fill with now\n if ((ctrlKey || metaKey) && key === ';') trackFocusLastSegment();\n\n if (shouldPreventValueChanges) return;\n\n /* ***** CODE TO HANDLE VALUE CHANGES ***** */\n if (key === 'ArrowUp' || key === 'ArrowDown') {\n const monthInteger = Number.isNaN(monthStringConvertedToInteger) ? 0 : monthStringConvertedToInteger;\n let newMonth;\n if (key === 'ArrowUp') newMonth = monthInteger + 1 <= 12 ? monthInteger + 1 : monthInteger;\n else newMonth = monthInteger - 1 > 0 ? monthInteger - 1 : 1;\n newMonth = prependStringWithPlaceHolders(`${newMonth}`, 2);\n handleChangeMonth(newMonth, e);\n }\n if (!Number.isNaN(monthStringConvertedToInteger) && (key === '-' || key === '/' || key === '\\\\')) {\n let newMonth = prependStringWithPlaceHolders(`${monthStringConvertedToInteger}`, 2);\n // occam's razor: if month is 00, convert to 01 and move on\n if (newMonth === '00') newMonth = '01';\n handleChangeMonth(newMonth, e);\n // auto-advance functionality:\n trackFocusDayInput();\n }\n },\n [\n month,\n onHomeKeyDown,\n onEndKeyDown,\n trackFocusLastSegment,\n shouldPreventValueChanges,\n handleChangeMonth,\n trackFocusDayInput,\n ],\n );\n const onMonthBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc = useCallback(\n (e) => {\n const newMonth = e?.target?.value;\n if (newMonth === '0') handleChangeMonth('01', e, { isAutomaticFillTrigger: true });\n else if (newMonth.length > 0 && newMonth.length < 2)\n handleChangeMonth(prependStringWithPlaceHolders(newMonth, 2), e, {\n isAutomaticFillTrigger: true,\n });\n },\n [handleChangeMonth],\n );\n\n const handleChangeDay = useCallback(\n (\n newDay: string,\n e: DSControlledDateTimePickerT.OnInternalValuesChangeEvent,\n metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = defaultMetaInfo,\n ) => {\n if (shouldPreventValueChanges) return;\n const newDateString = getFormattedDateString({\n month,\n day: newDay,\n year,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationDateStringMetaInfo(newDateString, getIsOutOfRangeDay, getIsDisabledDay),\n newDateString,\n };\n appOnDayChange(newDay, e, finalMetaInfo);\n handleChangeComposedDateString(newDateString, finalMetaInfo);\n },\n [\n shouldPreventValueChanges,\n month,\n year,\n getIsOutOfRangeDay,\n getIsDisabledDay,\n appOnDayChange,\n handleChangeComposedDateString,\n ],\n );\n const onDayFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc = useCallback(() => {\n trackFocusDayInput();\n }, [trackFocusDayInput]);\n const onDayChange: DSControlledDateTimePickerInternalsT.OnChangeFunc = useCallback(\n (e) => {\n if (shouldPreventValueChanges) return;\n let newDay = e?.target?.value;\n // converts days 4~9 to 04~09\n if (Number.parseInt(newDay, 10) > 3) newDay = prependStringWithPlaceHolders(newDay, 2);\n handleChangeDay(newDay, e);\n // auto-advance functionality:\n if (newDay.length === 2) trackFocusYearInput();\n },\n [handleChangeDay, shouldPreventValueChanges, trackFocusYearInput],\n );\n const onDayKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown = useCallback(\n (e) => {\n const { key, ctrlKey, metaKey, target, currentTarget } = e;\n const dayStringConvertedToInteger = Number.parseInt(day, 10);\n if (['Home', 'End', 'ArrowUp', 'ArrowDown', '-', '/', '\\\\'].includes(key)) e.preventDefault();\n if (['Home', 'End', 'ArrowUp', 'ArrowDown', '-', '/', '\\\\'].includes(key)) e.stopPropagation();\n\n /* ***** CODE TO HANDLE FOCUS CHANGES ***** */\n if (key === 'Home') onHomeKeyDown();\n if (key === 'End') onEndKeyDown();\n // focus last fragment on fill with now\n if ((ctrlKey || metaKey) && key === ';') trackFocusLastSegment();\n\n if (shouldPreventValueChanges) return;\n\n /* ***** CODE TO HANDLE VALUE CHANGES ***** */\n if (key === 'ArrowUp' || key === 'ArrowDown') {\n const dayInteger = Number.isNaN(dayStringConvertedToInteger) ? 0 : dayStringConvertedToInteger;\n let newDay;\n if (key === 'ArrowUp') newDay = dayInteger + 1 <= 31 ? dayInteger + 1 : dayInteger;\n else newDay = dayInteger - 1 > 0 ? dayInteger - 1 : 1;\n newDay = prependStringWithPlaceHolders(`${newDay}`, 2);\n handleChangeDay(newDay, e);\n }\n if (!Number.isNaN(dayStringConvertedToInteger) && (key === '-' || key === '/' || key === '\\\\')) {\n let newDay = prependStringWithPlaceHolders(`${dayStringConvertedToInteger}`, 2);\n // occam's razor: if day is 00, convert to 01 and move on\n if (newDay === '00') newDay = '01';\n handleChangeDay(newDay, e);\n // auto-advance functionality:\n trackFocusYearInput();\n }\n // regressive backspace functionality\n if (\n key === 'Backspace' &&\n target === currentTarget &&\n (target as HTMLInputElement).selectionStart === 0 &&\n (target as HTMLInputElement).selectionEnd === 0\n ) {\n e.preventDefault();\n trackFocusMonthInput();\n }\n },\n [\n day,\n onHomeKeyDown,\n onEndKeyDown,\n trackFocusLastSegment,\n shouldPreventValueChanges,\n handleChangeDay,\n trackFocusYearInput,\n trackFocusMonthInput,\n ],\n );\n const onDayBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc = useCallback(\n (e) => {\n const newDay = e?.target?.value;\n if (newDay === '0') handleChangeDay('01', e, { isAutomaticFillTrigger: true });\n else if (newDay.length > 0 && newDay.length < 2)\n handleChangeDay(prependStringWithPlaceHolders(newDay, 2), e, {\n isAutomaticFillTrigger: true,\n });\n },\n [handleChangeDay],\n );\n\n const handleChangeYear = useCallback(\n (\n newYear: string,\n e: DSControlledDateTimePickerT.OnInternalValuesChangeEvent,\n metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = defaultMetaInfo,\n ) => {\n if (shouldPreventValueChanges) return;\n const newDateString = getFormattedDateString({\n month,\n day,\n year: newYear,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationDateStringMetaInfo(newDateString, getIsOutOfRangeDay, getIsDisabledDay),\n newDateString,\n };\n appOnYearChange(newYear, e, finalMetaInfo);\n handleChangeComposedDateString(newDateString, finalMetaInfo);\n },\n [\n shouldPreventValueChanges,\n month,\n day,\n getIsOutOfRangeDay,\n getIsDisabledDay,\n appOnYearChange,\n handleChangeComposedDateString,\n ],\n );\n const onYearFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc = useCallback(() => {\n trackFocusYearInput();\n }, [trackFocusYearInput]);\n const onYearChange: DSControlledDateTimePickerInternalsT.OnChangeFunc = useCallback(\n (e) => {\n if (shouldPreventValueChanges) return;\n const newYear = e?.target?.value;\n handleChangeYear(newYear, e);\n // auto-advance functionality:\n if (newYear.length === 4) {\n if (!hideTime) trackFocusHourInput();\n else if (withAnyRightController) {\n if (withClearBtn) trackFocusClearBtn();\n else if (withAnyPicker) trackFocusPicker();\n // pending approval from Seda, check which one should be focused first...\n }\n }\n },\n [\n shouldPreventValueChanges,\n handleChangeYear,\n hideTime,\n trackFocusHourInput,\n withAnyRightController,\n withClearBtn,\n trackFocusClearBtn,\n withAnyPicker,\n trackFocusPicker,\n ],\n );\n const onYearKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown = useCallback(\n (e) => {\n const { key, ctrlKey, metaKey, target, currentTarget } = e;\n\n /* ****** New year value calculator logic ********* */\n const yearStringConvertedToInteger = Number.parseInt(year, 10);\n const yearInteger = Number.isNaN(yearStringConvertedToInteger) ? 0 : yearStringConvertedToInteger;\n let newYear = yearInteger !== 0 ? fillStringWithPlaceHolders(`${yearInteger}`, 4, '0') : '';\n if (key === 'ArrowUp' || key === 'ArrowDown') {\n let newYearInteger;\n if (key === 'ArrowUp') newYearInteger = yearInteger + 1 <= 9999 ? yearInteger + 1 : yearInteger;\n else newYearInteger = yearInteger - 1 > 0 ? yearInteger - 1 : 1;\n newYear = prependStringWithPlaceHolders(`${newYearInteger}`, 4);\n }\n const isAutomaticFillTrigger = newYear !== year && ['Tab', ' '].includes(key);\n const metainfo = { isAutomaticFillTrigger };\n\n /* ***** CODE TO HANDLE FOCUS CHANGES ***** */\n /* ************* focus tracking logic ************* */\n let trackNextFocus = trackFocusResetter; // if nothing after, we reset internal focus tracker to avoid re-render unexpected focus shift\n if (!hideTime) trackNextFocus = trackFocusHourInput;\n else if (withClearBtn) trackNextFocus = trackFocusClearBtn;\n else if (withAnyPicker) trackNextFocus = trackFocusPicker;\n\n if (['Home', 'End', 'ArrowUp', 'ArrowDown', ' '].includes(key)) e.preventDefault();\n if (['Home', 'End', 'ArrowUp', 'ArrowDown', ' '].includes(key)) e.stopPropagation();\n if (key === 'Home') onHomeKeyDown();\n if (key === 'End') onEndKeyDown(); // focus last fragment on fill with now\n if ((ctrlKey || metaKey) && key === ';') trackFocusLastSegment();\n\n if (shouldPreventValueChanges) return;\n\n /* ***** CODE TO HANDLE VALUE CHANGES ***** */\n /* ************* new year apply logic ************* */\n // tab/spacebar applies auto-fill\n // arrows up/down applies increment/decrement\n if (key === 'ArrowUp' || key === 'ArrowDown' || isAutomaticFillTrigger) {\n handleChangeYear(newYear, e, metainfo);\n }\n\n /* ************** auto-advance logic ************** */\n if (['Tab', ' '].includes(key)) {\n // occam's razor: if user typed 0 and pressed space/tab, convert to 0000 and move on\n if (year !== '' && yearInteger === 0) handleChangeYear('0000', e);\n // auto-advance functionality:\n if (key === ' ') trackNextFocus(); // tab must be handled by the browser\n }\n /* ********** regressive backspace logic ********** */\n if (\n key === 'Backspace' &&\n target === currentTarget &&\n (target as HTMLInputElement).selectionStart === 0 &&\n (target as HTMLInputElement).selectionEnd === 0\n ) {\n e.preventDefault();\n trackFocusDayInput();\n }\n },\n [\n year,\n trackFocusResetter,\n hideTime,\n trackFocusHourInput,\n withClearBtn,\n trackFocusClearBtn,\n withAnyPicker,\n trackFocusPicker,\n onHomeKeyDown,\n onEndKeyDown,\n trackFocusLastSegment,\n shouldPreventValueChanges,\n handleChangeYear,\n trackFocusDayInput,\n ],\n );\n const onYearBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc = useCallback(\n (e) => {\n const newYear = e?.target?.value;\n if (newYear === '0') handleChangeYear('0000', e, { isAutomaticFillTrigger: true });\n else if (newYear.length > 0 && newYear.length < 4)\n handleChangeYear(fillStringWithPlaceHolders(newYear, 4, '0'), e, {\n isAutomaticFillTrigger: true,\n });\n },\n [handleChangeYear],\n );\n\n return useMemo(\n () => ({\n month,\n day,\n year,\n autoFocusMonthInput,\n innerRefMonthInput,\n disabled,\n applyAriaDisabled,\n onMonthFocus,\n onMonthChange,\n onDayFocus,\n onDayChange,\n onYearFocus,\n onYearChange,\n onMonthBlur,\n onDayBlur,\n onYearBlur,\n onMonthKeyDown,\n onDayKeyDown,\n onYearKeyDown,\n }),\n [\n month,\n day,\n year,\n autoFocusMonthInput,\n innerRefMonthInput,\n disabled,\n applyAriaDisabled,\n onMonthFocus,\n onMonthChange,\n onDayFocus,\n onDayChange,\n onYearFocus,\n onYearChange,\n onMonthBlur,\n onDayBlur,\n onYearBlur,\n onMonthKeyDown,\n onDayKeyDown,\n onYearKeyDown,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,mBAAiD;AACjD,yCAAgD;AAGhD,uBAAgC;AAChC,yBAAgD;AAChD,2BAIO;AAEA,MAAM,gBAAgB,MAA2D;AACtF,QAAM;AAAA,IACJ,OAAO,EAAE,UAAU,mBAAmB,SAAS;AAAA,IAC/C;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,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,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-statements */\n/* eslint-disable max-lines */\nimport { useCallback, useContext, useMemo } from 'react';\nimport { isLocked } from '@elliemae/ds-props-helpers';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX.js';\nimport type { DSControlledDateTimePickerT } from '../../react-desc-prop-types.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\nimport { defaultMetaInfo } from '../../utils/constants.js';\nimport { getValidationDateStringMetaInfo } from '../../utils/dateHelpers.js';\nimport {\n fillStringWithPlaceHolders,\n getFormattedDateString,\n prependStringWithPlaceHolders,\n} from '../../utils/stringHelpers.js';\n\nexport const useDateInputs = (): DSControlledDateTimePickerInternalsT.UseDateInputsR => {\n const {\n props: { disabled, applyAriaDisabled, readOnly },\n appOnMonthChange,\n appOnDayChange,\n appOnYearChange,\n getIsDisabledDay,\n getIsOutOfRangeDay,\n month,\n day,\n year,\n hideTime,\n handleChangeComposedDateString,\n withClearBtn,\n withAnyPicker,\n withAnyRightController,\n autoFocusMonthInput,\n innerRefMonthInput,\n trackFocusResetter,\n trackFocusFirstSegment,\n trackFocusLastSegment,\n trackFocusDayInput,\n trackFocusMonthInput,\n trackFocusYearInput,\n trackFocusHourInput,\n trackFocusClearBtn,\n trackFocusPicker,\n } = useContext(ControlledDateTimePickerContext);\n\n const shouldPreventValueChanges = isLocked({ disabled, applyAriaDisabled, readOnly });\n\n const onHomeKeyDown = useCallback(() => {\n trackFocusFirstSegment();\n }, [trackFocusFirstSegment]);\n const onEndKeyDown = useCallback(() => {\n trackFocusLastSegment();\n }, [trackFocusLastSegment]);\n\n const handleChangeMonth = useCallback(\n (\n newMonth: string,\n e: DSControlledDateTimePickerT.OnInternalValuesChangeEvent,\n metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = defaultMetaInfo,\n ) => {\n if (shouldPreventValueChanges) return;\n const newDateString = getFormattedDateString({\n month: newMonth,\n day,\n year,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationDateStringMetaInfo(newDateString, getIsOutOfRangeDay, getIsDisabledDay),\n newDateString,\n };\n appOnMonthChange(newMonth, e, finalMetaInfo);\n handleChangeComposedDateString(newDateString, finalMetaInfo);\n },\n [\n shouldPreventValueChanges,\n day,\n year,\n getIsOutOfRangeDay,\n getIsDisabledDay,\n appOnMonthChange,\n handleChangeComposedDateString,\n ],\n );\n const onMonthFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc = useCallback(() => {\n trackFocusMonthInput();\n }, [trackFocusMonthInput]);\n const onMonthChange: DSControlledDateTimePickerInternalsT.OnChangeFunc = useCallback(\n (e) => {\n if (shouldPreventValueChanges) return;\n let newMonth = e?.target?.value;\n // converts months 2~9 to 02~09\n if (Number.parseInt(newMonth, 10) > 1) newMonth = prependStringWithPlaceHolders(newMonth, 2);\n handleChangeMonth(newMonth, e);\n // auto-advance functionality:\n if (newMonth.length === 2) trackFocusDayInput();\n },\n [handleChangeMonth, shouldPreventValueChanges, trackFocusDayInput],\n );\n const onMonthKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown = useCallback(\n (e) => {\n const { key, ctrlKey, metaKey } = e;\n const monthStringConvertedToInteger = Number.parseInt(month, 10);\n /* ***** CODE TO HANDLE FOCUS CHANGES ***** */\n if (['Home', 'End', 'ArrowUp', 'ArrowDown', '-', '/', '\\\\'].includes(key)) e.preventDefault();\n if (['Home', 'End', 'ArrowUp', 'ArrowDown', '-', '/', '\\\\'].includes(key)) e.stopPropagation();\n if (key === 'Home') onHomeKeyDown();\n if (key === 'End') onEndKeyDown();\n // focus last fragment on fill with now\n if ((ctrlKey || metaKey) && key === ';') trackFocusLastSegment();\n\n if (shouldPreventValueChanges) return;\n\n /* ***** CODE TO HANDLE VALUE CHANGES ***** */\n if (key === 'ArrowUp' || key === 'ArrowDown') {\n const monthInteger = Number.isNaN(monthStringConvertedToInteger) ? 0 : monthStringConvertedToInteger;\n let newMonth;\n if (key === 'ArrowUp') newMonth = monthInteger + 1 <= 12 ? monthInteger + 1 : monthInteger;\n else newMonth = monthInteger - 1 > 0 ? monthInteger - 1 : 1;\n newMonth = prependStringWithPlaceHolders(`${newMonth}`, 2);\n handleChangeMonth(newMonth, e);\n }\n if (!Number.isNaN(monthStringConvertedToInteger) && (key === '-' || key === '/' || key === '\\\\')) {\n let newMonth = prependStringWithPlaceHolders(`${monthStringConvertedToInteger}`, 2);\n // occam's razor: if month is 00, convert to 01 and move on\n if (newMonth === '00') newMonth = '01';\n handleChangeMonth(newMonth, e);\n // auto-advance functionality:\n trackFocusDayInput();\n }\n },\n [\n month,\n onHomeKeyDown,\n onEndKeyDown,\n trackFocusLastSegment,\n shouldPreventValueChanges,\n handleChangeMonth,\n trackFocusDayInput,\n ],\n );\n const onMonthBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc = useCallback(\n (e) => {\n const newMonth = e?.target?.value;\n if (newMonth === '0') handleChangeMonth('01', e, { isAutomaticFillTrigger: true });\n else if (newMonth.length > 0 && newMonth.length < 2)\n handleChangeMonth(prependStringWithPlaceHolders(newMonth, 2), e, {\n isAutomaticFillTrigger: true,\n });\n },\n [handleChangeMonth],\n );\n\n const handleChangeDay = useCallback(\n (\n newDay: string,\n e: DSControlledDateTimePickerT.OnInternalValuesChangeEvent,\n metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = defaultMetaInfo,\n ) => {\n if (shouldPreventValueChanges) return;\n const newDateString = getFormattedDateString({\n month,\n day: newDay,\n year,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationDateStringMetaInfo(newDateString, getIsOutOfRangeDay, getIsDisabledDay),\n newDateString,\n };\n appOnDayChange(newDay, e, finalMetaInfo);\n handleChangeComposedDateString(newDateString, finalMetaInfo);\n },\n [\n shouldPreventValueChanges,\n month,\n year,\n getIsOutOfRangeDay,\n getIsDisabledDay,\n appOnDayChange,\n handleChangeComposedDateString,\n ],\n );\n const onDayFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc = useCallback(() => {\n trackFocusDayInput();\n }, [trackFocusDayInput]);\n const onDayChange: DSControlledDateTimePickerInternalsT.OnChangeFunc = useCallback(\n (e) => {\n if (shouldPreventValueChanges) return;\n let newDay = e?.target?.value;\n // converts days 4~9 to 04~09\n if (Number.parseInt(newDay, 10) > 3) newDay = prependStringWithPlaceHolders(newDay, 2);\n handleChangeDay(newDay, e);\n // auto-advance functionality:\n if (newDay.length === 2) trackFocusYearInput();\n },\n [handleChangeDay, shouldPreventValueChanges, trackFocusYearInput],\n );\n const onDayKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown = useCallback(\n (e) => {\n const { key, ctrlKey, metaKey, target, currentTarget } = e;\n const dayStringConvertedToInteger = Number.parseInt(day, 10);\n if (['Home', 'End', 'ArrowUp', 'ArrowDown', '-', '/', '\\\\'].includes(key)) e.preventDefault();\n if (['Home', 'End', 'ArrowUp', 'ArrowDown', '-', '/', '\\\\'].includes(key)) e.stopPropagation();\n\n /* ***** CODE TO HANDLE FOCUS CHANGES ***** */\n if (key === 'Home') onHomeKeyDown();\n if (key === 'End') onEndKeyDown();\n // focus last fragment on fill with now\n if ((ctrlKey || metaKey) && key === ';') trackFocusLastSegment();\n\n if (shouldPreventValueChanges) return;\n\n /* ***** CODE TO HANDLE VALUE CHANGES ***** */\n if (key === 'ArrowUp' || key === 'ArrowDown') {\n const dayInteger = Number.isNaN(dayStringConvertedToInteger) ? 0 : dayStringConvertedToInteger;\n let newDay;\n if (key === 'ArrowUp') newDay = dayInteger + 1 <= 31 ? dayInteger + 1 : dayInteger;\n else newDay = dayInteger - 1 > 0 ? dayInteger - 1 : 1;\n newDay = prependStringWithPlaceHolders(`${newDay}`, 2);\n handleChangeDay(newDay, e);\n }\n if (!Number.isNaN(dayStringConvertedToInteger) && (key === '-' || key === '/' || key === '\\\\')) {\n let newDay = prependStringWithPlaceHolders(`${dayStringConvertedToInteger}`, 2);\n // occam's razor: if day is 00, convert to 01 and move on\n if (newDay === '00') newDay = '01';\n handleChangeDay(newDay, e);\n // auto-advance functionality:\n trackFocusYearInput();\n }\n // regressive backspace functionality\n if (\n key === 'Backspace' &&\n target === currentTarget &&\n (target as HTMLInputElement).selectionStart === 0 &&\n (target as HTMLInputElement).selectionEnd === 0\n ) {\n e.preventDefault();\n trackFocusMonthInput();\n }\n },\n [\n day,\n onHomeKeyDown,\n onEndKeyDown,\n trackFocusLastSegment,\n shouldPreventValueChanges,\n handleChangeDay,\n trackFocusYearInput,\n trackFocusMonthInput,\n ],\n );\n const onDayBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc = useCallback(\n (e) => {\n const newDay = e?.target?.value;\n if (newDay === '0') handleChangeDay('01', e, { isAutomaticFillTrigger: true });\n else if (newDay.length > 0 && newDay.length < 2)\n handleChangeDay(prependStringWithPlaceHolders(newDay, 2), e, {\n isAutomaticFillTrigger: true,\n });\n },\n [handleChangeDay],\n );\n\n const handleChangeYear = useCallback(\n (\n newYear: string,\n e: DSControlledDateTimePickerT.OnInternalValuesChangeEvent,\n metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = defaultMetaInfo,\n ) => {\n if (shouldPreventValueChanges) return;\n const newDateString = getFormattedDateString({\n month,\n day,\n year: newYear,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationDateStringMetaInfo(newDateString, getIsOutOfRangeDay, getIsDisabledDay),\n newDateString,\n };\n appOnYearChange(newYear, e, finalMetaInfo);\n handleChangeComposedDateString(newDateString, finalMetaInfo);\n },\n [\n shouldPreventValueChanges,\n month,\n day,\n getIsOutOfRangeDay,\n getIsDisabledDay,\n appOnYearChange,\n handleChangeComposedDateString,\n ],\n );\n const onYearFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc = useCallback(() => {\n trackFocusYearInput();\n }, [trackFocusYearInput]);\n const onYearChange: DSControlledDateTimePickerInternalsT.OnChangeFunc = useCallback(\n (e) => {\n if (shouldPreventValueChanges) return;\n const newYear = e?.target?.value;\n handleChangeYear(newYear, e);\n // auto-advance functionality:\n if (newYear.length === 4) {\n if (!hideTime) trackFocusHourInput();\n else if (withAnyRightController) {\n if (withClearBtn) trackFocusClearBtn();\n else if (withAnyPicker) trackFocusPicker();\n // pending approval from Seda, check which one should be focused first...\n }\n }\n },\n [\n shouldPreventValueChanges,\n handleChangeYear,\n hideTime,\n trackFocusHourInput,\n withAnyRightController,\n withClearBtn,\n trackFocusClearBtn,\n withAnyPicker,\n trackFocusPicker,\n ],\n );\n const onYearKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown = useCallback(\n (e) => {\n const { key, ctrlKey, metaKey, target, currentTarget } = e;\n\n /* ****** New year value calculator logic ********* */\n const yearStringConvertedToInteger = Number.parseInt(year, 10);\n const yearInteger = Number.isNaN(yearStringConvertedToInteger) ? 0 : yearStringConvertedToInteger;\n let newYear = yearInteger !== 0 ? fillStringWithPlaceHolders(`${yearInteger}`, 4, '0') : '';\n if (key === 'ArrowUp' || key === 'ArrowDown') {\n let newYearInteger;\n if (key === 'ArrowUp') newYearInteger = yearInteger + 1 <= 9999 ? yearInteger + 1 : yearInteger;\n else newYearInteger = yearInteger - 1 > 0 ? yearInteger - 1 : 1;\n newYear = prependStringWithPlaceHolders(`${newYearInteger}`, 4);\n }\n const isAutomaticFillTrigger = newYear !== year && ['Tab', ' '].includes(key);\n const metainfo = { isAutomaticFillTrigger };\n\n /* ***** CODE TO HANDLE FOCUS CHANGES ***** */\n /* ************* focus tracking logic ************* */\n let trackNextFocus = trackFocusResetter; // if nothing after, we reset internal focus tracker to avoid re-render unexpected focus shift\n if (!hideTime) trackNextFocus = trackFocusHourInput;\n else if (withClearBtn) trackNextFocus = trackFocusClearBtn;\n else if (withAnyPicker) trackNextFocus = trackFocusPicker;\n\n if (['Home', 'End', 'ArrowUp', 'ArrowDown', ' '].includes(key)) e.preventDefault();\n if (['Home', 'End', 'ArrowUp', 'ArrowDown', ' '].includes(key)) e.stopPropagation();\n if (key === 'Home') onHomeKeyDown();\n if (key === 'End') onEndKeyDown(); // focus last fragment on fill with now\n if ((ctrlKey || metaKey) && key === ';') trackFocusLastSegment();\n\n if (shouldPreventValueChanges) return;\n\n /* ***** CODE TO HANDLE VALUE CHANGES ***** */\n /* ************* new year apply logic ************* */\n // tab/spacebar applies auto-fill\n // arrows up/down applies increment/decrement\n if (key === 'ArrowUp' || key === 'ArrowDown' || isAutomaticFillTrigger) {\n handleChangeYear(newYear, e, metainfo);\n }\n\n /* ************** auto-advance logic ************** */\n if (['Tab', ' '].includes(key)) {\n // occam's razor: if user typed 0 and pressed space/tab, convert to 0000 and move on\n if (year !== '' && yearInteger === 0) handleChangeYear('0000', e);\n // auto-advance functionality:\n if (key === ' ') trackNextFocus(); // tab must be handled by the browser\n }\n /* ********** regressive backspace logic ********** */\n if (\n key === 'Backspace' &&\n target === currentTarget &&\n (target as HTMLInputElement).selectionStart === 0 &&\n (target as HTMLInputElement).selectionEnd === 0\n ) {\n e.preventDefault();\n trackFocusDayInput();\n }\n },\n [\n year,\n trackFocusResetter,\n hideTime,\n trackFocusHourInput,\n withClearBtn,\n trackFocusClearBtn,\n withAnyPicker,\n trackFocusPicker,\n onHomeKeyDown,\n onEndKeyDown,\n trackFocusLastSegment,\n shouldPreventValueChanges,\n handleChangeYear,\n trackFocusDayInput,\n ],\n );\n const onYearBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc = useCallback(\n (e) => {\n const newYear = e?.target?.value;\n if (newYear === '0') handleChangeYear('0000', e, { isAutomaticFillTrigger: true });\n else if (newYear.length > 0 && newYear.length < 4)\n handleChangeYear(fillStringWithPlaceHolders(newYear, 4, '0'), e, {\n isAutomaticFillTrigger: true,\n });\n },\n [handleChangeYear],\n );\n\n return useMemo(\n () => ({\n month,\n day,\n year,\n autoFocusMonthInput,\n innerRefMonthInput,\n disabled,\n applyAriaDisabled,\n onMonthFocus,\n onMonthChange,\n onDayFocus,\n onDayChange,\n onYearFocus,\n onYearChange,\n onMonthBlur,\n onDayBlur,\n onYearBlur,\n onMonthKeyDown,\n onDayKeyDown,\n onYearKeyDown,\n }),\n [\n month,\n day,\n year,\n autoFocusMonthInput,\n innerRefMonthInput,\n disabled,\n applyAriaDisabled,\n onMonthFocus,\n onMonthChange,\n onDayFocus,\n onDayChange,\n onYearFocus,\n onYearChange,\n onMonthBlur,\n onDayBlur,\n onYearBlur,\n onMonthKeyDown,\n onDayKeyDown,\n onYearKeyDown,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,mBAAiD;AACjD,8BAAyB;AACzB,yCAAgD;AAGhD,uBAAgC;AAChC,yBAAgD;AAChD,2BAIO;AAEA,MAAM,gBAAgB,MAA2D;AACtF,QAAM;AAAA,IACJ,OAAO,EAAE,UAAU,mBAAmB,SAAS;AAAA,IAC/C;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,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,gCAA4B,kCAAS,EAAE,UAAU,mBAAmB,SAAS,CAAC;AAEpF,QAAM,oBAAgB,0BAAY,MAAM;AACtC,2BAAuB;AAAA,EACzB,GAAG,CAAC,sBAAsB,CAAC;AAC3B,QAAM,mBAAe,0BAAY,MAAM;AACrC,0BAAsB;AAAA,EACxB,GAAG,CAAC,qBAAqB,CAAC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AG,EAAE,wBAAwB,KAAK,CAAC;AAAA,eACxE,QAAQ,SAAS,KAAK,QAAQ,SAAS;AAC9C,6BAAiB,iDAA2B,SAAS,GAAG,GAAG,GAAG,GAAG;AAAA,UAC/D,wBAAwB;AAAA,QAC1B,CAAC;AAAA,IACL;AAAA,IACA,CAAC,gBAAgB;AAAA,EACnB;AAEA,aAAO;AAAA,IACL,OAAO;AAAA,MACL;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,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,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;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -35,21 +35,25 @@ var React = __toESM(require("react"));
|
|
|
35
35
|
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
|
+
var import_ControlledDateTimePickerCTX = require("../../../ControlledDateTimePickerCTX.js");
|
|
38
39
|
var import_CalendarMonthDays = require("./CalendarMonthDays.js");
|
|
39
40
|
var import_CalendarWeekDays = require("./CalendarWeekDays.js");
|
|
40
41
|
var import_Styleds = require("./Styleds.js");
|
|
41
|
-
const CalendarBody = import_react.default.memo(({ weekRowsNum }) =>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
42
|
+
const CalendarBody = import_react.default.memo(({ weekRowsNum }) => {
|
|
43
|
+
const { getProps } = import_react.default.useContext(import_ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
44
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
45
|
+
"span",
|
|
46
|
+
{
|
|
47
|
+
role: "grid",
|
|
48
|
+
"aria-label": "calendar",
|
|
49
|
+
"aria-colcount": 7,
|
|
50
|
+
"aria-rowcount": weekRowsNum,
|
|
51
|
+
"data-testid": import_constants.ControlledDateTimePickerDatatestid.CALENDAR.TABLE_WRAPPER,
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_CalendarWeekDays.CalendarWeekDays, {}),
|
|
54
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Styleds.StyledBody, { getOwnerProps: getProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_CalendarMonthDays.CalendarMonthDays, {}) })
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
});
|
|
55
59
|
//# sourceMappingURL=CalendarBody.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Pickers/Calendar/CalendarBody.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../constants/index.js';\nimport { CalendarMonthDays } from './CalendarMonthDays.js';\nimport { CalendarWeekDays } from './CalendarWeekDays.js';\nimport { StyledBody } from './Styleds.js';\n\ninterface CalendarBodyPropsT {\n weekRowsNum: number;\n}\nexport const CalendarBody = React.memo(({ weekRowsNum }: CalendarBodyPropsT) => (\n <span\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../constants/index.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { CalendarMonthDays } from './CalendarMonthDays.js';\nimport { CalendarWeekDays } from './CalendarWeekDays.js';\nimport { StyledBody } from './Styleds.js';\n\ninterface CalendarBodyPropsT {\n weekRowsNum: number;\n}\nexport const CalendarBody = React.memo(({ weekRowsNum }: CalendarBodyPropsT) => {\n const { getProps } = React.useContext(ControlledDateTimePickerContext);\n\n return (\n <span\n role=\"grid\"\n aria-label=\"calendar\"\n aria-colcount={7}\n aria-rowcount={weekRowsNum}\n data-testid={ControlledDateTimePickerDatatestid.CALENDAR.TABLE_WRAPPER}\n >\n <CalendarWeekDays />\n <StyledBody getOwnerProps={getProps}>\n <CalendarMonthDays />\n </StyledBody>\n </span>\n );\n});\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADcnB;AAdJ,mBAAkB;AAClB,uBAAmD;AACnD,yCAAgD;AAChD,+BAAkC;AAClC,8BAAiC;AACjC,qBAA2B;AAKpB,MAAM,eAAe,aAAAA,QAAM,KAAK,CAAC,EAAE,YAAY,MAA0B;AAC9E,QAAM,EAAE,SAAS,IAAI,aAAAA,QAAM,WAAW,kEAA+B;AAErE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,cAAW;AAAA,MACX,iBAAe;AAAA,MACf,iBAAe;AAAA,MACf,eAAa,oDAAmC,SAAS;AAAA,MAEzD;AAAA,oDAAC,4CAAiB;AAAA,QAClB,4CAAC,6BAAW,eAAe,UACzB,sDAAC,8CAAkB,GACrB;AAAA;AAAA;AAAA,EACF;AAEJ,CAAC;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -53,7 +53,7 @@ const CalendarContent = ({ className = "" }) => {
|
|
|
53
53
|
className,
|
|
54
54
|
"data-testid": import_constants.ControlledDateTimePickerDatatestid.CONTROLLER_COMPONENT.CALENDAR,
|
|
55
55
|
getOwnerProps: getProps,
|
|
56
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Styleds.StyledCalendarWrapper, { $readOnlyStyles: readOnly || applyAriaDisabled, children: [
|
|
56
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Styleds.StyledCalendarWrapper, { $readOnlyStyles: readOnly || applyAriaDisabled, getOwnerProps: getProps, children: [
|
|
57
57
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_CalendarHead.CalendarHead, {}),
|
|
58
58
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_CalendarBody.CalendarBody, { weekRowsNum: daysMatrixByWeekday.length }),
|
|
59
59
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_CalendarFooter.CalendarFooter, {})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Pickers/Calendar/CalendarContent.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-len */\nimport { useContext } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../constants/index.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { CalendarBody } from './CalendarBody.js';\nimport { CalendarContext } from './CalendarContext.js';\nimport { CalendarFooter } from './CalendarFooter.js';\nimport { CalendarHead } from './CalendarHead.js';\nimport { StyledCalendarWrapper, StyledShadowWrapper } from './Styleds.js';\n\n// ({ className = '' }: { className?: string })\n// <StyledShadowWrapper className={className}>\n// is required for styled-components, without this we can't styled(CalendarContent)...\n// https://stackoverflow.com/questions/52542817/styled-components-not-applying-style-to-custom-functional-react-component\nexport const CalendarContent = ({ className = '' }: { className?: string }): JSX.Element => {\n const {\n getProps,\n props: { readOnly, applyAriaDisabled },\n } = useContext(ControlledDateTimePickerContext);\n const { daysMatrixByWeekday } = useContext(CalendarContext);\n\n return (\n <StyledShadowWrapper\n className={className}\n data-testid={ControlledDateTimePickerDatatestid.CONTROLLER_COMPONENT.CALENDAR}\n getOwnerProps={getProps}\n >\n <StyledCalendarWrapper $readOnlyStyles={readOnly || applyAriaDisabled}>\n <CalendarHead />\n <CalendarBody weekRowsNum={daysMatrixByWeekday.length} />\n <CalendarFooter />\n </StyledCalendarWrapper>\n </StyledShadowWrapper>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2BjB;AA1BN,mBAA2B;AAC3B,uBAAmD;AACnD,yCAAgD;AAChD,0BAA6B;AAC7B,6BAAgC;AAChC,4BAA+B;AAC/B,0BAA6B;AAC7B,qBAA2D;AAMpD,MAAM,kBAAkB,CAAC,EAAE,YAAY,GAAG,MAA2C;AAC1F,QAAM;AAAA,IACJ;AAAA,IACA,OAAO,EAAE,UAAU,kBAAkB;AAAA,EACvC,QAAI,yBAAW,kEAA+B;AAC9C,QAAM,EAAE,oBAAoB,QAAI,yBAAW,sCAAe;AAE1D,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,eAAa,oDAAmC,qBAAqB;AAAA,MACrE,eAAe;AAAA,MAEf,uDAAC,wCAAsB,iBAAiB,YAAY,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-len */\nimport { useContext } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../constants/index.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { CalendarBody } from './CalendarBody.js';\nimport { CalendarContext } from './CalendarContext.js';\nimport { CalendarFooter } from './CalendarFooter.js';\nimport { CalendarHead } from './CalendarHead.js';\nimport { StyledCalendarWrapper, StyledShadowWrapper } from './Styleds.js';\n\n// ({ className = '' }: { className?: string })\n// <StyledShadowWrapper className={className}>\n// is required for styled-components, without this we can't styled(CalendarContent)...\n// https://stackoverflow.com/questions/52542817/styled-components-not-applying-style-to-custom-functional-react-component\nexport const CalendarContent = ({ className = '' }: { className?: string }): JSX.Element => {\n const {\n getProps,\n props: { readOnly, applyAriaDisabled },\n } = useContext(ControlledDateTimePickerContext);\n const { daysMatrixByWeekday } = useContext(CalendarContext);\n\n return (\n <StyledShadowWrapper\n className={className}\n data-testid={ControlledDateTimePickerDatatestid.CONTROLLER_COMPONENT.CALENDAR}\n getOwnerProps={getProps}\n >\n <StyledCalendarWrapper $readOnlyStyles={readOnly || applyAriaDisabled} getOwnerProps={getProps}>\n <CalendarHead />\n <CalendarBody weekRowsNum={daysMatrixByWeekday.length} />\n <CalendarFooter />\n </StyledCalendarWrapper>\n </StyledShadowWrapper>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2BjB;AA1BN,mBAA2B;AAC3B,uBAAmD;AACnD,yCAAgD;AAChD,0BAA6B;AAC7B,6BAAgC;AAChC,4BAA+B;AAC/B,0BAA6B;AAC7B,qBAA2D;AAMpD,MAAM,kBAAkB,CAAC,EAAE,YAAY,GAAG,MAA2C;AAC1F,QAAM;AAAA,IACJ;AAAA,IACA,OAAO,EAAE,UAAU,kBAAkB;AAAA,EACvC,QAAI,yBAAW,kEAA+B;AAC9C,QAAM,EAAE,oBAAoB,QAAI,yBAAW,sCAAe;AAE1D,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,eAAa,oDAAmC,qBAAqB;AAAA,MACrE,eAAe;AAAA,MAEf,uDAAC,wCAAsB,iBAAiB,YAAY,mBAAmB,eAAe,UACpF;AAAA,oDAAC,oCAAa;AAAA,QACd,4CAAC,oCAAa,aAAa,oBAAoB,QAAQ;AAAA,QACvD,4CAAC,wCAAe;AAAA,SAClB;AAAA;AAAA,EACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -105,7 +105,7 @@ const CalendarHead = () => {
|
|
|
105
105
|
},
|
|
106
106
|
[currFocusDescriber, latestInteractionRegion, nextYearBtnRef]
|
|
107
107
|
);
|
|
108
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Styleds.StyledHeader, { children: [
|
|
108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Styleds.StyledHeader, { getOwnerProps: getProps, children: [
|
|
109
109
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
110
110
|
import_Styleds.StyledHeaderButton,
|
|
111
111
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Pickers/Calendar/CalendarHead.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable complexity, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */\nimport { BUTTON_SIZES } from '@elliemae/ds-button-v2';\nimport { ChevronDoubleLeft, ChevronDoubleRight, ChevronLeft, ChevronRight } from '@elliemae/ds-icons';\nimport { useCallback, useContext, useMemo } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../constants/index.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { getMonthNameByMonthNumber } from '../../../utils/dateHelpers.js';\nimport { CalendarContext } from './CalendarContext.js';\nimport { StyledHeader, StyledHeaderButton, StyledHeaderLabel } from './Styleds.js';\n\nconst useGetFormattedCurrentDate = () => {\n const { currentMonth, currentYear } = useContext(CalendarContext);\n\n const monthString = currentMonth >= 0 && currentMonth <= 11 ? `${getMonthNameByMonthNumber(currentMonth)} ` : '';\n\n return useMemo(() => `${monthString}${currentYear}`, [monthString, currentYear]);\n};\nexport const CalendarHead = (): JSX.Element => {\n const currentFormatedDate = useGetFormattedCurrentDate();\n const {\n handlePrevYear,\n handlePrevMonth,\n handleNextMonth,\n handleNextYear,\n handlePrevYearKeyDown,\n handlePrevMonthKeyDown,\n handleNextMonthKeyDown,\n handleNextYearKeyDown,\n onPrevYearFocus,\n onPrevMonthFocus,\n onNextMonthFocus,\n onNextYearFocus,\n } = useContext(CalendarContext);\n\n const {\n isControllerOnly,\n autoFocusPrevMonthArrow,\n prevYearBtnRef,\n prevMonthBtnRef,\n nextMonthBtnRef,\n nextYearBtnRef,\n latestInteractionRegion,\n currFocusDescriber,\n getProps,\n } = useContext(ControlledDateTimePickerContext);\n\n const handlePrevYearRef = useCallback(\n (ButtonDomNode: HTMLButtonElement) => {\n prevYearBtnRef.current = ButtonDomNode;\n if (latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-prev-year')\n ButtonDomNode?.focus?.();\n },\n [currFocusDescriber, latestInteractionRegion, prevYearBtnRef],\n );\n const handlePrevMonthRef = useCallback(\n (ButtonDomNode: HTMLButtonElement) => {\n prevMonthBtnRef.current = ButtonDomNode;\n if (latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-prev-month')\n ButtonDomNode?.focus?.();\n },\n [currFocusDescriber, latestInteractionRegion, prevMonthBtnRef],\n );\n const handleNextMonthRef = useCallback(\n (ButtonDomNode: HTMLButtonElement) => {\n nextMonthBtnRef.current = ButtonDomNode;\n if (latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-next-month')\n ButtonDomNode?.focus?.();\n },\n [currFocusDescriber, latestInteractionRegion, nextMonthBtnRef],\n );\n const handleNextYearRef = useCallback(\n (ButtonDomNode: HTMLButtonElement) => {\n nextYearBtnRef.current = ButtonDomNode;\n if (latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-next-year')\n ButtonDomNode?.focus?.();\n },\n [currFocusDescriber, latestInteractionRegion, nextYearBtnRef],\n );\n\n return (\n <StyledHeader>\n <StyledHeaderButton\n aria-label=\"previous year\"\n buttonType=\"raw\"\n size={BUTTON_SIZES.M}\n onClick={handlePrevYear}\n innerRef={handlePrevYearRef}\n onKeyDown={handlePrevYearKeyDown}\n onFocus={onPrevYearFocus}\n tabIndex={isControllerOnly ? -1 : 0}\n data-testid={ControlledDateTimePickerDatatestid.CALENDAR.PREV_YEAR}\n type=\"button\"\n getOwnerProps={getProps}\n >\n <ChevronDoubleLeft height={14} width={14} fill=\"#25292f\" />\n </StyledHeaderButton>\n <StyledHeaderButton\n autoFocus={autoFocusPrevMonthArrow}\n aria-label=\"previous month\"\n buttonType=\"raw\"\n size={BUTTON_SIZES.M}\n onClick={handlePrevMonth}\n innerRef={handlePrevMonthRef}\n onKeyDown={handlePrevMonthKeyDown}\n onFocus={onPrevMonthFocus}\n data-testid={ControlledDateTimePickerDatatestid.CALENDAR.PREV_MONTH}\n type=\"button\"\n getOwnerProps={getProps}\n // this is a tabstop for when the calendar is open\n >\n <ChevronLeft height={14} width={14} fill=\"#25292f\" />\n </StyledHeaderButton>\n <StyledHeaderLabel\n aria-live=\"polite\"\n data-testid={ControlledDateTimePickerDatatestid.CALENDAR.HEADER_LABEL}\n getOwnerProps={getProps}\n >\n {currentFormatedDate}\n </StyledHeaderLabel>\n <StyledHeaderButton\n aria-label=\"next month\"\n buttonType=\"raw\"\n size={BUTTON_SIZES.M}\n onClick={handleNextMonth}\n innerRef={handleNextMonthRef}\n onKeyDown={handleNextMonthKeyDown}\n onFocus={onNextMonthFocus}\n data-testid={ControlledDateTimePickerDatatestid.CALENDAR.NEXT_MONTH}\n type=\"button\"\n getOwnerProps={getProps}\n >\n <ChevronRight height={14} width={14} fill=\"#25292f\" />\n </StyledHeaderButton>\n <StyledHeaderButton\n aria-label=\"next year\"\n buttonType=\"raw\"\n size={BUTTON_SIZES.M}\n onClick={handleNextYear}\n innerRef={handleNextYearRef}\n onKeyDown={handleNextYearKeyDown}\n onFocus={onNextYearFocus}\n data-testid={ControlledDateTimePickerDatatestid.CALENDAR.NEXT_YEAR}\n type=\"button\"\n getOwnerProps={getProps}\n >\n <ChevronDoubleRight height={14} width={14} fill=\"#25292f\" />\n </StyledHeaderButton>\n </StyledHeader>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADgFnB;AA/EJ,0BAA6B;AAC7B,sBAAiF;AACjF,mBAAiD;AACjD,uBAAmD;AACnD,yCAAgD;AAChD,yBAA0C;AAC1C,6BAAgC;AAChC,qBAAoE;AAEpE,MAAM,6BAA6B,MAAM;AACvC,QAAM,EAAE,cAAc,YAAY,QAAI,yBAAW,sCAAe;AAEhE,QAAM,cAAc,gBAAgB,KAAK,gBAAgB,KAAK,OAAG,8CAA0B,YAAY,CAAC,MAAM;AAE9G,aAAO,sBAAQ,MAAM,GAAG,WAAW,GAAG,WAAW,IAAI,CAAC,aAAa,WAAW,CAAC;AACjF;AACO,MAAM,eAAe,MAAmB;AAC7C,QAAM,sBAAsB,2BAA2B;AACvD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,sCAAe;AAE9B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,kEAA+B;AAE9C,QAAM,wBAAoB;AAAA,IACxB,CAAC,kBAAqC;AACpC,qBAAe,UAAU;AACzB,UAAI,4BAA4B,mBAAmB,uBAAuB;AACxE,uBAAe,QAAQ;AAAA,IAC3B;AAAA,IACA,CAAC,oBAAoB,yBAAyB,cAAc;AAAA,EAC9D;AACA,QAAM,yBAAqB;AAAA,IACzB,CAAC,kBAAqC;AACpC,sBAAgB,UAAU;AAC1B,UAAI,4BAA4B,mBAAmB,uBAAuB;AACxE,uBAAe,QAAQ;AAAA,IAC3B;AAAA,IACA,CAAC,oBAAoB,yBAAyB,eAAe;AAAA,EAC/D;AACA,QAAM,yBAAqB;AAAA,IACzB,CAAC,kBAAqC;AACpC,sBAAgB,UAAU;AAC1B,UAAI,4BAA4B,mBAAmB,uBAAuB;AACxE,uBAAe,QAAQ;AAAA,IAC3B;AAAA,IACA,CAAC,oBAAoB,yBAAyB,eAAe;AAAA,EAC/D;AACA,QAAM,wBAAoB;AAAA,IACxB,CAAC,kBAAqC;AACpC,qBAAe,UAAU;AACzB,UAAI,4BAA4B,mBAAmB,uBAAuB;AACxE,uBAAe,QAAQ;AAAA,IAC3B;AAAA,IACA,CAAC,oBAAoB,yBAAyB,cAAc;AAAA,EAC9D;AAEA,SACE,6CAAC,+
|
|
4
|
+
"sourcesContent": ["/* eslint-disable complexity, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */\nimport { BUTTON_SIZES } from '@elliemae/ds-button-v2';\nimport { ChevronDoubleLeft, ChevronDoubleRight, ChevronLeft, ChevronRight } from '@elliemae/ds-icons';\nimport { useCallback, useContext, useMemo } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../constants/index.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { getMonthNameByMonthNumber } from '../../../utils/dateHelpers.js';\nimport { CalendarContext } from './CalendarContext.js';\nimport { StyledHeader, StyledHeaderButton, StyledHeaderLabel } from './Styleds.js';\n\nconst useGetFormattedCurrentDate = () => {\n const { currentMonth, currentYear } = useContext(CalendarContext);\n\n const monthString = currentMonth >= 0 && currentMonth <= 11 ? `${getMonthNameByMonthNumber(currentMonth)} ` : '';\n\n return useMemo(() => `${monthString}${currentYear}`, [monthString, currentYear]);\n};\nexport const CalendarHead = (): JSX.Element => {\n const currentFormatedDate = useGetFormattedCurrentDate();\n const {\n handlePrevYear,\n handlePrevMonth,\n handleNextMonth,\n handleNextYear,\n handlePrevYearKeyDown,\n handlePrevMonthKeyDown,\n handleNextMonthKeyDown,\n handleNextYearKeyDown,\n onPrevYearFocus,\n onPrevMonthFocus,\n onNextMonthFocus,\n onNextYearFocus,\n } = useContext(CalendarContext);\n\n const {\n isControllerOnly,\n autoFocusPrevMonthArrow,\n prevYearBtnRef,\n prevMonthBtnRef,\n nextMonthBtnRef,\n nextYearBtnRef,\n latestInteractionRegion,\n currFocusDescriber,\n getProps,\n } = useContext(ControlledDateTimePickerContext);\n\n const handlePrevYearRef = useCallback(\n (ButtonDomNode: HTMLButtonElement) => {\n prevYearBtnRef.current = ButtonDomNode;\n if (latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-prev-year')\n ButtonDomNode?.focus?.();\n },\n [currFocusDescriber, latestInteractionRegion, prevYearBtnRef],\n );\n const handlePrevMonthRef = useCallback(\n (ButtonDomNode: HTMLButtonElement) => {\n prevMonthBtnRef.current = ButtonDomNode;\n if (latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-prev-month')\n ButtonDomNode?.focus?.();\n },\n [currFocusDescriber, latestInteractionRegion, prevMonthBtnRef],\n );\n const handleNextMonthRef = useCallback(\n (ButtonDomNode: HTMLButtonElement) => {\n nextMonthBtnRef.current = ButtonDomNode;\n if (latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-next-month')\n ButtonDomNode?.focus?.();\n },\n [currFocusDescriber, latestInteractionRegion, nextMonthBtnRef],\n );\n const handleNextYearRef = useCallback(\n (ButtonDomNode: HTMLButtonElement) => {\n nextYearBtnRef.current = ButtonDomNode;\n if (latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-next-year')\n ButtonDomNode?.focus?.();\n },\n [currFocusDescriber, latestInteractionRegion, nextYearBtnRef],\n );\n\n return (\n <StyledHeader getOwnerProps={getProps}>\n <StyledHeaderButton\n aria-label=\"previous year\"\n buttonType=\"raw\"\n size={BUTTON_SIZES.M}\n onClick={handlePrevYear}\n innerRef={handlePrevYearRef}\n onKeyDown={handlePrevYearKeyDown}\n onFocus={onPrevYearFocus}\n tabIndex={isControllerOnly ? -1 : 0}\n data-testid={ControlledDateTimePickerDatatestid.CALENDAR.PREV_YEAR}\n type=\"button\"\n getOwnerProps={getProps}\n >\n <ChevronDoubleLeft height={14} width={14} fill=\"#25292f\" />\n </StyledHeaderButton>\n <StyledHeaderButton\n autoFocus={autoFocusPrevMonthArrow}\n aria-label=\"previous month\"\n buttonType=\"raw\"\n size={BUTTON_SIZES.M}\n onClick={handlePrevMonth}\n innerRef={handlePrevMonthRef}\n onKeyDown={handlePrevMonthKeyDown}\n onFocus={onPrevMonthFocus}\n data-testid={ControlledDateTimePickerDatatestid.CALENDAR.PREV_MONTH}\n type=\"button\"\n getOwnerProps={getProps}\n // this is a tabstop for when the calendar is open\n >\n <ChevronLeft height={14} width={14} fill=\"#25292f\" />\n </StyledHeaderButton>\n <StyledHeaderLabel\n aria-live=\"polite\"\n data-testid={ControlledDateTimePickerDatatestid.CALENDAR.HEADER_LABEL}\n getOwnerProps={getProps}\n >\n {currentFormatedDate}\n </StyledHeaderLabel>\n <StyledHeaderButton\n aria-label=\"next month\"\n buttonType=\"raw\"\n size={BUTTON_SIZES.M}\n onClick={handleNextMonth}\n innerRef={handleNextMonthRef}\n onKeyDown={handleNextMonthKeyDown}\n onFocus={onNextMonthFocus}\n data-testid={ControlledDateTimePickerDatatestid.CALENDAR.NEXT_MONTH}\n type=\"button\"\n getOwnerProps={getProps}\n >\n <ChevronRight height={14} width={14} fill=\"#25292f\" />\n </StyledHeaderButton>\n <StyledHeaderButton\n aria-label=\"next year\"\n buttonType=\"raw\"\n size={BUTTON_SIZES.M}\n onClick={handleNextYear}\n innerRef={handleNextYearRef}\n onKeyDown={handleNextYearKeyDown}\n onFocus={onNextYearFocus}\n data-testid={ControlledDateTimePickerDatatestid.CALENDAR.NEXT_YEAR}\n type=\"button\"\n getOwnerProps={getProps}\n >\n <ChevronDoubleRight height={14} width={14} fill=\"#25292f\" />\n </StyledHeaderButton>\n </StyledHeader>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADgFnB;AA/EJ,0BAA6B;AAC7B,sBAAiF;AACjF,mBAAiD;AACjD,uBAAmD;AACnD,yCAAgD;AAChD,yBAA0C;AAC1C,6BAAgC;AAChC,qBAAoE;AAEpE,MAAM,6BAA6B,MAAM;AACvC,QAAM,EAAE,cAAc,YAAY,QAAI,yBAAW,sCAAe;AAEhE,QAAM,cAAc,gBAAgB,KAAK,gBAAgB,KAAK,OAAG,8CAA0B,YAAY,CAAC,MAAM;AAE9G,aAAO,sBAAQ,MAAM,GAAG,WAAW,GAAG,WAAW,IAAI,CAAC,aAAa,WAAW,CAAC;AACjF;AACO,MAAM,eAAe,MAAmB;AAC7C,QAAM,sBAAsB,2BAA2B;AACvD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,sCAAe;AAE9B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,kEAA+B;AAE9C,QAAM,wBAAoB;AAAA,IACxB,CAAC,kBAAqC;AACpC,qBAAe,UAAU;AACzB,UAAI,4BAA4B,mBAAmB,uBAAuB;AACxE,uBAAe,QAAQ;AAAA,IAC3B;AAAA,IACA,CAAC,oBAAoB,yBAAyB,cAAc;AAAA,EAC9D;A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MAAK,WAAU;AAAA;AAAA,IACrD;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,aAAU;AAAA,QACV,eAAa,oDAAmC,SAAS;AAAA,QACzD,eAAe;AAAA,QAEd;AAAA;AAAA,IACH;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,cAAW;AAAA,QACX,YAAW;AAAA,QACX,MAAM,iCAAa;AAAA,QACnB,SAAS;AAAA,QACT,UAAU;AAAA,QACV,WAAW;AAAA,QACX,SAAS;AAAA,QACT,eAAa,oDAAmC,SAAS;AAAA,QACzD,MAAK;AAAA,QACL,eAAe;AAAA,QAEf,sDAAC,gCAAa,QAAQ,IAAI,OAAO,IAAI,MAAK,WAAU;AAAA;AAAA,IACtD;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,cAAW;AAAA,QACX,YAAW;AAAA,QACX,MAAM,iCAAa;AAAA,QACnB,SAAS;AAAA,QACT,UAAU;AAAA,QACV,WAAW;AAAA,QACX,SAAS;AAAA,QACT,eAAa,oDAAmC,SAAS;AAAA,QACzD,MAAK;AAAA,QACL,eAAe;AAAA,QAEf,sDAAC,sCAAmB,QAAQ,IAAI,OAAO,IAAI,MAAK,WAAU;AAAA;AAAA,IAC5D;AAAA,KACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -43,7 +43,7 @@ var import_Styleds = require("./Styleds.js");
|
|
|
43
43
|
const CalendarIconTrigger = () => {
|
|
44
44
|
const { handleToggleCalendar, handleSetTriggerRef, handlePickerIconKeyDown } = (0, import_react.useContext)(import_CalendarContext.CalendarContext);
|
|
45
45
|
const {
|
|
46
|
-
props: { disabled, tabIndex },
|
|
46
|
+
props: { disabled, tabIndex, applyAriaDisabled, readOnly },
|
|
47
47
|
getProps,
|
|
48
48
|
ariaCurrentValueForInputs
|
|
49
49
|
} = (0, import_react.useContext)(import_ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
@@ -52,6 +52,9 @@ const CalendarIconTrigger = () => {
|
|
|
52
52
|
import_Styleds.StyledIconTriggerButton,
|
|
53
53
|
{
|
|
54
54
|
"aria-label": `date picker context menu trigger, ${ariaCurrentValueForInputs}`,
|
|
55
|
+
applyAriaDisabled,
|
|
56
|
+
readOnly,
|
|
57
|
+
onDeliberateActivationWhileSoftLocked: handleToggleCalendar,
|
|
55
58
|
buttonType: "icon",
|
|
56
59
|
size: import_ds_button_v2.BUTTON_SIZES.M,
|
|
57
60
|
innerRef: handleSetTriggerRef,
|
|
@@ -72,6 +75,8 @@ const CalendarIconTrigger = () => {
|
|
|
72
75
|
handleToggleCalendar,
|
|
73
76
|
handlePickerIconKeyDown,
|
|
74
77
|
disabled,
|
|
78
|
+
applyAriaDisabled,
|
|
79
|
+
readOnly,
|
|
75
80
|
getProps
|
|
76
81
|
]
|
|
77
82
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Pickers/Calendar/CalendarIconTrigger.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { BUTTON_SIZES } from '@elliemae/ds-button-v2';\nimport { DatePicker } from '@elliemae/ds-icons';\nimport { useContext, useMemo } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../constants/index.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { CalendarContext } from './CalendarContext.js';\nimport { StyledIconTriggerButton } from './Styleds.js';\n// we memoize the Icon for maximum optimization\n// this is particularly usefull due to how usePopper needs to check the references\n// since references are saved in a immutable way, we make sure to shortcircuit useless-re-renders\nexport const CalendarIconTrigger = (): JSX.Element => {\n const { handleToggleCalendar, handleSetTriggerRef, handlePickerIconKeyDown } = useContext(CalendarContext);\n const {\n props: { disabled, tabIndex },\n getProps,\n ariaCurrentValueForInputs,\n } = useContext(ControlledDateTimePickerContext);\n return useMemo(\n () => (\n <StyledIconTriggerButton\n aria-label={`date picker context menu trigger, ${ariaCurrentValueForInputs}`}\n buttonType=\"icon\"\n size={BUTTON_SIZES.M}\n innerRef={handleSetTriggerRef}\n tabIndex={tabIndex}\n onClick={handleToggleCalendar}\n onKeyDown={handlePickerIconKeyDown}\n data-testid={ControlledDateTimePickerDatatestid.PICKER_ICONS.CALENDAR}\n disabled={disabled}\n type=\"button\"\n getOwnerProps={getProps}\n >\n <DatePicker color={disabled ? ['neutral', '500'] : ['brand-primary', '800']} />\n </StyledIconTriggerButton>\n ),\n [\n ariaCurrentValueForInputs,\n handleSetTriggerRef,\n tabIndex,\n handleToggleCalendar,\n handlePickerIconKeyDown,\n disabled,\n getProps,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import { BUTTON_SIZES } from '@elliemae/ds-button-v2';\nimport { DatePicker } from '@elliemae/ds-icons';\nimport { useContext, useMemo } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../constants/index.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { CalendarContext } from './CalendarContext.js';\nimport { StyledIconTriggerButton } from './Styleds.js';\n// we memoize the Icon for maximum optimization\n// this is particularly usefull due to how usePopper needs to check the references\n// since references are saved in a immutable way, we make sure to shortcircuit useless-re-renders\nexport const CalendarIconTrigger = (): JSX.Element => {\n const { handleToggleCalendar, handleSetTriggerRef, handlePickerIconKeyDown } = useContext(CalendarContext);\n const {\n props: { disabled, tabIndex, applyAriaDisabled, readOnly },\n getProps,\n ariaCurrentValueForInputs,\n } = useContext(ControlledDateTimePickerContext);\n return useMemo(\n () => (\n <StyledIconTriggerButton\n aria-label={`date picker context menu trigger, ${ariaCurrentValueForInputs}`}\n // opening a view-only popup is not an action of the soft lock (PUI-16695): the lock stays announced by DSButton\n // and the consumer's onClick stays withheld, only the toggle runs, deliberately\n applyAriaDisabled={applyAriaDisabled}\n readOnly={readOnly}\n onDeliberateActivationWhileSoftLocked={handleToggleCalendar}\n buttonType=\"icon\"\n size={BUTTON_SIZES.M}\n innerRef={handleSetTriggerRef}\n tabIndex={tabIndex}\n onClick={handleToggleCalendar}\n onKeyDown={handlePickerIconKeyDown}\n data-testid={ControlledDateTimePickerDatatestid.PICKER_ICONS.CALENDAR}\n disabled={disabled}\n type=\"button\"\n getOwnerProps={getProps}\n >\n <DatePicker color={disabled ? ['neutral', '500'] : ['brand-primary', '800']} />\n </StyledIconTriggerButton>\n ),\n [\n ariaCurrentValueForInputs,\n handleSetTriggerRef,\n tabIndex,\n handleToggleCalendar,\n handlePickerIconKeyDown,\n disabled,\n applyAriaDisabled,\n readOnly,\n getProps,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqCf;AArCR,0BAA6B;AAC7B,sBAA2B;AAC3B,mBAAoC;AACpC,uBAAmD;AACnD,yCAAgD;AAChD,6BAAgC;AAChC,qBAAwC;AAIjC,MAAM,sBAAsB,MAAmB;AACpD,QAAM,EAAE,sBAAsB,qBAAqB,wBAAwB,QAAI,yBAAW,sCAAe;AACzG,QAAM;AAAA,IACJ,OAAO,EAAE,UAAU,UAAU,mBAAmB,SAAS;AAAA,IACzD;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,kEAA+B;AAC9C,aAAO;AAAA,IACL,MACE;AAAA,MAAC;AAAA;AAAA,QACC,cAAY,qCAAqC,yBAAyB;AAAA,QAG1E;AAAA,QACA;AAAA,QACA,uCAAuC;AAAA,QACvC,YAAW;AAAA,QACX,MAAM,iCAAa;AAAA,QACnB,UAAU;AAAA,QACV;AAAA,QACA,SAAS;AAAA,QACT,WAAW;AAAA,QACX,eAAa,oDAAmC,aAAa;AAAA,QAC7D;AAAA,QACA,MAAK;AAAA,QACL,eAAe;AAAA,QAEf,sDAAC,8BAAW,OAAO,WAAW,CAAC,WAAW,KAAK,IAAI,CAAC,iBAAiB,KAAK,GAAG;AAAA;AAAA,IAC/E;AAAA,IAEF;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -34,27 +34,32 @@ module.exports = __toCommonJS(CalendarWeekDays_exports);
|
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_ControlledDateTimePickerCTX = require("../../../ControlledDateTimePickerCTX.js");
|
|
37
38
|
var import_Styleds = require("./Styleds.js");
|
|
38
|
-
const CalendarWeekDays = import_react.default.memo(() =>
|
|
39
|
-
|
|
40
|
-
{
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
) })
|
|
39
|
+
const CalendarWeekDays = import_react.default.memo(() => {
|
|
40
|
+
const { getProps } = import_react.default.useContext(import_ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
41
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { role: "rowgroup", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
42
|
+
import_Styleds.StyledWeekDaysListWrapper,
|
|
43
|
+
{
|
|
44
|
+
role: "row",
|
|
45
|
+
cols: ["2.4615rem", "2.4615rem", "2.4615rem", "2.4615rem", "2.4615rem", "2.4615rem", "2.4615rem"],
|
|
46
|
+
rows: ["1.6923rem"],
|
|
47
|
+
py: "xxxs",
|
|
48
|
+
px: "6px",
|
|
49
|
+
justifyContent: "space-between",
|
|
50
|
+
alignItems: "center",
|
|
51
|
+
isHeader: true,
|
|
52
|
+
getOwnerProps: getProps,
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Styleds.StyledWeekDaysHeaderItem, { role: "columnheader", "aria-colindex": 1, getOwnerProps: getProps, children: "sun" }),
|
|
55
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Styleds.StyledWeekDaysHeaderItem, { role: "columnheader", "aria-colindex": 2, getOwnerProps: getProps, children: "mon" }),
|
|
56
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Styleds.StyledWeekDaysHeaderItem, { role: "columnheader", "aria-colindex": 3, getOwnerProps: getProps, children: "tue" }),
|
|
57
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Styleds.StyledWeekDaysHeaderItem, { role: "columnheader", "aria-colindex": 4, getOwnerProps: getProps, children: "wed" }),
|
|
58
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Styleds.StyledWeekDaysHeaderItem, { role: "columnheader", "aria-colindex": 5, getOwnerProps: getProps, children: "thu" }),
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Styleds.StyledWeekDaysHeaderItem, { role: "columnheader", "aria-colindex": 6, getOwnerProps: getProps, children: "fri" }),
|
|
60
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Styleds.StyledWeekDaysHeaderItem, { role: "columnheader", "aria-colindex": 7, getOwnerProps: getProps, children: "sat" })
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
) });
|
|
64
|
+
});
|
|
60
65
|
//# sourceMappingURL=CalendarWeekDays.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Pickers/Calendar/CalendarWeekDays.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { StyledWeekDaysListWrapper, StyledWeekDaysHeaderItem } from './Styleds.js';\n\nexport const CalendarWeekDays = React.memo(() => (\n <span role=\"rowgroup\">\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { StyledWeekDaysListWrapper, StyledWeekDaysHeaderItem } from './Styleds.js';\n\nexport const CalendarWeekDays = React.memo(() => {\n const { getProps } = React.useContext(ControlledDateTimePickerContext);\n\n return (\n <span role=\"rowgroup\">\n <StyledWeekDaysListWrapper\n role=\"row\"\n cols={['2.4615rem', '2.4615rem', '2.4615rem', '2.4615rem', '2.4615rem', '2.4615rem', '2.4615rem']}\n rows={['1.6923rem']}\n py=\"xxxs\"\n px=\"6px\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n isHeader\n getOwnerProps={getProps}\n >\n <StyledWeekDaysHeaderItem role=\"columnheader\" aria-colindex={1} getOwnerProps={getProps}>\n sun\n </StyledWeekDaysHeaderItem>\n <StyledWeekDaysHeaderItem role=\"columnheader\" aria-colindex={2} getOwnerProps={getProps}>\n mon\n </StyledWeekDaysHeaderItem>\n <StyledWeekDaysHeaderItem role=\"columnheader\" aria-colindex={3} getOwnerProps={getProps}>\n tue\n </StyledWeekDaysHeaderItem>\n <StyledWeekDaysHeaderItem role=\"columnheader\" aria-colindex={4} getOwnerProps={getProps}>\n wed\n </StyledWeekDaysHeaderItem>\n <StyledWeekDaysHeaderItem role=\"columnheader\" aria-colindex={5} getOwnerProps={getProps}>\n thu\n </StyledWeekDaysHeaderItem>\n <StyledWeekDaysHeaderItem role=\"columnheader\" aria-colindex={6} getOwnerProps={getProps}>\n fri\n </StyledWeekDaysHeaderItem>\n <StyledWeekDaysHeaderItem role=\"columnheader\" aria-colindex={7} getOwnerProps={getProps}>\n sat\n </StyledWeekDaysHeaderItem>\n </StyledWeekDaysListWrapper>\n </span>\n );\n});\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADSjB;AATN,mBAAkB;AAClB,yCAAgD;AAChD,qBAAoE;AAE7D,MAAM,mBAAmB,aAAAA,QAAM,KAAK,MAAM;AAC/C,QAAM,EAAE,SAAS,IAAI,aAAAA,QAAM,WAAW,kEAA+B;AAErE,SACE,4CAAC,UAAK,MAAK,YACT;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,MAAM,CAAC,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,WAAW;AAAA,MAChG,MAAM,CAAC,WAAW;AAAA,MAClB,IAAG;AAAA,MACH,IAAG;AAAA,MACH,gBAAe;AAAA,MACf,YAAW;AAAA,MACX,UAAQ;AAAA,MACR,eAAe;AAAA,MAEf;AAAA,oDAAC,2CAAyB,MAAK,gBAAe,iBAAe,GAAG,eAAe,UAAU,iBAEzF;AAAA,QACA,4CAAC,2CAAyB,MAAK,gBAAe,iBAAe,GAAG,eAAe,UAAU,iBAEzF;AAAA,QACA,4CAAC,2CAAyB,MAAK,gBAAe,iBAAe,GAAG,eAAe,UAAU,iBAEzF;AAAA,QACA,4CAAC,2CAAyB,MAAK,gBAAe,iBAAe,GAAG,eAAe,UAAU,iBAEzF;AAAA,QACA,4CAAC,2CAAyB,MAAK,gBAAe,iBAAe,GAAG,eAAe,UAAU,iBAEzF;AAAA,QACA,4CAAC,2CAAyB,MAAK,gBAAe,iBAAe,GAAG,eAAe,UAAU,iBAEzF;AAAA,QACA,4CAAC,2CAAyB,MAAK,gBAAe,iBAAe,GAAG,eAAe,UAAU,iBAEzF;AAAA;AAAA;AAAA,EACF,GACF;AAEJ,CAAC;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|