@elliemae/ds-form-date-time-picker 3.26.0 → 3.26.1-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/parts/ClearButton/ClearButton.js +7 -1
- package/dist/cjs/parts/ClearButton/ClearButton.js.map +2 -2
- package/dist/cjs/parts/ControlledDateTimePickerContent.js +2 -1
- package/dist/cjs/parts/ControlledDateTimePickerContent.js.map +2 -2
- package/dist/cjs/parts/DateInputs/DDInput.js +2 -0
- package/dist/cjs/parts/DateInputs/DDInput.js.map +2 -2
- package/dist/cjs/parts/DateInputs/DateInputs.js +5 -1
- package/dist/cjs/parts/DateInputs/DateInputs.js.map +2 -2
- package/dist/cjs/parts/DateInputs/MMInput.js +2 -0
- package/dist/cjs/parts/DateInputs/MMInput.js.map +2 -2
- package/dist/cjs/parts/DateInputs/YYYYInput.js +2 -0
- package/dist/cjs/parts/DateInputs/YYYYInput.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarIconTrigger.js +11 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarIconTrigger.js.map +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +7 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +4 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/HHInput.js +3 -1
- package/dist/cjs/parts/TimeInputs/HHInput.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/MeridiemInput.js +3 -1
- package/dist/cjs/parts/TimeInputs/MeridiemInput.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/MinutesInput.js +3 -1
- package/dist/cjs/parts/TimeInputs/MinutesInput.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/TimeInputs.js +5 -1
- package/dist/cjs/parts/TimeInputs/TimeInputs.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +2 -1
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/esm/parts/ClearButton/ClearButton.js +7 -1
- package/dist/esm/parts/ClearButton/ClearButton.js.map +2 -2
- package/dist/esm/parts/ControlledDateTimePickerContent.js +2 -1
- package/dist/esm/parts/ControlledDateTimePickerContent.js.map +2 -2
- package/dist/esm/parts/DateInputs/DDInput.js +2 -0
- package/dist/esm/parts/DateInputs/DDInput.js.map +2 -2
- package/dist/esm/parts/DateInputs/DateInputs.js +5 -1
- package/dist/esm/parts/DateInputs/DateInputs.js.map +2 -2
- package/dist/esm/parts/DateInputs/MMInput.js +2 -0
- package/dist/esm/parts/DateInputs/MMInput.js.map +2 -2
- package/dist/esm/parts/DateInputs/YYYYInput.js +2 -0
- package/dist/esm/parts/DateInputs/YYYYInput.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarIconTrigger.js +11 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarIconTrigger.js.map +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +7 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +4 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +2 -2
- package/dist/esm/parts/TimeInputs/HHInput.js +3 -1
- package/dist/esm/parts/TimeInputs/HHInput.js.map +2 -2
- package/dist/esm/parts/TimeInputs/MeridiemInput.js +3 -1
- package/dist/esm/parts/TimeInputs/MeridiemInput.js.map +2 -2
- package/dist/esm/parts/TimeInputs/MinutesInput.js +3 -1
- package/dist/esm/parts/TimeInputs/MinutesInput.js.map +2 -2
- package/dist/esm/parts/TimeInputs/TimeInputs.js +5 -1
- package/dist/esm/parts/TimeInputs/TimeInputs.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js +2 -1
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- 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/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/react-desc-prop-types.d.ts +2 -0
- package/package.json +9 -9
|
@@ -69,7 +69,8 @@ const TimeInputs = () => {
|
|
|
69
69
|
ariaCurrentValueForInputs,
|
|
70
70
|
latestInteractionRegion,
|
|
71
71
|
currFocusDescriber,
|
|
72
|
-
getProps
|
|
72
|
+
getProps,
|
|
73
|
+
props: { tabIndex }
|
|
73
74
|
} = (0, import_react.useContext)(import_ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
74
75
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
75
76
|
import_ds_grid.Grid,
|
|
@@ -91,6 +92,7 @@ const TimeInputs = () => {
|
|
|
91
92
|
onFocus: onHoursFocus,
|
|
92
93
|
onKeyDown: onHoursKeyDown,
|
|
93
94
|
contextRef: hourInputRef,
|
|
95
|
+
tabIndex,
|
|
94
96
|
placeholder: "HH",
|
|
95
97
|
ariaCurrentValueForInputs,
|
|
96
98
|
autoFocusHourInput,
|
|
@@ -109,6 +111,7 @@ const TimeInputs = () => {
|
|
|
109
111
|
onFocus: onMinutesFocus,
|
|
110
112
|
onKeyDown: onMinutesKeyDown,
|
|
111
113
|
contextRef: minutesInputRef,
|
|
114
|
+
tabIndex,
|
|
112
115
|
placeholder: "MM",
|
|
113
116
|
ariaCurrentValueForInputs,
|
|
114
117
|
disabled,
|
|
@@ -126,6 +129,7 @@ const TimeInputs = () => {
|
|
|
126
129
|
onFocus: onMeridiemFocus,
|
|
127
130
|
onKeyDown: onMeridiemKeyDown,
|
|
128
131
|
contextRef: meridiemInputRef,
|
|
132
|
+
tabIndex,
|
|
129
133
|
placeholder: "AM",
|
|
130
134
|
ariaCurrentValueForInputs,
|
|
131
135
|
disabled,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/TimeInputs/TimeInputs.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 { HHInput } from './HHInput.js';\nimport { MinutesInput } from './MinutesInput.js';\nimport { MeridiemInput } from './MeridiemInput.js';\nimport { useTimeInputs } from './useTimeInputs.js';\nimport { fixedValues } from '../config.js';\nimport { StyledColonSeparator, StyledSeparator, StyledFocusWithIn } from '../Styleds.js';\n\nexport const TimeInputs = (): JSX.Element => {\n const {\n autoFocusHourInput,\n disabled,\n onHoursChange,\n onMinutesChange,\n onMeridiemChange,\n onHoursBlur,\n onMinutesBlur,\n onMeridiemBlur,\n onHoursFocus,\n onMeridiemFocus,\n onMinutesFocus,\n onHoursKeyDown,\n onMinutesKeyDown,\n onMeridiemKeyDown,\n } = useTimeInputs();\n\n // we do this here so HHInput,MinutesInput, MeridiemInput can be pure components memoized via React.memo\n const {\n hours,\n minutes,\n meridiem,\n hourInputRef,\n minutesInputRef,\n meridiemInputRef,\n ariaCurrentValueForInputs,\n latestInteractionRegion,\n currFocusDescriber,\n getProps,\n } = useContext(ControlledDateTimePickerContext);\n\n return (\n <Grid\n cols={[\n fixedValues.smallInputWidth,\n fixedValues.separatorWidth,\n fixedValues.smallInputWidth,\n fixedValues.separatorWidth,\n fixedValues.smallInputWidth,\n ]}\n >\n <StyledFocusWithIn>\n <HHInput\n value={hours}\n onChange={onHoursChange}\n onBlur={onHoursBlur}\n onFocus={onHoursFocus}\n onKeyDown={onHoursKeyDown}\n contextRef={hourInputRef}\n placeholder=\"HH\"\n ariaCurrentValueForInputs={ariaCurrentValueForInputs}\n autoFocusHourInput={autoFocusHourInput}\n disabled={disabled}\n isFocused={latestInteractionRegion === 'time-inputs' && currFocusDescriber === 'hour-input'}\n getProps={getProps}\n />\n </StyledFocusWithIn>\n <StyledColonSeparator alignItems=\"center\">:</StyledColonSeparator>\n <StyledFocusWithIn>\n <MinutesInput\n value={minutes}\n onChange={onMinutesChange}\n onBlur={onMinutesBlur}\n onFocus={onMinutesFocus}\n onKeyDown={onMinutesKeyDown}\n contextRef={minutesInputRef}\n placeholder=\"MM\"\n ariaCurrentValueForInputs={ariaCurrentValueForInputs}\n disabled={disabled}\n isFocused={latestInteractionRegion === 'time-inputs' && currFocusDescriber === 'minute-input'}\n getProps={getProps}\n />\n </StyledFocusWithIn>\n <StyledSeparator> </StyledSeparator>\n <StyledFocusWithIn>\n <MeridiemInput\n value={meridiem}\n onChange={onMeridiemChange}\n onBlur={onMeridiemBlur}\n onFocus={onMeridiemFocus}\n onKeyDown={onMeridiemKeyDown}\n contextRef={meridiemInputRef}\n placeholder=\"AM\"\n ariaCurrentValueForInputs={ariaCurrentValueForInputs}\n disabled={disabled}\n isFocused={latestInteractionRegion === 'time-inputs' && currFocusDescriber === 'meridiem-input'}\n getProps={getProps}\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;
|
|
4
|
+
"sourcesContent": ["import React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX.js';\nimport { HHInput } from './HHInput.js';\nimport { MinutesInput } from './MinutesInput.js';\nimport { MeridiemInput } from './MeridiemInput.js';\nimport { useTimeInputs } from './useTimeInputs.js';\nimport { fixedValues } from '../config.js';\nimport { StyledColonSeparator, StyledSeparator, StyledFocusWithIn } from '../Styleds.js';\n\nexport const TimeInputs = (): JSX.Element => {\n const {\n autoFocusHourInput,\n disabled,\n onHoursChange,\n onMinutesChange,\n onMeridiemChange,\n onHoursBlur,\n onMinutesBlur,\n onMeridiemBlur,\n onHoursFocus,\n onMeridiemFocus,\n onMinutesFocus,\n onHoursKeyDown,\n onMinutesKeyDown,\n onMeridiemKeyDown,\n } = useTimeInputs();\n\n // we do this here so HHInput,MinutesInput, MeridiemInput can be pure components memoized via React.memo\n const {\n hours,\n minutes,\n meridiem,\n hourInputRef,\n minutesInputRef,\n meridiemInputRef,\n ariaCurrentValueForInputs,\n latestInteractionRegion,\n currFocusDescriber,\n getProps,\n props: { tabIndex },\n } = useContext(ControlledDateTimePickerContext);\n\n return (\n <Grid\n cols={[\n fixedValues.smallInputWidth,\n fixedValues.separatorWidth,\n fixedValues.smallInputWidth,\n fixedValues.separatorWidth,\n fixedValues.smallInputWidth,\n ]}\n >\n <StyledFocusWithIn>\n <HHInput\n value={hours}\n onChange={onHoursChange}\n onBlur={onHoursBlur}\n onFocus={onHoursFocus}\n onKeyDown={onHoursKeyDown}\n contextRef={hourInputRef}\n tabIndex={tabIndex}\n placeholder=\"HH\"\n ariaCurrentValueForInputs={ariaCurrentValueForInputs}\n autoFocusHourInput={autoFocusHourInput}\n disabled={disabled}\n isFocused={latestInteractionRegion === 'time-inputs' && currFocusDescriber === 'hour-input'}\n getProps={getProps}\n />\n </StyledFocusWithIn>\n <StyledColonSeparator alignItems=\"center\">:</StyledColonSeparator>\n <StyledFocusWithIn>\n <MinutesInput\n value={minutes}\n onChange={onMinutesChange}\n onBlur={onMinutesBlur}\n onFocus={onMinutesFocus}\n onKeyDown={onMinutesKeyDown}\n contextRef={minutesInputRef}\n tabIndex={tabIndex}\n placeholder=\"MM\"\n ariaCurrentValueForInputs={ariaCurrentValueForInputs}\n disabled={disabled}\n isFocused={latestInteractionRegion === 'time-inputs' && currFocusDescriber === 'minute-input'}\n getProps={getProps}\n />\n </StyledFocusWithIn>\n <StyledSeparator> </StyledSeparator>\n <StyledFocusWithIn>\n <MeridiemInput\n value={meridiem}\n onChange={onMeridiemChange}\n onBlur={onMeridiemBlur}\n onFocus={onMeridiemFocus}\n onKeyDown={onMeridiemKeyDown}\n contextRef={meridiemInputRef}\n tabIndex={tabIndex}\n placeholder=\"AM\"\n ariaCurrentValueForInputs={ariaCurrentValueForInputs}\n disabled={disabled}\n isFocused={latestInteractionRegion === 'time-inputs' && currFocusDescriber === 'meridiem-input'}\n getProps={getProps}\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;AD4CnB;AA5CJ,mBAAkC;AAClC,qBAAqB;AACrB,yCAAgD;AAChD,qBAAwB;AACxB,0BAA6B;AAC7B,2BAA8B;AAC9B,2BAA8B;AAC9B,oBAA4B;AAC5B,qBAAyE;AAElE,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,EACF,QAAI,oCAAc;AAGlB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,EAAE,SAAS;AAAA,EACpB,QAAI,yBAAW,kEAA+B;AAE9C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,QACJ,0BAAY;AAAA,QACZ,0BAAY;AAAA,QACZ,0BAAY;AAAA,QACZ,0BAAY;AAAA,QACZ,0BAAY;AAAA,MACd;AAAA,MAEA;AAAA,oDAAC,oCACC;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,YACP,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,WAAW;AAAA,YACX,YAAY;AAAA,YACZ;AAAA,YACA,aAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACA;AAAA,YACA,WAAW,4BAA4B,iBAAiB,uBAAuB;AAAA,YAC/E;AAAA;AAAA,QACF,GACF;AAAA,QACA,4CAAC,uCAAqB,YAAW,UAAS,eAAC;AAAA,QAC3C,4CAAC,oCACC;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,YACP,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,WAAW;AAAA,YACX,YAAY;AAAA,YACZ;AAAA,YACA,aAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACA,WAAW,4BAA4B,iBAAiB,uBAAuB;AAAA,YAC/E;AAAA;AAAA,QACF,GACF;AAAA,QACA,4CAAC,kCAAgB,eAAC;AAAA,QAClB,4CAAC,oCACC;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,YACP,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,WAAW;AAAA,YACX,YAAY;AAAA,YACZ;AAAA,YACA,aAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACA,WAAW,4BAA4B,iBAAiB,uBAAuB;AAAA,YAC/E;AAAA;AAAA,QACF,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -112,6 +112,7 @@ const propTypes = {
|
|
|
112
112
|
).defaultValue("01:00 AM"),
|
|
113
113
|
minutesInterval: import_ds_props_helpers.PropTypes.number.description("increments/decrements of minutes in time related controllers interactions").defaultValue("1"),
|
|
114
114
|
"data-testid": import_ds_props_helpers.PropTypes.string.description("Unique id for tests.").defaultValue(""),
|
|
115
|
-
...(0, import_ds_props_helpers.getPropsPerDatatestIdPropTypes)(import_ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid)
|
|
115
|
+
...(0, import_ds_props_helpers.getPropsPerDatatestIdPropTypes)(import_ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid),
|
|
116
|
+
innerRef: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.func, import_ds_props_helpers.PropTypes.object]).description("inner ref for the month input")
|
|
116
117
|
};
|
|
117
118
|
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport type { WeakValidationMap } from 'react';\nimport type React from 'react';\nimport {\n PropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n getPropsPerDatatestIdPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { ControlledDateTimePickerDatatestid } from './ControlledDateTimePickerDatatestid.js';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = (): void => {};\nconst defaultReturnFalse = (): false => false;\nexport declare namespace DSControlledDateTimePickerT {\n type DataTestIdType = typeof ControlledDateTimePickerDatatestid;\n // typescript type that rapresents the union of all the values for ControlledDateTimePickerDatatestid\n export type FlatDataTestIdValues = {\n [K in keyof DataTestIdType]: DataTestIdType[K] extends Record<string, unknown>\n ? DataTestIdType[K][keyof DataTestIdType[K]] // this is only 1 level deep, but it's enough for our needs right now\n : // can be extended to more levels if needed as follows:\n // ? DataTestIdType[K][keyof DataTestIdType[K]] extends Record<string, unknown>\n // ? DataTestIdType[K][keyof DataTestIdType[K]][keyof DataTestIdType[K][keyof DataTestIdType[K]]]\n // : DataTestIdType[K][keyof DataTestIdType[K]]\n DataTestIdType[K];\n }[keyof DataTestIdType];\n\n export type AriaAndDataPropsPerDataTestId = {\n [key in FlatDataTestIdValues]?: AriaAndDataPropsOrPropsGetter;\n };\n\n export type OnInternalValuesChangeEvent =\n | React.ChangeEvent<HTMLInputElement>\n | React.KeyboardEvent<HTMLInputElement>\n | React.KeyboardEvent<HTMLButtonElement>\n | React.KeyboardEvent\n | React.MouseEvent<HTMLInputElement>\n | React.MouseEvent<HTMLButtonElement>;\n export type ControlTypes =\n | 'full-date-time'\n | 'date-time-inputs'\n | 'date-time-picker'\n | 'date-time-picker-controller-only'\n | 'full-date'\n | 'date-inputs'\n | 'date-picker'\n | 'date-picker-controller-only'\n | 'full-time'\n | 'time-inputs'\n | 'time-picker'\n | 'time-picker-controller-only';\n export interface InternalInputsChangeMetaInfo {\n isAutomaticFillTrigger?: boolean;\n isDayPresentInMonth?: boolean;\n isOutOfRangeDay?: boolean;\n isDisabledDay?: boolean;\n isDisabledTime?: boolean;\n suggestedErrorMsg?: string;\n newDateTimeString?: string;\n newDateString?: string;\n newTimeString?: string;\n }\n\n export type OnDateChange = (val: string, metaInfo: InternalInputsChangeMetaInfo) => void;\n export type OnTimeChange = (val: string, metaInfo: InternalInputsChangeMetaInfo) => void;\n export type OnDateTimeChange = (val: string, metaInfo: InternalInputsChangeMetaInfo) => void;\n export type OnInternalInputsChange = (\n val: string,\n e: OnInternalValuesChangeEvent,\n metaInfo?: InternalInputsChangeMetaInfo,\n ) => void;\n export type AppOnInputChange = (\n val: string,\n e: OnInternalValuesChangeEvent,\n metaInfo: InternalInputsChangeMetaInfo,\n ) => void;\n\n /* ------------------------ ------------------ ------------------------*/\n /* ------------------------ DATE CONFIGURATION ------------------------*/\n /* ------------------------ ------------------ ------------------------*/\n export interface DefaultDateProps {\n onMonthChange: AppOnInputChange;\n onDayChange: AppOnInputChange;\n onYearChange: AppOnInputChange;\n onPickerOpen: NoopishFunc;\n onPickerClose: NoopishFunc;\n getIsDisabledDay: BooleanGetter<string>;\n getIsOutOfRangeDay: BooleanGetter<string>;\n getIsStartRangeDay: BooleanGetter<string>;\n getIsDayInRange: BooleanGetter<string>;\n getIsEndRangeDay: BooleanGetter<string>;\n isClearable: boolean;\n disabled: boolean;\n hasError: boolean;\n autoFocus: boolean;\n preventCloseOnSelection: boolean;\n }\n export interface OptionalDatePickerProps extends AriaAndDataPropsPerDataTestId {\n emptyPickerStartingMonth?: string;\n onCalendarOpenFocusedDay?: string;\n pickerFooterMsg?: string;\n innerRef?:\n | React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null>\n | ((ref: HTMLInputElement | HTMLButtonElement | null) => void);\n }\n export interface RequiredDatePickerProps {\n type: 'full-date' | 'date-inputs' | 'date-picker' | 'date-picker-controller-only';\n date: string;\n onDateChange: OnDateChange;\n }\n export type DatePickerProps = OptionalDatePickerProps & Partial<DefaultDateProps> & RequiredDatePickerProps;\n export type InternalDatePickerProps = OptionalDatePickerProps & DefaultDateProps & RequiredDatePickerProps;\n\n /* ------------------------ ------------------ ------------------------*/\n /* ------------------------ TIME CONFIGURATION ------------------------*/\n /* ------------------------ ------------------ ------------------------*/\n\n export interface DefaultTimeProps {\n onHourChange: AppOnInputChange;\n onMinuteChange: AppOnInputChange;\n onMeridiemChange: AppOnInputChange;\n onPickerOpen: NoopishFunc;\n onPickerClose: NoopishFunc;\n getIsDisabledTime: BooleanGetter<string>;\n minutesInterval: number;\n isClearable: boolean;\n disabled: boolean;\n hasError: boolean;\n autoFocus: boolean;\n preventCloseOnSelection: boolean;\n }\n export interface OptionalTimePickerProps extends AriaAndDataPropsPerDataTestId {\n pickerFooterMsg?: string;\n onTimeWheelOpenStartingTime?: string;\n innerRef?:\n | React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null>\n | ((ref: HTMLInputElement | HTMLButtonElement | null) => void);\n }\n export interface RequiredTimePickerProps {\n type: 'full-time' | 'time-inputs' | 'time-picker' | 'time-picker-controller-only';\n time: string;\n onTimeChange: OnTimeChange;\n }\n export type TimePickerProps = OptionalTimePickerProps & Partial<DefaultTimeProps> & RequiredTimePickerProps;\n export type InternalTimePickerProps = OptionalTimePickerProps & DefaultTimeProps & RequiredTimePickerProps;\n\n /* -------------------- ---------------------- ------------------------*/\n /* -------------------- DATETIME CONFIGURATION ------------------------*/\n /* -------------------- ---------------------- ------------------------*/\n\n export type DefaultDateTimeProps = DefaultTimeProps &\n DefaultDateProps & {\n onDateChange: OnDateChange;\n onTimeChange: OnTimeChange;\n };\n export type OptionalDateTimeProps = AriaAndDataPropsPerDataTestId & OptionalTimePickerProps & OptionalDatePickerProps;\n export interface RequiredDateTimeProps {\n type: 'full-date-time' | 'date-time-inputs' | 'date-time-picker' | 'date-time-picker-controller-only';\n dateTime: string;\n onDateTimeChange: OnDateTimeChange;\n }\n\n export type DateTimePickerProps = Partial<DefaultDateTimeProps> & OptionalDateTimeProps & RequiredDateTimeProps;\n export type InternalDateTimePickerProps = DefaultDateTimeProps & OptionalDateTimeProps & RequiredDateTimeProps;\n\n /* ---------------------- ------------------- -------------------------*/\n /* ---------------------- FINAL CONFIGURATION -------------------------*/\n /* ---------------------- ------------------- -------------------------*/\n export type DefaultProps = DefaultDateTimeProps & { type: 'full-date-time' };\n export type Props = DateTimePickerProps | DatePickerProps | TimePickerProps;\n export type InternalProps = InternalDateTimePickerProps | InternalDatePickerProps | InternalTimePickerProps;\n}\n\nexport const defaultProps: DSControlledDateTimePickerT.DefaultProps = {\n type: 'full-date-time',\n onDateChange: noop,\n onMonthChange: noop,\n onDayChange: noop,\n onYearChange: noop,\n onTimeChange: noop,\n onHourChange: noop,\n onMinuteChange: noop,\n onMeridiemChange: noop,\n onPickerOpen: noop,\n onPickerClose: noop,\n getIsDisabledDay: defaultReturnFalse,\n getIsOutOfRangeDay: defaultReturnFalse,\n getIsStartRangeDay: defaultReturnFalse,\n getIsDayInRange: defaultReturnFalse,\n getIsEndRangeDay: defaultReturnFalse,\n getIsDisabledTime: defaultReturnFalse,\n minutesInterval: 1,\n isClearable: false,\n disabled: false,\n hasError: false,\n autoFocus: false,\n preventCloseOnSelection: false,\n};\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n type: PropTypes.oneOf([\n 'full-date-time',\n 'date-time-inputs',\n 'date-time-picker',\n 'date-time-picker-controller-only',\n 'full-date',\n 'date-inputs',\n 'date-picker',\n 'date-picker-controller-only',\n 'full-time',\n 'time-inputs',\n 'time-picker',\n 'time-picker-controller-only',\n ])\n .description('Type of time form control to use')\n .defaultValue('full-date-time'),\n disabled: PropTypes.bool.description('wheter or not the input is disabled').defaultValue(false),\n isClearable: PropTypes.bool.description('with or without clearable button').defaultValue(false),\n dateTime: PropTypes.string.description('when using date-time types, this is the value of the controller'),\n date: PropTypes.string.description('when using date types, this is the value of the controller'),\n time: PropTypes.string.description('when using time types, this is the value of the controller'),\n onDateChange: PropTypes.func.description('(newDateString, metaInformations) => void'),\n onTimeChange: PropTypes.func.description('(newTimeString, metaInformations) => void'),\n onDateTimeChange: PropTypes.func.description('(newDateTimeString, metaInformations) => void'),\n onMonthChange: PropTypes.func.description('(newMonthString, event, metaInformations) => void'),\n onDayChange: PropTypes.func.description('(newDayString, event, metaInformations) => void'),\n onYearChange: PropTypes.func.description('(newYearString, event, metaInformations) => void'),\n onHourChange: PropTypes.func.description('(newHourString, event, metaInformations) => void'),\n onMinuteChange: PropTypes.func.description('(newMinuteString, event, metaInformations) => void'),\n onMeridiemChange: PropTypes.func.description('(newMeridiemString, event, metaInformations) => void'),\n getIsDisabledDay: PropTypes.func.description(\n '(dayAsString) => true for marking as disabled, false for marking as valid',\n ),\n getIsOutOfRangeDay: PropTypes.func.description(\n '(dayAsString) => true for marking as disabled, false for marking as valid',\n ),\n getIsDisabledTime: PropTypes.func.description(\n '(timeAsString) => true for marking as disabled, false for marking as valid',\n ),\n emptyPickerStartingMonth: PropTypes.string.description(\n 'which month to start the calendar on open, when value is empty, string following the \"MM/__/YYYY\" pattern',\n ),\n onCalendarOpenFocusedDay: PropTypes.string\n .description('which day to focus on calendar open when value is empty, string following the \"MM/DD/YYYY\" pattern')\n .defaultValue('if value is empty current month, else current month'),\n onTimeWheelOpenStartingTime: PropTypes.string\n .description(\n 'which day to start the timewheel on picker open when value is empty, string following the HH:MM AA\" pattern',\n )\n .defaultValue('01:00 AM'),\n minutesInterval: PropTypes.number\n .description('increments/decrements of minutes in time related controllers interactions')\n .defaultValue('1'),\n 'data-testid': PropTypes.string.description('Unique id for tests.').defaultValue(''),\n ...getPropsPerDatatestIdPropTypes(ControlledDateTimePickerDatatestid),\n} as WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAKO;AACP,gDAAmD;AAGnD,MAAM,OAAO,MAAY;AAAC;AAC1B,MAAM,qBAAqB,MAAa;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport type { WeakValidationMap } from 'react';\nimport type React from 'react';\nimport {\n PropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n getPropsPerDatatestIdPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { ControlledDateTimePickerDatatestid } from './ControlledDateTimePickerDatatestid.js';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = (): void => {};\nconst defaultReturnFalse = (): false => false;\nexport declare namespace DSControlledDateTimePickerT {\n type DataTestIdType = typeof ControlledDateTimePickerDatatestid;\n // typescript type that rapresents the union of all the values for ControlledDateTimePickerDatatestid\n export type FlatDataTestIdValues = {\n [K in keyof DataTestIdType]: DataTestIdType[K] extends Record<string, unknown>\n ? DataTestIdType[K][keyof DataTestIdType[K]] // this is only 1 level deep, but it's enough for our needs right now\n : // can be extended to more levels if needed as follows:\n // ? DataTestIdType[K][keyof DataTestIdType[K]] extends Record<string, unknown>\n // ? DataTestIdType[K][keyof DataTestIdType[K]][keyof DataTestIdType[K][keyof DataTestIdType[K]]]\n // : DataTestIdType[K][keyof DataTestIdType[K]]\n DataTestIdType[K];\n }[keyof DataTestIdType];\n\n export type AriaAndDataPropsPerDataTestId = {\n [key in FlatDataTestIdValues]?: AriaAndDataPropsOrPropsGetter;\n };\n\n export type OnInternalValuesChangeEvent =\n | React.ChangeEvent<HTMLInputElement>\n | React.KeyboardEvent<HTMLInputElement>\n | React.KeyboardEvent<HTMLButtonElement>\n | React.KeyboardEvent\n | React.MouseEvent<HTMLInputElement>\n | React.MouseEvent<HTMLButtonElement>;\n export type ControlTypes =\n | 'full-date-time'\n | 'date-time-inputs'\n | 'date-time-picker'\n | 'date-time-picker-controller-only'\n | 'full-date'\n | 'date-inputs'\n | 'date-picker'\n | 'date-picker-controller-only'\n | 'full-time'\n | 'time-inputs'\n | 'time-picker'\n | 'time-picker-controller-only';\n export interface InternalInputsChangeMetaInfo {\n isAutomaticFillTrigger?: boolean;\n isDayPresentInMonth?: boolean;\n isOutOfRangeDay?: boolean;\n isDisabledDay?: boolean;\n isDisabledTime?: boolean;\n suggestedErrorMsg?: string;\n newDateTimeString?: string;\n newDateString?: string;\n newTimeString?: string;\n }\n\n export type OnDateChange = (val: string, metaInfo: InternalInputsChangeMetaInfo) => void;\n export type OnTimeChange = (val: string, metaInfo: InternalInputsChangeMetaInfo) => void;\n export type OnDateTimeChange = (val: string, metaInfo: InternalInputsChangeMetaInfo) => void;\n export type OnInternalInputsChange = (\n val: string,\n e: OnInternalValuesChangeEvent,\n metaInfo?: InternalInputsChangeMetaInfo,\n ) => void;\n export type AppOnInputChange = (\n val: string,\n e: OnInternalValuesChangeEvent,\n metaInfo: InternalInputsChangeMetaInfo,\n ) => void;\n\n /* ------------------------ ------------------ ------------------------*/\n /* ------------------------ DATE CONFIGURATION ------------------------*/\n /* ------------------------ ------------------ ------------------------*/\n export interface DefaultDateProps {\n onMonthChange: AppOnInputChange;\n onDayChange: AppOnInputChange;\n onYearChange: AppOnInputChange;\n onPickerOpen: NoopishFunc;\n onPickerClose: NoopishFunc;\n getIsDisabledDay: BooleanGetter<string>;\n getIsOutOfRangeDay: BooleanGetter<string>;\n getIsStartRangeDay: BooleanGetter<string>;\n getIsDayInRange: BooleanGetter<string>;\n getIsEndRangeDay: BooleanGetter<string>;\n isClearable: boolean;\n disabled: boolean;\n hasError: boolean;\n autoFocus: boolean;\n preventCloseOnSelection: boolean;\n }\n export interface OptionalDatePickerProps extends AriaAndDataPropsPerDataTestId {\n emptyPickerStartingMonth?: string;\n onCalendarOpenFocusedDay?: string;\n pickerFooterMsg?: string;\n innerRef?:\n | React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null>\n | ((ref: HTMLInputElement | HTMLButtonElement | null) => void);\n tabIndex?: WCAGTabIndex;\n }\n export interface RequiredDatePickerProps {\n type: 'full-date' | 'date-inputs' | 'date-picker' | 'date-picker-controller-only';\n date: string;\n onDateChange: OnDateChange;\n }\n export type DatePickerProps = OptionalDatePickerProps & Partial<DefaultDateProps> & RequiredDatePickerProps;\n export type InternalDatePickerProps = OptionalDatePickerProps & DefaultDateProps & RequiredDatePickerProps;\n\n /* ------------------------ ------------------ ------------------------*/\n /* ------------------------ TIME CONFIGURATION ------------------------*/\n /* ------------------------ ------------------ ------------------------*/\n\n export interface DefaultTimeProps {\n onHourChange: AppOnInputChange;\n onMinuteChange: AppOnInputChange;\n onMeridiemChange: AppOnInputChange;\n onPickerOpen: NoopishFunc;\n onPickerClose: NoopishFunc;\n getIsDisabledTime: BooleanGetter<string>;\n minutesInterval: number;\n isClearable: boolean;\n disabled: boolean;\n hasError: boolean;\n autoFocus: boolean;\n preventCloseOnSelection: boolean;\n }\n export interface OptionalTimePickerProps extends AriaAndDataPropsPerDataTestId {\n pickerFooterMsg?: string;\n onTimeWheelOpenStartingTime?: string;\n innerRef?:\n | React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null>\n | ((ref: HTMLInputElement | HTMLButtonElement | null) => void);\n tabIndex?: WCAGTabIndex;\n }\n export interface RequiredTimePickerProps {\n type: 'full-time' | 'time-inputs' | 'time-picker' | 'time-picker-controller-only';\n time: string;\n onTimeChange: OnTimeChange;\n }\n export type TimePickerProps = OptionalTimePickerProps & Partial<DefaultTimeProps> & RequiredTimePickerProps;\n export type InternalTimePickerProps = OptionalTimePickerProps & DefaultTimeProps & RequiredTimePickerProps;\n\n /* -------------------- ---------------------- ------------------------*/\n /* -------------------- DATETIME CONFIGURATION ------------------------*/\n /* -------------------- ---------------------- ------------------------*/\n\n export type DefaultDateTimeProps = DefaultTimeProps &\n DefaultDateProps & {\n onDateChange: OnDateChange;\n onTimeChange: OnTimeChange;\n };\n export type OptionalDateTimeProps = AriaAndDataPropsPerDataTestId & OptionalTimePickerProps & OptionalDatePickerProps;\n export interface RequiredDateTimeProps {\n type: 'full-date-time' | 'date-time-inputs' | 'date-time-picker' | 'date-time-picker-controller-only';\n dateTime: string;\n onDateTimeChange: OnDateTimeChange;\n }\n\n export type DateTimePickerProps = Partial<DefaultDateTimeProps> & OptionalDateTimeProps & RequiredDateTimeProps;\n export type InternalDateTimePickerProps = DefaultDateTimeProps & OptionalDateTimeProps & RequiredDateTimeProps;\n\n /* ---------------------- ------------------- -------------------------*/\n /* ---------------------- FINAL CONFIGURATION -------------------------*/\n /* ---------------------- ------------------- -------------------------*/\n export type DefaultProps = DefaultDateTimeProps & { type: 'full-date-time' };\n export type Props = DateTimePickerProps | DatePickerProps | TimePickerProps;\n export type InternalProps = InternalDateTimePickerProps | InternalDatePickerProps | InternalTimePickerProps;\n}\n\nexport const defaultProps: DSControlledDateTimePickerT.DefaultProps = {\n type: 'full-date-time',\n onDateChange: noop,\n onMonthChange: noop,\n onDayChange: noop,\n onYearChange: noop,\n onTimeChange: noop,\n onHourChange: noop,\n onMinuteChange: noop,\n onMeridiemChange: noop,\n onPickerOpen: noop,\n onPickerClose: noop,\n getIsDisabledDay: defaultReturnFalse,\n getIsOutOfRangeDay: defaultReturnFalse,\n getIsStartRangeDay: defaultReturnFalse,\n getIsDayInRange: defaultReturnFalse,\n getIsEndRangeDay: defaultReturnFalse,\n getIsDisabledTime: defaultReturnFalse,\n minutesInterval: 1,\n isClearable: false,\n disabled: false,\n hasError: false,\n autoFocus: false,\n preventCloseOnSelection: false,\n};\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n type: PropTypes.oneOf([\n 'full-date-time',\n 'date-time-inputs',\n 'date-time-picker',\n 'date-time-picker-controller-only',\n 'full-date',\n 'date-inputs',\n 'date-picker',\n 'date-picker-controller-only',\n 'full-time',\n 'time-inputs',\n 'time-picker',\n 'time-picker-controller-only',\n ])\n .description('Type of time form control to use')\n .defaultValue('full-date-time'),\n disabled: PropTypes.bool.description('wheter or not the input is disabled').defaultValue(false),\n isClearable: PropTypes.bool.description('with or without clearable button').defaultValue(false),\n dateTime: PropTypes.string.description('when using date-time types, this is the value of the controller'),\n date: PropTypes.string.description('when using date types, this is the value of the controller'),\n time: PropTypes.string.description('when using time types, this is the value of the controller'),\n onDateChange: PropTypes.func.description('(newDateString, metaInformations) => void'),\n onTimeChange: PropTypes.func.description('(newTimeString, metaInformations) => void'),\n onDateTimeChange: PropTypes.func.description('(newDateTimeString, metaInformations) => void'),\n onMonthChange: PropTypes.func.description('(newMonthString, event, metaInformations) => void'),\n onDayChange: PropTypes.func.description('(newDayString, event, metaInformations) => void'),\n onYearChange: PropTypes.func.description('(newYearString, event, metaInformations) => void'),\n onHourChange: PropTypes.func.description('(newHourString, event, metaInformations) => void'),\n onMinuteChange: PropTypes.func.description('(newMinuteString, event, metaInformations) => void'),\n onMeridiemChange: PropTypes.func.description('(newMeridiemString, event, metaInformations) => void'),\n getIsDisabledDay: PropTypes.func.description(\n '(dayAsString) => true for marking as disabled, false for marking as valid',\n ),\n getIsOutOfRangeDay: PropTypes.func.description(\n '(dayAsString) => true for marking as disabled, false for marking as valid',\n ),\n getIsDisabledTime: PropTypes.func.description(\n '(timeAsString) => true for marking as disabled, false for marking as valid',\n ),\n emptyPickerStartingMonth: PropTypes.string.description(\n 'which month to start the calendar on open, when value is empty, string following the \"MM/__/YYYY\" pattern',\n ),\n onCalendarOpenFocusedDay: PropTypes.string\n .description('which day to focus on calendar open when value is empty, string following the \"MM/DD/YYYY\" pattern')\n .defaultValue('if value is empty current month, else current month'),\n onTimeWheelOpenStartingTime: PropTypes.string\n .description(\n 'which day to start the timewheel on picker open when value is empty, string following the HH:MM AA\" pattern',\n )\n .defaultValue('01:00 AM'),\n minutesInterval: PropTypes.number\n .description('increments/decrements of minutes in time related controllers interactions')\n .defaultValue('1'),\n 'data-testid': PropTypes.string.description('Unique id for tests.').defaultValue(''),\n ...getPropsPerDatatestIdPropTypes(ControlledDateTimePickerDatatestid),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('inner ref for the month input'),\n} as WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAKO;AACP,gDAAmD;AAGnD,MAAM,OAAO,MAAY;AAAC;AAC1B,MAAM,qBAAqB,MAAa;AAkKjC,MAAM,eAAyD;AAAA,EACpE,MAAM;AAAA,EACN,cAAc;AAAA,EACd,eAAe;AAAA,EACf,aAAa;AAAA,EACb,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,cAAc;AAAA,EACd,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,oBAAoB;AAAA,EACpB,oBAAoB;AAAA,EACpB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,UAAU;AAAA,EACV,UAAU;AAAA,EACV,WAAW;AAAA,EACX,yBAAyB;AAC3B;AAEO,MAAM,YAAY;AAAA,EACvB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,MAAM,kCAAU,MAAM;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC,EACE,YAAY,kCAAkC,EAC9C,aAAa,gBAAgB;AAAA,EAChC,UAAU,kCAAU,KAAK,YAAY,qCAAqC,EAAE,aAAa,KAAK;AAAA,EAC9F,aAAa,kCAAU,KAAK,YAAY,kCAAkC,EAAE,aAAa,KAAK;AAAA,EAC9F,UAAU,kCAAU,OAAO,YAAY,iEAAiE;AAAA,EACxG,MAAM,kCAAU,OAAO,YAAY,4DAA4D;AAAA,EAC/F,MAAM,kCAAU,OAAO,YAAY,4DAA4D;AAAA,EAC/F,cAAc,kCAAU,KAAK,YAAY,2CAA2C;AAAA,EACpF,cAAc,kCAAU,KAAK,YAAY,2CAA2C;AAAA,EACpF,kBAAkB,kCAAU,KAAK,YAAY,+CAA+C;AAAA,EAC5F,eAAe,kCAAU,KAAK,YAAY,mDAAmD;AAAA,EAC7F,aAAa,kCAAU,KAAK,YAAY,iDAAiD;AAAA,EACzF,cAAc,kCAAU,KAAK,YAAY,kDAAkD;AAAA,EAC3F,cAAc,kCAAU,KAAK,YAAY,kDAAkD;AAAA,EAC3F,gBAAgB,kCAAU,KAAK,YAAY,oDAAoD;AAAA,EAC/F,kBAAkB,kCAAU,KAAK,YAAY,sDAAsD;AAAA,EACnG,kBAAkB,kCAAU,KAAK;AAAA,IAC/B;AAAA,EACF;AAAA,EACA,oBAAoB,kCAAU,KAAK;AAAA,IACjC;AAAA,EACF;AAAA,EACA,mBAAmB,kCAAU,KAAK;AAAA,IAChC;AAAA,EACF;AAAA,EACA,0BAA0B,kCAAU,OAAO;AAAA,IACzC;AAAA,EACF;AAAA,EACA,0BAA0B,kCAAU,OACjC,YAAY,oGAAoG,EAChH,aAAa,qDAAqD;AAAA,EACrE,6BAA6B,kCAAU,OACpC;AAAA,IACC;AAAA,EACF,EACC,aAAa,UAAU;AAAA,EAC1B,iBAAiB,kCAAU,OACxB,YAAY,2EAA2E,EACvF,aAAa,GAAG;AAAA,EACnB,eAAe,kCAAU,OAAO,YAAY,sBAAsB,EAAE,aAAa,EAAE;AAAA,EACnF,OAAG,wDAA+B,4EAAkC;AAAA,EACpE,UAAU,kCAAU,UAAU,CAAC,kCAAU,MAAM,kCAAU,MAAM,CAAC,EAAE,YAAY,+BAA+B;AAC/G;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -12,7 +12,12 @@ const ClearButton = () => {
|
|
|
12
12
|
const styledsAttrs = {
|
|
13
13
|
shouldDisplay: withClearBtn
|
|
14
14
|
};
|
|
15
|
-
const {
|
|
15
|
+
const {
|
|
16
|
+
latestInteractionRegion,
|
|
17
|
+
currFocusDescriber,
|
|
18
|
+
getProps,
|
|
19
|
+
props: { tabIndex }
|
|
20
|
+
} = useContext(ControlledDateTimePickerContext);
|
|
16
21
|
return /* @__PURE__ */ jsx(
|
|
17
22
|
StyledClearButton,
|
|
18
23
|
{
|
|
@@ -25,6 +30,7 @@ const ClearButton = () => {
|
|
|
25
30
|
if (latestInteractionRegion === "clear-btn" && currFocusDescriber === "clear-btn")
|
|
26
31
|
DomElem?.focus?.();
|
|
27
32
|
},
|
|
33
|
+
tabIndex,
|
|
28
34
|
onClick: onClearClick,
|
|
29
35
|
onKeyDown: onClearButtonKeyDown,
|
|
30
36
|
type: "button",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/ClearButton/ClearButton.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */\nimport React, { useContext } from 'react';\nimport { CloseMedium } from '@elliemae/ds-icons';\nimport { BUTTON_SIZES } from '@elliemae/ds-button-v2';\nimport { StyledClearButton } from '../Styleds.js';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid.js';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX.js';\nimport { useClearButton } from './useClearButton.js';\n\nexport const ClearButton = (): JSX.Element => {\n const { onClearClick, onClearButtonKeyDown, clearButtonRef, withClearBtn } = useClearButton();\n const styledsAttrs = {\n shouldDisplay: withClearBtn,\n };\n const {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */\nimport React, { useContext } from 'react';\nimport { CloseMedium } from '@elliemae/ds-icons';\nimport { BUTTON_SIZES } from '@elliemae/ds-button-v2';\nimport { StyledClearButton } from '../Styleds.js';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid.js';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX.js';\nimport { useClearButton } from './useClearButton.js';\n\nexport const ClearButton = (): JSX.Element => {\n const { onClearClick, onClearButtonKeyDown, clearButtonRef, withClearBtn } = useClearButton();\n const styledsAttrs = {\n shouldDisplay: withClearBtn,\n };\n const {\n latestInteractionRegion,\n currFocusDescriber,\n getProps,\n props: { tabIndex },\n } = useContext(ControlledDateTimePickerContext);\n\n return (\n <StyledClearButton\n aria-label=\"clear selected date\"\n buttonType=\"icon\"\n size={BUTTON_SIZES.M}\n data-testid={ControlledDateTimePickerDatatestid.CLEAR_BUTTON}\n innerRef={(DomElem: HTMLButtonElement) => {\n clearButtonRef.current = DomElem;\n if (latestInteractionRegion === 'clear-btn' && currFocusDescriber === 'clear-btn') DomElem?.focus?.();\n }}\n tabIndex={tabIndex}\n onClick={onClearClick}\n onKeyDown={onClearButtonKeyDown}\n type=\"button\"\n getOwnerProps={getProps}\n {...styledsAttrs}\n >\n <CloseMedium color={['brand-primary', '600']} />\n </StyledClearButton>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACsCjB;AArCN,SAAgB,kBAAkB;AAClC,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,yBAAyB;AAClC,SAAS,0CAA0C;AACnD,SAAS,uCAAuC;AAChD,SAAS,sBAAsB;AAExB,MAAM,cAAc,MAAmB;AAC5C,QAAM,EAAE,cAAc,sBAAsB,gBAAgB,aAAa,IAAI,eAAe;AAC5F,QAAM,eAAe;AAAA,IACnB,eAAe;AAAA,EACjB;AACA,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,EAAE,SAAS;AAAA,EACpB,IAAI,WAAW,+BAA+B;AAE9C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,cAAW;AAAA,MACX,YAAW;AAAA,MACX,MAAM,aAAa;AAAA,MACnB,eAAa,mCAAmC;AAAA,MAChD,UAAU,CAAC,YAA+B;AACxC,uBAAe,UAAU;AACzB,YAAI,4BAA4B,eAAe,uBAAuB;AAAa,mBAAS,QAAQ;AAAA,MACtG;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACT,WAAW;AAAA,MACX,MAAK;AAAA,MACL,eAAe;AAAA,MACd,GAAG;AAAA,MAEJ,8BAAC,eAAY,OAAO,CAAC,iBAAiB,KAAK,GAAG;AAAA;AAAA,EAChD;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -9,6 +9,7 @@ import { TimeInputs } from "./TimeInputs/TimeInputs.js";
|
|
|
9
9
|
import { PickersIcons } from "./Pickers/PickersIcons.js";
|
|
10
10
|
import { ClearButton } from "./ClearButton/ClearButton.js";
|
|
11
11
|
import { ControlledDateTimePickerDatatestid } from "../ControlledDateTimePickerDatatestid.js";
|
|
12
|
+
import { omit } from "lodash";
|
|
12
13
|
const ControlledDateTimePickerContent = () => {
|
|
13
14
|
const {
|
|
14
15
|
props: { hasError, disabled },
|
|
@@ -54,7 +55,7 @@ const ControlledDateTimePickerContent = () => {
|
|
|
54
55
|
"data-testid": ControlledDateTimePickerDatatestid.CONTAINER,
|
|
55
56
|
getOwnerProps: getProps,
|
|
56
57
|
...styledsAttrs,
|
|
57
|
-
...globalAttrs,
|
|
58
|
+
...omit(globalAttrs, "tabIndex", "autoFocus"),
|
|
58
59
|
...xstyledAttrs,
|
|
59
60
|
children: [
|
|
60
61
|
hideDate ? null : /* @__PURE__ */ jsx(DateInputs, {}),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/ControlledDateTimePickerContent.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { ControlledDateTimePickerContext } from '../ControlledDateTimePickerCTX.js';\nimport { StyledInputsWrapperGrid } from './Styleds.js';\nimport { DateInputs } from './DateInputs/DateInputs.js';\nimport { TimeInputs } from './TimeInputs/TimeInputs.js';\nimport { PickersIcons } from './Pickers/PickersIcons.js';\nimport { ClearButton } from './ClearButton/ClearButton.js';\nimport { ControlledDateTimePickerDatatestid } from '../ControlledDateTimePickerDatatestid.js';\n\nexport const ControlledDateTimePickerContent = (): JSX.Element => {\n const {\n props: { hasError, disabled },\n getProps,\n hideDate,\n hideTime,\n withAnyPicker,\n withAnyRightController,\n shouldPreserveClearableSpace,\n isControllerOnly,\n globalAttrs,\n xstyledAttrs,\n onGlobalKeyDown,\n trackFocusResetter,\n } = useContext(ControlledDateTimePickerContext);\n\n const styledsAttrs = {\n justPicker: hideDate && hideTime,\n withAnyPicker,\n hasError,\n isControllerOnly,\n };\n\n const mainCols = [];\n if (!hideDate) mainCols.push('auto');\n if (!hideTime) mainCols.push('auto');\n if (withAnyRightController) mainCols.push('auto');\n\n const rightControlCols = [];\n if (shouldPreserveClearableSpace) rightControlCols.push('28px');\n if (withAnyPicker) rightControlCols.push('auto');\n\n return (\n <>\n {/* The <div> element is catching the component-wise global hotkeys, there is no valid aria role for this */}\n {/* eslint-disable-next-line max-len */}\n {/* https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md#case-the-event-handler-is-only-being-used-to-capture-bubbled-events */}\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}\n <StyledInputsWrapperGrid\n cols={mainCols}\n gutter=\"xxs\"\n pr={!withAnyRightController ? '2px' : '0px'}\n onKeyDown={onGlobalKeyDown}\n disabled={disabled}\n onBlur={trackFocusResetter}\n data-testid={ControlledDateTimePickerDatatestid.CONTAINER}\n getOwnerProps={getProps}\n {...styledsAttrs}\n {...globalAttrs}\n {...xstyledAttrs}\n >\n {hideDate ? null : <DateInputs />}\n {hideTime ? null : <TimeInputs />}\n {withAnyRightController ? (\n <Grid cols={rightControlCols}>\n {shouldPreserveClearableSpace ? <ClearButton /> : null}\n {withAnyPicker ? <PickersIcons /> : null}\n </Grid>\n ) : null}\n </StyledInputsWrapperGrid>\n </>\n );\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { ControlledDateTimePickerContext } from '../ControlledDateTimePickerCTX.js';\nimport { StyledInputsWrapperGrid } from './Styleds.js';\nimport { DateInputs } from './DateInputs/DateInputs.js';\nimport { TimeInputs } from './TimeInputs/TimeInputs.js';\nimport { PickersIcons } from './Pickers/PickersIcons.js';\nimport { ClearButton } from './ClearButton/ClearButton.js';\nimport { ControlledDateTimePickerDatatestid } from '../ControlledDateTimePickerDatatestid.js';\nimport { omit } from 'lodash';\n\nexport const ControlledDateTimePickerContent = (): JSX.Element => {\n const {\n props: { hasError, disabled },\n getProps,\n hideDate,\n hideTime,\n withAnyPicker,\n withAnyRightController,\n shouldPreserveClearableSpace,\n isControllerOnly,\n globalAttrs,\n xstyledAttrs,\n onGlobalKeyDown,\n trackFocusResetter,\n } = useContext(ControlledDateTimePickerContext);\n\n const styledsAttrs = {\n justPicker: hideDate && hideTime,\n withAnyPicker,\n hasError,\n isControllerOnly,\n };\n\n const mainCols = [];\n if (!hideDate) mainCols.push('auto');\n if (!hideTime) mainCols.push('auto');\n if (withAnyRightController) mainCols.push('auto');\n\n const rightControlCols = [];\n if (shouldPreserveClearableSpace) rightControlCols.push('28px');\n if (withAnyPicker) rightControlCols.push('auto');\n\n return (\n <>\n {/* The <div> element is catching the component-wise global hotkeys, there is no valid aria role for this */}\n {/* eslint-disable-next-line max-len */}\n {/* https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md#case-the-event-handler-is-only-being-used-to-capture-bubbled-events */}\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}\n <StyledInputsWrapperGrid\n cols={mainCols}\n gutter=\"xxs\"\n pr={!withAnyRightController ? '2px' : '0px'}\n onKeyDown={onGlobalKeyDown}\n disabled={disabled}\n onBlur={trackFocusResetter}\n data-testid={ControlledDateTimePickerDatatestid.CONTAINER}\n getOwnerProps={getProps}\n {...styledsAttrs}\n {...omit(globalAttrs, 'tabIndex', 'autoFocus')}\n {...xstyledAttrs}\n >\n {hideDate ? null : <DateInputs />}\n {hideTime ? null : <TimeInputs />}\n {withAnyRightController ? (\n <Grid cols={rightControlCols}>\n {shouldPreserveClearableSpace ? <ClearButton /> : null}\n {withAnyPicker ? <PickersIcons /> : null}\n </Grid>\n ) : null}\n </StyledInputsWrapperGrid>\n </>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC6CnB,mBAkBuB,KAGjB,YArBN;AA5CJ,SAAgB,kBAAkB;AAClC,SAAS,YAAY;AACrB,SAAS,uCAAuC;AAChD,SAAS,+BAA+B;AACxC,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAC5B,SAAS,0CAA0C;AACnD,SAAS,YAAY;AAEd,MAAM,kCAAkC,MAAmB;AAChE,QAAM;AAAA,IACJ,OAAO,EAAE,UAAU,SAAS;AAAA,IAC5B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,+BAA+B;AAE9C,QAAM,eAAe;AAAA,IACnB,YAAY,YAAY;AAAA,IACxB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,WAAW,CAAC;AAClB,MAAI,CAAC;AAAU,aAAS,KAAK,MAAM;AACnC,MAAI,CAAC;AAAU,aAAS,KAAK,MAAM;AACnC,MAAI;AAAwB,aAAS,KAAK,MAAM;AAEhD,QAAM,mBAAmB,CAAC;AAC1B,MAAI;AAA8B,qBAAiB,KAAK,MAAM;AAC9D,MAAI;AAAe,qBAAiB,KAAK,MAAM;AAE/C,SACE,gCAKE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,MACN,QAAO;AAAA,MACP,IAAI,CAAC,yBAAyB,QAAQ;AAAA,MACtC,WAAW;AAAA,MACX;AAAA,MACA,QAAQ;AAAA,MACR,eAAa,mCAAmC;AAAA,MAChD,eAAe;AAAA,MACd,GAAG;AAAA,MACH,GAAG,KAAK,aAAa,YAAY,WAAW;AAAA,MAC5C,GAAG;AAAA,MAEH;AAAA,mBAAW,OAAO,oBAAC,cAAW;AAAA,QAC9B,WAAW,OAAO,oBAAC,cAAW;AAAA,QAC9B,yBACC,qBAAC,QAAK,MAAM,kBACT;AAAA,yCAA+B,oBAAC,eAAY,IAAK;AAAA,UACjD,gBAAgB,oBAAC,gBAAa,IAAK;AAAA,WACtC,IACE;AAAA;AAAA;AAAA,EACN,GACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -19,6 +19,7 @@ const DDInput = React2.memo(
|
|
|
19
19
|
value,
|
|
20
20
|
disabled,
|
|
21
21
|
contextRef,
|
|
22
|
+
tabIndex,
|
|
22
23
|
placeholder,
|
|
23
24
|
ariaCurrentValueForInputs,
|
|
24
25
|
isFocused,
|
|
@@ -47,6 +48,7 @@ const DDInput = React2.memo(
|
|
|
47
48
|
if (isFocused)
|
|
48
49
|
DomElem?.focus?.();
|
|
49
50
|
},
|
|
51
|
+
tabIndex,
|
|
50
52
|
placeholder,
|
|
51
53
|
"aria-label": `day input field, ${ariaCurrentValueForInputs}`,
|
|
52
54
|
"data-testid": ControlledDateTimePickerDatatestid.DATE_INPUTS.DAY,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DateInputs/DDInput.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid.js';\nimport { StyledDateInput } from '../Styleds.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\nimport type { ControlledDateTimePickerContextT } from '../../config/useControlledDateTimePicker.js';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidDay = (day: string) => {\n if (day === '') return false;\n const numberOnly = regExpNumbers.test(day);\n return day.length > 2 || day === '00' || !numberOnly || Number.parseInt(day, 10) > 31;\n};\n\ninterface DDInputsPropsT {\n onChange: DSControlledDateTimePickerInternalsT.OnChangeFunc;\n onBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc;\n onFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc;\n onKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown;\n value: string;\n disabled: boolean;\n placeholder: string;\n ariaCurrentValueForInputs: string;\n contextRef: React.MutableRefObject<HTMLInputElement | null>;\n isFocused: boolean;\n getProps: ControlledDateTimePickerContextT['getProps'];\n}\nexport const DDInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n contextRef,\n placeholder,\n ariaCurrentValueForInputs,\n isFocused,\n getProps,\n }: DDInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidDay(e?.currentTarget?.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n return (\n <StyledDateInput\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n innerRef={(DomElem: HTMLInputElement) => {\n (contextRef as React.MutableRefObject<HTMLInputElement>).current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n placeholder={placeholder}\n aria-label={`day input field, ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.DATE_INPUTS.DAY}\n disabled={disabled}\n aria-disabled={disabled}\n getOwnerProps={getProps}\n />\n );\n },\n);\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid.js';\nimport { StyledDateInput } from '../Styleds.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\nimport type { ControlledDateTimePickerContextT } from '../../config/useControlledDateTimePicker.js';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidDay = (day: string) => {\n if (day === '') return false;\n const numberOnly = regExpNumbers.test(day);\n return day.length > 2 || day === '00' || !numberOnly || Number.parseInt(day, 10) > 31;\n};\n\ninterface DDInputsPropsT {\n onChange: DSControlledDateTimePickerInternalsT.OnChangeFunc;\n onBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc;\n onFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc;\n onKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown;\n value: string;\n disabled: boolean;\n placeholder: string;\n ariaCurrentValueForInputs: string;\n contextRef: React.MutableRefObject<HTMLInputElement | null>;\n tabIndex?: WCAGTabIndex;\n isFocused: boolean;\n getProps: ControlledDateTimePickerContextT['getProps'];\n}\nexport const DDInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n contextRef,\n tabIndex,\n placeholder,\n ariaCurrentValueForInputs,\n isFocused,\n getProps,\n }: DDInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidDay(e?.currentTarget?.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n return (\n <StyledDateInput\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n innerRef={(DomElem: HTMLInputElement) => {\n (contextRef as React.MutableRefObject<HTMLInputElement>).current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n tabIndex={tabIndex}\n placeholder={placeholder}\n aria-label={`day input field, ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.DATE_INPUTS.DAY}\n disabled={disabled}\n aria-disabled={disabled}\n getOwnerProps={getProps}\n />\n );\n },\n);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACqDjB;AArDN,OAAOA,UAAS,mBAAmB;AACnC,SAAS,0CAA0C;AACnD,SAAS,uBAAuB;AAIhC,MAAM,gBAAgB;AACtB,MAAM,eAAe,CAAC,QAAgB;AACpC,MAAI,QAAQ;AAAI,WAAO;AACvB,QAAM,aAAa,cAAc,KAAK,GAAG;AACzC,SAAO,IAAI,SAAS,KAAK,QAAQ,QAAQ,CAAC,cAAc,OAAO,SAAS,KAAK,EAAE,IAAI;AACrF;AAgBO,MAAM,UAAUA,OAAM;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,EACF,MAAmC;AACjC,UAAM,mBAAmB;AAAA,MACvB,CAAC,MAA2C;AAC1C,YAAI,aAAa,GAAG,eAAe,KAAK,GAAG;AACzC,YAAE,eAAe;AACjB;AAAA,QACF;AACA,iBAAS,CAAC;AAAA,MACZ;AAAA,MACA,CAAC,QAAQ;AAAA,IACX;AACA,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;AAAW,qBAAS,QAAQ;AAAA,QAClC;AAAA,QACA;AAAA,QACA;AAAA,QACA,cAAY,oBAAoB;AAAA,QAChC,eAAa,mCAAmC,YAAY;AAAA,QAC5D;AAAA,QACA,iBAAe;AAAA,QACf,eAAe;AAAA;AAAA,IACjB;AAAA,EAEJ;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -37,7 +37,8 @@ const DateInputs = () => {
|
|
|
37
37
|
ariaCurrentValueForInputs,
|
|
38
38
|
latestInteractionRegion,
|
|
39
39
|
currFocusDescriber,
|
|
40
|
-
getProps
|
|
40
|
+
getProps,
|
|
41
|
+
props: { tabIndex }
|
|
41
42
|
} = useContext(ControlledDateTimePickerContext);
|
|
42
43
|
return /* @__PURE__ */ jsxs(
|
|
43
44
|
Grid,
|
|
@@ -60,6 +61,7 @@ const DateInputs = () => {
|
|
|
60
61
|
value: month,
|
|
61
62
|
contextRef: monthInputRef,
|
|
62
63
|
innerRef: innerRefMonthInput,
|
|
64
|
+
tabIndex,
|
|
63
65
|
autoFocusMonthInput,
|
|
64
66
|
placeholder: "MM",
|
|
65
67
|
ariaCurrentValueForInputs,
|
|
@@ -78,6 +80,7 @@ const DateInputs = () => {
|
|
|
78
80
|
onKeyDown: onDayKeyDown,
|
|
79
81
|
value: day,
|
|
80
82
|
contextRef: dayInputRef,
|
|
83
|
+
tabIndex,
|
|
81
84
|
placeholder: "DD",
|
|
82
85
|
ariaCurrentValueForInputs,
|
|
83
86
|
disabled,
|
|
@@ -95,6 +98,7 @@ const DateInputs = () => {
|
|
|
95
98
|
onKeyDown: onYearKeyDown,
|
|
96
99
|
value: year,
|
|
97
100
|
contextRef: yearInputRef,
|
|
101
|
+
tabIndex,
|
|
98
102
|
placeholder: "YYYY",
|
|
99
103
|
ariaCurrentValueForInputs,
|
|
100
104
|
disabled,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DateInputs/DateInputs.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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 } = 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 ariaCurrentValueForInputs,\n latestInteractionRegion,\n currFocusDescriber,\n getProps,\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 autoFocusMonthInput={autoFocusMonthInput}\n placeholder=\"MM\"\n ariaCurrentValueForInputs={ariaCurrentValueForInputs}\n disabled={disabled}\n isFocused={latestInteractionRegion === 'date-inputs' && currFocusDescriber === 'month-input'}\n getProps={getProps}\n />\n </StyledFocusWithIn>\n <StyledSeparator alignItems=\"center\">/</StyledSeparator>\n <StyledFocusWithIn>\n <DDInput\n onChange={onDayChange}\n onBlur={onDayBlur}\n onFocus={onDayFocus}\n onKeyDown={onDayKeyDown}\n value={day}\n contextRef={dayInputRef}\n placeholder=\"DD\"\n ariaCurrentValueForInputs={ariaCurrentValueForInputs}\n disabled={disabled}\n isFocused={latestInteractionRegion === 'date-inputs' && currFocusDescriber === 'day-input'}\n getProps={getProps}\n />\n </StyledFocusWithIn>\n <StyledSeparator alignItems=\"center\">/</StyledSeparator>\n <StyledFocusWithIn>\n <YYYYInput\n onChange={onYearChange}\n onBlur={onYearBlur}\n onFocus={onYearFocus}\n onKeyDown={onYearKeyDown}\n value={year}\n contextRef={yearInputRef}\n placeholder=\"YYYY\"\n ariaCurrentValueForInputs={ariaCurrentValueForInputs}\n disabled={disabled}\n isFocused={latestInteractionRegion === 'date-inputs' && currFocusDescriber === 'year-input'}\n getProps={getProps}\n />\n </StyledFocusWithIn>\n </Grid>\n );\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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 } = 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 ariaCurrentValueForInputs,\n latestInteractionRegion,\n currFocusDescriber,\n getProps,\n props: { tabIndex },\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 ariaCurrentValueForInputs={ariaCurrentValueForInputs}\n disabled={disabled}\n isFocused={latestInteractionRegion === 'date-inputs' && currFocusDescriber === 'month-input'}\n getProps={getProps}\n />\n </StyledFocusWithIn>\n <StyledSeparator alignItems=\"center\">/</StyledSeparator>\n <StyledFocusWithIn>\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 ariaCurrentValueForInputs={ariaCurrentValueForInputs}\n disabled={disabled}\n isFocused={latestInteractionRegion === 'date-inputs' && currFocusDescriber === 'day-input'}\n getProps={getProps}\n />\n </StyledFocusWithIn>\n <StyledSeparator alignItems=\"center\">/</StyledSeparator>\n <StyledFocusWithIn>\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 ariaCurrentValueForInputs={ariaCurrentValueForInputs}\n disabled={disabled}\n isFocused={latestInteractionRegion === 'date-inputs' && currFocusDescriber === 'year-input'}\n getProps={getProps}\n />\n </StyledFocusWithIn>\n </Grid>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC4CnB,SAUI,KAVJ;AA5CJ,SAAgB,kBAAkB;AAClC,SAAS,YAAY;AACrB,SAAS,uCAAuC;AAChD,SAAS,eAAe;AACxB,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB,uBAAuB;AACnD,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;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,EACF,IAAI,cAAc;AAElB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,EAAE,SAAS;AAAA,EACpB,IAAI,WAAW,+BAA+B;AAE9C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,QACJ,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,YAAY;AAAA,MACd;AAAA,MAEA;AAAA,4BAAC,qBACC;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,WAAW;AAAA,YACX,OAAO;AAAA,YACP,YAAY;AAAA,YACZ,UAAU;AAAA,YACV;AAAA,YACA;AAAA,YACA,aAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACA,WAAW,4BAA4B,iBAAiB,uBAAuB;AAAA,YAC/E;AAAA;AAAA,QACF,GACF;AAAA,QACA,oBAAC,mBAAgB,YAAW,UAAS,eAAC;AAAA,QACtC,oBAAC,qBACC;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,WAAW;AAAA,YACX,OAAO;AAAA,YACP,YAAY;AAAA,YACZ;AAAA,YACA,aAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACA,WAAW,4BAA4B,iBAAiB,uBAAuB;AAAA,YAC/E;AAAA;AAAA,QACF,GACF;AAAA,QACA,oBAAC,mBAAgB,YAAW,UAAS,eAAC;AAAA,QACtC,oBAAC,qBACC;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,WAAW;AAAA,YACX,OAAO;AAAA,YACP,YAAY;AAAA,YACZ;AAAA,YACA,aAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACA,WAAW,4BAA4B,iBAAiB,uBAAuB;AAAA,YAC/E;AAAA;AAAA,QACF,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -22,6 +22,7 @@ const MMInput = React2.memo(
|
|
|
22
22
|
placeholder,
|
|
23
23
|
contextRef,
|
|
24
24
|
innerRef,
|
|
25
|
+
tabIndex,
|
|
25
26
|
autoFocusMonthInput,
|
|
26
27
|
ariaCurrentValueForInputs,
|
|
27
28
|
isFocused,
|
|
@@ -61,6 +62,7 @@ const MMInput = React2.memo(
|
|
|
61
62
|
onKeyDown,
|
|
62
63
|
value,
|
|
63
64
|
innerRef: currentRef,
|
|
65
|
+
tabIndex,
|
|
64
66
|
placeholder,
|
|
65
67
|
"aria-label": `month input field, ${ariaCurrentValueForInputs}`,
|
|
66
68
|
"data-testid": ControlledDateTimePickerDatatestid.DATE_INPUTS.MONTH,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DateInputs/MMInput.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useMemo } from 'react';\nimport { setMultipleRefs } from '@elliemae/ds-utilities';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid.js';\nimport { StyledMonthInput } from '../Styleds.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\nimport type { ControlledDateTimePickerContextT } from '../../config/useControlledDateTimePicker.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 contextRef: React.MutableRefObject<HTMLInputElement | null>;\n placeholder: string;\n ariaCurrentValueForInputs: string;\n isFocused: boolean;\n innerRef?:\n | React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null>\n | ((ref: HTMLInputElement | HTMLButtonElement | null) => void);\n getProps: ControlledDateTimePickerContextT['getProps'];\n}\nexport const MMInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n placeholder,\n contextRef,\n innerRef,\n autoFocusMonthInput,\n ariaCurrentValueForInputs,\n isFocused,\n getProps,\n }: MMInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidMonth(e?.target?.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n\n const handleRef = useCallback(\n (DomElem: HTMLInputElement) => {\n (contextRef as React.MutableRefObject<HTMLInputElement>).current = DomElem;\n if (isFocused) DomElem?.focus?.();\n },\n [contextRef, isFocused],\n );\n\n const currentRef = useMemo(() => {\n if (innerRef) {\n return setMultipleRefs([handleRef, innerRef]);\n }\n return handleRef;\n }, [handleRef, innerRef]);\n\n return (\n <StyledMonthInput\n autoFocus={autoFocusMonthInput}\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n innerRef={currentRef}\n placeholder={placeholder}\n aria-label={`month input field, ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.DATE_INPUTS.MONTH}\n disabled={disabled}\n aria-disabled={disabled}\n getOwnerProps={getProps}\n />\n );\n },\n);\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useMemo } from 'react';\nimport { setMultipleRefs } from '@elliemae/ds-utilities';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid.js';\nimport { StyledMonthInput } from '../Styleds.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\nimport type { ControlledDateTimePickerContextT } from '../../config/useControlledDateTimePicker.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 contextRef: React.MutableRefObject<HTMLInputElement | null>;\n placeholder: string;\n ariaCurrentValueForInputs: string;\n isFocused: boolean;\n innerRef?:\n | React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null>\n | ((ref: HTMLInputElement | HTMLButtonElement | null) => void);\n tabIndex?: WCAGTabIndex;\n getProps: ControlledDateTimePickerContextT['getProps'];\n}\nexport const MMInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n placeholder,\n contextRef,\n innerRef,\n tabIndex,\n autoFocusMonthInput,\n ariaCurrentValueForInputs,\n isFocused,\n getProps,\n }: MMInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidMonth(e?.target?.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n\n const handleRef = useCallback(\n (DomElem: HTMLInputElement) => {\n (contextRef as React.MutableRefObject<HTMLInputElement>).current = DomElem;\n if (isFocused) DomElem?.focus?.();\n },\n [contextRef, isFocused],\n );\n\n const currentRef = useMemo(() => {\n if (innerRef) {\n return setMultipleRefs([handleRef, innerRef]);\n }\n return handleRef;\n }, [handleRef, innerRef]);\n\n return (\n <StyledMonthInput\n autoFocus={autoFocusMonthInput}\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n innerRef={currentRef}\n tabIndex={tabIndex}\n placeholder={placeholder}\n aria-label={`month input field, ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.DATE_INPUTS.MONTH}\n disabled={disabled}\n aria-disabled={disabled}\n getOwnerProps={getProps}\n />\n );\n },\n);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC2EjB;AA3EN,OAAOA,UAAS,aAAa,eAAe;AAC5C,SAAS,uBAAuB;AAChC,SAAS,0CAA0C;AACnD,SAAS,wBAAwB;AAIjC,MAAM,gBAAgB;AACtB,MAAM,iBAAiB,CAAC,UAAkB;AACxC,MAAI,UAAU;AAAI,WAAO;AACzB,QAAM,aAAa,cAAc,KAAK,KAAK;AAC3C,SAAO,MAAM,SAAS,KAAK,UAAU,QAAQ,CAAC,cAAc,OAAO,SAAS,OAAO,EAAE,IAAI;AAC3F;AAmBO,MAAM,UAAUA,OAAM;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,EACF,MAAmC;AACjC,UAAM,mBAAmB;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,YAAY;AAAA,MAChB,CAAC,YAA8B;AAC7B,QAAC,WAAwD,UAAU;AACnE,YAAI;AAAW,mBAAS,QAAQ;AAAA,MAClC;AAAA,MACA,CAAC,YAAY,SAAS;AAAA,IACxB;AAEA,UAAM,aAAa,QAAQ,MAAM;AAC/B,UAAI,UAAU;AACZ,eAAO,gBAAgB,CAAC,WAAW,QAAQ,CAAC;AAAA,MAC9C;AACA,aAAO;AAAA,IACT,GAAG,CAAC,WAAW,QAAQ,CAAC;AAExB,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,cAAY,sBAAsB;AAAA,QAClC,eAAa,mCAAmC,YAAY;AAAA,QAC5D;AAAA,QACA,iBAAe;AAAA,QACf,eAAe;AAAA;AAAA,IACjB;AAAA,EAEJ;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -20,6 +20,7 @@ const YYYYInput = React2.memo(
|
|
|
20
20
|
disabled,
|
|
21
21
|
placeholder,
|
|
22
22
|
contextRef,
|
|
23
|
+
tabIndex,
|
|
23
24
|
ariaCurrentValueForInputs,
|
|
24
25
|
isFocused,
|
|
25
26
|
getProps
|
|
@@ -47,6 +48,7 @@ const YYYYInput = React2.memo(
|
|
|
47
48
|
if (isFocused)
|
|
48
49
|
DomElem?.focus?.();
|
|
49
50
|
},
|
|
51
|
+
tabIndex,
|
|
50
52
|
"data-testid": ControlledDateTimePickerDatatestid.DATE_INPUTS.YEAR,
|
|
51
53
|
placeholder,
|
|
52
54
|
"aria-label": `year input field, ${ariaCurrentValueForInputs}`,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DateInputs/YYYYInput.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { StyledYearInput } from '../Styleds.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\nimport type { ControlledDateTimePickerContextT } from '../../config/useControlledDateTimePicker.js';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid.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 contextRef: React.MutableRefObject<HTMLInputElement | null>;\n placeholder: string;\n ariaCurrentValueForInputs: string;\n isFocused: boolean;\n getProps: ControlledDateTimePickerContextT['getProps'];\n}\nexport const YYYYInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n placeholder,\n contextRef,\n ariaCurrentValueForInputs,\n isFocused,\n getProps,\n }: YYYYInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidYear(e?.currentTarget?.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n return (\n <StyledYearInput\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n innerRef={(DomElem: HTMLInputElement) => {\n (contextRef as React.MutableRefObject<HTMLInputElement>).current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n data-testid={ControlledDateTimePickerDatatestid.DATE_INPUTS.YEAR}\n placeholder={placeholder}\n aria-label={`year input field, ${ariaCurrentValueForInputs}`}\n disabled={disabled}\n aria-disabled={disabled}\n getOwnerProps={getProps}\n />\n );\n },\n);\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { StyledYearInput } from '../Styleds.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\nimport type { ControlledDateTimePickerContextT } from '../../config/useControlledDateTimePicker.js';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid.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 contextRef: React.MutableRefObject<HTMLInputElement | null>;\n tabIndex?: WCAGTabIndex;\n placeholder: string;\n ariaCurrentValueForInputs: string;\n isFocused: boolean;\n getProps: ControlledDateTimePickerContextT['getProps'];\n}\nexport const YYYYInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n placeholder,\n contextRef,\n tabIndex,\n ariaCurrentValueForInputs,\n isFocused,\n getProps,\n }: YYYYInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidYear(e?.currentTarget?.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n return (\n <StyledYearInput\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n innerRef={(DomElem: HTMLInputElement) => {\n (contextRef as React.MutableRefObject<HTMLInputElement>).current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n tabIndex={tabIndex}\n data-testid={ControlledDateTimePickerDatatestid.DATE_INPUTS.YEAR}\n placeholder={placeholder}\n aria-label={`year input field, ${ariaCurrentValueForInputs}`}\n disabled={disabled}\n aria-disabled={disabled}\n getOwnerProps={getProps}\n />\n );\n },\n);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACoDjB;AApDN,OAAOA,UAAS,mBAAmB;AACnC,SAAS,uBAAuB;AAGhC,SAAS,0CAA0C;AACnD,MAAM,gBAAgB;AACtB,MAAM,gBAAgB,CAAC,SAAiB;AACtC,MAAI,SAAS;AAAI,WAAO;AACxB,QAAM,aAAa,cAAc,KAAK,IAAI;AAC1C,SAAO,KAAK,SAAS,KAAK,CAAC,cAAc,OAAO,SAAS,MAAM,EAAE,IAAI;AACvE;AAgBO,MAAM,YAAYA,OAAM;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,EACF,MAAqC;AACnC,UAAM,mBAAmB;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;AACA,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;AAAW,qBAAS,QAAQ;AAAA,QAClC;AAAA,QACA;AAAA,QACA,eAAa,mCAAmC,YAAY;AAAA,QAC5D;AAAA,QACA,cAAY,qBAAqB;AAAA,QACjC;AAAA,QACA,iBAAe;AAAA,QACf,eAAe;AAAA;AAAA,IACjB;AAAA,EAEJ;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -10,7 +10,7 @@ import { StyledIconTriggerButton } from "./Styleds.js";
|
|
|
10
10
|
const CalendarIconTrigger = () => {
|
|
11
11
|
const { handleToggleCalendar, handleSetTriggerRef, handlePickerIconKeyDown } = useContext(CalendarContext);
|
|
12
12
|
const {
|
|
13
|
-
props: { disabled },
|
|
13
|
+
props: { disabled, tabIndex },
|
|
14
14
|
getProps,
|
|
15
15
|
ariaCurrentValueForInputs
|
|
16
16
|
} = useContext(ControlledDateTimePickerContext);
|
|
@@ -22,6 +22,7 @@ const CalendarIconTrigger = () => {
|
|
|
22
22
|
buttonType: "icon",
|
|
23
23
|
size: BUTTON_SIZES.M,
|
|
24
24
|
innerRef: handleSetTriggerRef,
|
|
25
|
+
tabIndex,
|
|
25
26
|
onClick: handleToggleCalendar,
|
|
26
27
|
onKeyDown: handlePickerIconKeyDown,
|
|
27
28
|
"data-testid": ControlledDateTimePickerDatatestid.PICKER_ICONS.CALENDAR,
|
|
@@ -31,7 +32,15 @@ const CalendarIconTrigger = () => {
|
|
|
31
32
|
children: /* @__PURE__ */ jsx(DatePicker, {})
|
|
32
33
|
}
|
|
33
34
|
),
|
|
34
|
-
[
|
|
35
|
+
[
|
|
36
|
+
ariaCurrentValueForInputs,
|
|
37
|
+
handleSetTriggerRef,
|
|
38
|
+
tabIndex,
|
|
39
|
+
handleToggleCalendar,
|
|
40
|
+
handlePickerIconKeyDown,
|
|
41
|
+
disabled,
|
|
42
|
+
getProps
|
|
43
|
+
]
|
|
35
44
|
);
|
|
36
45
|
};
|
|
37
46
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/Pickers/Calendar/CalendarIconTrigger.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext, useMemo } from 'react';\nimport { BUTTON_SIZES } from '@elliemae/ds-button-v2';\nimport { DatePicker } from '@elliemae/ds-icons';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { CalendarContext } from './CalendarContext.js';\nimport { StyledIconTriggerButton } from './Styleds.js';\n// we memoize the Icon for maximum optimization\n// this is particularly usefull due to how usePopper needs to check the references\n// since references are saved in a immutable way, we make sure to shortcircuit useless-re-renders\nexport const CalendarIconTrigger = (): JSX.Element => {\n const { handleToggleCalendar, handleSetTriggerRef, handlePickerIconKeyDown } = useContext(CalendarContext);\n const {\n props: { disabled },\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 onClick={handleToggleCalendar}\n onKeyDown={handlePickerIconKeyDown}\n data-testid={ControlledDateTimePickerDatatestid.PICKER_ICONS.CALENDAR}\n disabled={disabled}\n type=\"button\"\n getOwnerProps={getProps}\n >\n <DatePicker />\n </StyledIconTriggerButton>\n ),\n [ariaCurrentValueForInputs
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext, useMemo } from 'react';\nimport { BUTTON_SIZES } from '@elliemae/ds-button-v2';\nimport { DatePicker } from '@elliemae/ds-icons';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { CalendarContext } from './CalendarContext.js';\nimport { StyledIconTriggerButton } from './Styleds.js';\n// we memoize the Icon for maximum optimization\n// this is particularly usefull due to how usePopper needs to check the references\n// since references are saved in a immutable way, we make sure to shortcircuit useless-re-renders\nexport const CalendarIconTrigger = (): JSX.Element => {\n const { handleToggleCalendar, handleSetTriggerRef, handlePickerIconKeyDown } = useContext(CalendarContext);\n const {\n props: { disabled, tabIndex },\n getProps,\n ariaCurrentValueForInputs,\n } = useContext(ControlledDateTimePickerContext);\n return useMemo(\n () => (\n <StyledIconTriggerButton\n aria-label={`date picker context menu trigger, ${ariaCurrentValueForInputs}`}\n buttonType=\"icon\"\n size={BUTTON_SIZES.M}\n innerRef={handleSetTriggerRef}\n tabIndex={tabIndex}\n onClick={handleToggleCalendar}\n onKeyDown={handlePickerIconKeyDown}\n data-testid={ControlledDateTimePickerDatatestid.PICKER_ICONS.CALENDAR}\n disabled={disabled}\n type=\"button\"\n getOwnerProps={getProps}\n >\n <DatePicker />\n </StyledIconTriggerButton>\n ),\n [\n ariaCurrentValueForInputs,\n handleSetTriggerRef,\n tabIndex,\n handleToggleCalendar,\n handlePickerIconKeyDown,\n disabled,\n getProps,\n ],\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACgCf;AAhCR,SAAgB,YAAY,eAAe;AAC3C,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,0CAA0C;AACnD,SAAS,uCAAuC;AAChD,SAAS,uBAAuB;AAChC,SAAS,+BAA+B;AAIjC,MAAM,sBAAsB,MAAmB;AACpD,QAAM,EAAE,sBAAsB,qBAAqB,wBAAwB,IAAI,WAAW,eAAe;AACzG,QAAM;AAAA,IACJ,OAAO,EAAE,UAAU,SAAS;AAAA,IAC5B;AAAA,IACA;AAAA,EACF,IAAI,WAAW,+BAA+B;AAC9C,SAAO;AAAA,IACL,MACE;AAAA,MAAC;AAAA;AAAA,QACC,cAAY,qCAAqC;AAAA,QACjD,YAAW;AAAA,QACX,MAAM,aAAa;AAAA,QACnB,UAAU;AAAA,QACV;AAAA,QACA,SAAS;AAAA,QACT,WAAW;AAAA,QACX,eAAa,mCAAmC,aAAa;AAAA,QAC7D;AAAA,QACA,MAAK;AAAA,QACL,eAAe;AAAA,QAEf,8BAAC,cAAW;AAAA;AAAA,IACd;AAAA,IAEF;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -15,7 +15,10 @@ const CalendarWithTimeWheelIconTrigger = () => {
|
|
|
15
15
|
ariaCurrentValueForInputs,
|
|
16
16
|
disabled
|
|
17
17
|
} = useContext(CalendarWithTimeWheelContext);
|
|
18
|
-
const {
|
|
18
|
+
const {
|
|
19
|
+
getProps,
|
|
20
|
+
props: { tabIndex }
|
|
21
|
+
} = useContext(ControlledDateTimePickerContext);
|
|
19
22
|
return useMemo(
|
|
20
23
|
() => /* @__PURE__ */ jsx(
|
|
21
24
|
StyledIconTriggerButton,
|
|
@@ -25,6 +28,7 @@ const CalendarWithTimeWheelIconTrigger = () => {
|
|
|
25
28
|
type: "button",
|
|
26
29
|
size: BUTTON_SIZES.M,
|
|
27
30
|
innerRef: handleSetTriggerRef,
|
|
31
|
+
tabIndex,
|
|
28
32
|
onClick: handleToggleCalendarWithTimeWheel,
|
|
29
33
|
onKeyDown: handlePickerIconKeyDown,
|
|
30
34
|
"data-testid": ControlledDateTimePickerDatatestid.PICKER_ICONS.CALENDAR_TIMEWHEEL,
|
|
@@ -39,7 +43,8 @@ const CalendarWithTimeWheelIconTrigger = () => {
|
|
|
39
43
|
getProps,
|
|
40
44
|
handlePickerIconKeyDown,
|
|
41
45
|
handleSetTriggerRef,
|
|
42
|
-
handleToggleCalendarWithTimeWheel
|
|
46
|
+
handleToggleCalendarWithTimeWheel,
|
|
47
|
+
tabIndex
|
|
43
48
|
]
|
|
44
49
|
);
|
|
45
50
|
};
|
package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext, useMemo } from 'react';\nimport { BUTTON_SIZES } from '@elliemae/ds-button-v2';\nimport { DatePicker } from '@elliemae/ds-icons';\nimport { CalendarWithTimeWheelContext } from './CalendarWithTimeWheelContext.js';\nimport { StyledIconTriggerButton } from './Styleds.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid.js';\n\n// we memoize the Icon for maximum optimization\n// this is particularly useful 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 CalendarWithTimeWheelIconTrigger = (): JSX.Element => {\n const {\n handleSetTriggerRef,\n handleToggleCalendarWithTimeWheel,\n handlePickerIconKeyDown,\n ariaCurrentValueForInputs,\n disabled,\n } = useContext(CalendarWithTimeWheelContext);\n const {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext, useMemo } from 'react';\nimport { BUTTON_SIZES } from '@elliemae/ds-button-v2';\nimport { DatePicker } from '@elliemae/ds-icons';\nimport { CalendarWithTimeWheelContext } from './CalendarWithTimeWheelContext.js';\nimport { StyledIconTriggerButton } from './Styleds.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid.js';\n\n// we memoize the Icon for maximum optimization\n// this is particularly useful 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 CalendarWithTimeWheelIconTrigger = (): JSX.Element => {\n const {\n handleSetTriggerRef,\n handleToggleCalendarWithTimeWheel,\n handlePickerIconKeyDown,\n ariaCurrentValueForInputs,\n disabled,\n } = useContext(CalendarWithTimeWheelContext);\n const {\n getProps,\n props: { tabIndex },\n } = useContext(ControlledDateTimePickerContext);\n return useMemo(\n () => (\n <StyledIconTriggerButton\n aria-label={`date time picker context menu trigger, ${ariaCurrentValueForInputs}`}\n buttonType=\"icon\"\n type=\"button\"\n size={BUTTON_SIZES.M}\n innerRef={handleSetTriggerRef}\n tabIndex={tabIndex}\n onClick={handleToggleCalendarWithTimeWheel}\n onKeyDown={handlePickerIconKeyDown}\n data-testid={ControlledDateTimePickerDatatestid.PICKER_ICONS.CALENDAR_TIMEWHEEL}\n disabled={disabled}\n getOwnerProps={getProps}\n >\n <DatePicker />\n </StyledIconTriggerButton>\n ),\n [\n ariaCurrentValueForInputs,\n disabled,\n getProps,\n handlePickerIconKeyDown,\n handleSetTriggerRef,\n handleToggleCalendarWithTimeWheel,\n tabIndex,\n ],\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACsCf;AAtCR,SAAgB,YAAY,eAAe;AAC3C,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,oCAAoC;AAC7C,SAAS,+BAA+B;AACxC,SAAS,uCAAuC;AAChD,SAAS,0CAA0C;AAK5C,MAAM,mCAAmC,MAAmB;AACjE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,4BAA4B;AAC3C,QAAM;AAAA,IACJ;AAAA,IACA,OAAO,EAAE,SAAS;AAAA,EACpB,IAAI,WAAW,+BAA+B;AAC9C,SAAO;AAAA,IACL,MACE;AAAA,MAAC;AAAA;AAAA,QACC,cAAY,0CAA0C;AAAA,QACtD,YAAW;AAAA,QACX,MAAK;AAAA,QACL,MAAM,aAAa;AAAA,QACnB,UAAU;AAAA,QACV;AAAA,QACA,SAAS;AAAA,QACT,WAAW;AAAA,QACX,eAAa,mCAAmC,aAAa;AAAA,QAC7D;AAAA,QACA,eAAe;AAAA,QAEf,8BAAC,cAAW;AAAA;AAAA,IACd;AAAA,IAEF;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -10,7 +10,7 @@ import { StyledIconTriggerButton } from "./Styleds.js";
|
|
|
10
10
|
const TimeWheelIconTrigger = () => {
|
|
11
11
|
const { handleSetTriggerRef, handleToggleTimePicker, handlePickerIconKeyDown } = useContext(TimeWheelContext);
|
|
12
12
|
const {
|
|
13
|
-
props: { disabled },
|
|
13
|
+
props: { disabled, tabIndex },
|
|
14
14
|
getProps,
|
|
15
15
|
ariaCurrentValueForInputs
|
|
16
16
|
} = useContext(ControlledDateTimePickerContext);
|
|
@@ -22,6 +22,7 @@ const TimeWheelIconTrigger = () => {
|
|
|
22
22
|
buttonType: "icon",
|
|
23
23
|
size: BUTTON_SIZES.M,
|
|
24
24
|
innerRef: handleSetTriggerRef,
|
|
25
|
+
tabIndex,
|
|
25
26
|
onClick: handleToggleTimePicker,
|
|
26
27
|
onKeyDown: handlePickerIconKeyDown,
|
|
27
28
|
"data-testid": ControlledDateTimePickerDatatestid.PICKER_ICONS.TIMEWHEEL,
|
|
@@ -37,7 +38,8 @@ const TimeWheelIconTrigger = () => {
|
|
|
37
38
|
getProps,
|
|
38
39
|
handlePickerIconKeyDown,
|
|
39
40
|
handleSetTriggerRef,
|
|
40
|
-
handleToggleTimePicker
|
|
41
|
+
handleToggleTimePicker,
|
|
42
|
+
tabIndex
|
|
41
43
|
]
|
|
42
44
|
);
|
|
43
45
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/Pickers/TimeWheel/TimeWheelIconTrigger.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext, useMemo } from 'react';\nimport { BUTTON_SIZES } from '@elliemae/ds-button-v2';\nimport { RecentDocuments } from '@elliemae/ds-icons';\nimport { TimeWheelContext } from './TimeWheelContext.js';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { StyledIconTriggerButton } from './Styleds.js';\n\n// we memoize the Icon for maximum optimization\n// this is particularly useful 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 TimeWheelIconTrigger = (): JSX.Element => {\n const { handleSetTriggerRef, handleToggleTimePicker, handlePickerIconKeyDown } = useContext(TimeWheelContext);\n const {\n props: { disabled },\n getProps,\n ariaCurrentValueForInputs,\n } = useContext(ControlledDateTimePickerContext);\n return useMemo(\n () => (\n <StyledIconTriggerButton\n aria-label={`time picker context menu trigger, ${ariaCurrentValueForInputs}`}\n buttonType=\"icon\"\n size={BUTTON_SIZES.M}\n innerRef={handleSetTriggerRef}\n onClick={handleToggleTimePicker}\n onKeyDown={handlePickerIconKeyDown}\n data-testid={ControlledDateTimePickerDatatestid.PICKER_ICONS.TIMEWHEEL}\n disabled={disabled}\n type=\"button\"\n getOwnerProps={getProps}\n >\n <RecentDocuments />\n </StyledIconTriggerButton>\n ),\n [\n ariaCurrentValueForInputs,\n disabled,\n getProps,\n handlePickerIconKeyDown,\n handleSetTriggerRef,\n handleToggleTimePicker,\n ],\n );\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext, useMemo } from 'react';\nimport { BUTTON_SIZES } from '@elliemae/ds-button-v2';\nimport { RecentDocuments } from '@elliemae/ds-icons';\nimport { TimeWheelContext } from './TimeWheelContext.js';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { StyledIconTriggerButton } from './Styleds.js';\n\n// we memoize the Icon for maximum optimization\n// this is particularly useful 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 TimeWheelIconTrigger = (): JSX.Element => {\n const { handleSetTriggerRef, handleToggleTimePicker, handlePickerIconKeyDown } = useContext(TimeWheelContext);\n const {\n props: { disabled, tabIndex },\n getProps,\n ariaCurrentValueForInputs,\n } = useContext(ControlledDateTimePickerContext);\n return useMemo(\n () => (\n <StyledIconTriggerButton\n aria-label={`time picker context menu trigger, ${ariaCurrentValueForInputs}`}\n buttonType=\"icon\"\n size={BUTTON_SIZES.M}\n innerRef={handleSetTriggerRef}\n tabIndex={tabIndex}\n onClick={handleToggleTimePicker}\n onKeyDown={handlePickerIconKeyDown}\n data-testid={ControlledDateTimePickerDatatestid.PICKER_ICONS.TIMEWHEEL}\n disabled={disabled}\n type=\"button\"\n getOwnerProps={getProps}\n >\n <RecentDocuments />\n </StyledIconTriggerButton>\n ),\n [\n ariaCurrentValueForInputs,\n disabled,\n getProps,\n handlePickerIconKeyDown,\n handleSetTriggerRef,\n handleToggleTimePicker,\n tabIndex,\n ],\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACiCf;AAjCR,SAAgB,YAAY,eAAe;AAC3C,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AACjC,SAAS,0CAA0C;AACnD,SAAS,uCAAuC;AAChD,SAAS,+BAA+B;AAKjC,MAAM,uBAAuB,MAAmB;AACrD,QAAM,EAAE,qBAAqB,wBAAwB,wBAAwB,IAAI,WAAW,gBAAgB;AAC5G,QAAM;AAAA,IACJ,OAAO,EAAE,UAAU,SAAS;AAAA,IAC5B;AAAA,IACA;AAAA,EACF,IAAI,WAAW,+BAA+B;AAC9C,SAAO;AAAA,IACL,MACE;AAAA,MAAC;AAAA;AAAA,QACC,cAAY,qCAAqC;AAAA,QACjD,YAAW;AAAA,QACX,MAAM,aAAa;AAAA,QACnB,UAAU;AAAA,QACV;AAAA,QACA,SAAS;AAAA,QACT,WAAW;AAAA,QACX,eAAa,mCAAmC,aAAa;AAAA,QAC7D;AAAA,QACA,MAAK;AAAA,QACL,eAAe;AAAA,QAEf,8BAAC,mBAAgB;AAAA;AAAA,IACnB;AAAA,IAEF;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|