@elliemae/ds-form-date-time-picker 3.16.0-next.2 → 3.16.0-next.3

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.
Files changed (158) hide show
  1. package/dist/cjs/ControlledDateTimePicker.js +2 -2
  2. package/dist/cjs/ControlledDateTimePicker.js.map +2 -2
  3. package/dist/cjs/config/useChangeHandlers.js.map +2 -2
  4. package/dist/cjs/config/useControlledDateTimePicker.js +3 -3
  5. package/dist/cjs/config/useControlledDateTimePicker.js.map +2 -2
  6. package/dist/cjs/config/useGetFlags.js +6 -6
  7. package/dist/cjs/config/useGetFlags.js.map +2 -2
  8. package/dist/cjs/config/useGetPropsWithDefault.js +2 -2
  9. package/dist/cjs/config/useGetPropsWithDefault.js.map +2 -2
  10. package/dist/cjs/parts/ClearButton/ClearButton.js +8 -2
  11. package/dist/cjs/parts/ClearButton/ClearButton.js.map +3 -3
  12. package/dist/cjs/parts/ControlledDateTimePickerContent.js +8 -1
  13. package/dist/cjs/parts/ControlledDateTimePickerContent.js.map +3 -3
  14. package/dist/cjs/parts/DateInputs/DDInput.js +4 -2
  15. package/dist/cjs/parts/DateInputs/DDInput.js.map +2 -2
  16. package/dist/cjs/parts/DateInputs/DateInputs.js +23 -5
  17. package/dist/cjs/parts/DateInputs/DateInputs.js.map +3 -3
  18. package/dist/cjs/parts/DateInputs/MMInput.js +4 -2
  19. package/dist/cjs/parts/DateInputs/MMInput.js.map +2 -2
  20. package/dist/cjs/parts/DateInputs/YYYYInput.js +4 -2
  21. package/dist/cjs/parts/DateInputs/YYYYInput.js.map +2 -2
  22. package/dist/cjs/parts/DateInputs/useDateInputs.js +1 -1
  23. package/dist/cjs/parts/DateInputs/useDateInputs.js.map +2 -2
  24. package/dist/cjs/parts/Pickers/Calendar/Calendar.js.map +2 -2
  25. package/dist/cjs/parts/Pickers/Calendar/CalendarContent.js +9 -1
  26. package/dist/cjs/parts/Pickers/Calendar/CalendarContent.js.map +3 -3
  27. package/dist/cjs/parts/Pickers/Calendar/CalendarFooter.js +16 -2
  28. package/dist/cjs/parts/Pickers/Calendar/CalendarFooter.js.map +3 -3
  29. package/dist/cjs/parts/Pickers/Calendar/CalendarHead.js +35 -2
  30. package/dist/cjs/parts/Pickers/Calendar/CalendarHead.js.map +2 -2
  31. package/dist/cjs/parts/Pickers/Calendar/CalendarIconTrigger.js +16 -2
  32. package/dist/cjs/parts/Pickers/Calendar/CalendarIconTrigger.js.map +3 -3
  33. package/dist/cjs/parts/Pickers/Calendar/CalendarMonthDays.js.map +2 -2
  34. package/dist/cjs/parts/Pickers/Calendar/CalendarWrapper.js +8 -2
  35. package/dist/cjs/parts/Pickers/Calendar/CalendarWrapper.js.map +3 -3
  36. package/dist/cjs/parts/Pickers/Calendar/Day.js +4 -0
  37. package/dist/cjs/parts/Pickers/Calendar/Day.js.map +2 -2
  38. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js +8 -2
  39. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js.map +3 -3
  40. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js +8 -1
  41. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js.map +3 -3
  42. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +10 -1
  43. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +3 -3
  44. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js +9 -1
  45. package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js.map +3 -3
  46. package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js +23 -2
  47. package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js.map +3 -3
  48. package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js +24 -2
  49. package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js.map +3 -3
  50. package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js +23 -2
  51. package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js.map +3 -3
  52. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContent.js +19 -2
  53. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContent.js.map +2 -2
  54. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelFooter.js +16 -2
  55. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelFooter.js.map +3 -3
  56. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +16 -2
  57. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +3 -3
  58. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelWrapper.js +8 -2
  59. package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelWrapper.js.map +3 -3
  60. package/dist/cjs/parts/TimeInputs/HHInput.js +4 -2
  61. package/dist/cjs/parts/TimeInputs/HHInput.js.map +2 -2
  62. package/dist/cjs/parts/TimeInputs/MeridiemInput.js +4 -2
  63. package/dist/cjs/parts/TimeInputs/MeridiemInput.js.map +2 -2
  64. package/dist/cjs/parts/TimeInputs/MinutesInput.js +4 -2
  65. package/dist/cjs/parts/TimeInputs/MinutesInput.js.map +2 -2
  66. package/dist/cjs/parts/TimeInputs/TimeInputs.js +23 -5
  67. package/dist/cjs/parts/TimeInputs/TimeInputs.js.map +3 -3
  68. package/dist/cjs/propTypes.js +28 -26
  69. package/dist/cjs/propTypes.js.map +2 -2
  70. package/dist/cjs/sharedTypes.js.map +1 -1
  71. package/dist/cjs/tests/custom-props/customProps.js +233 -0
  72. package/dist/cjs/tests/custom-props/customProps.js.map +7 -0
  73. package/dist/esm/ControlledDateTimePicker.js +1 -1
  74. package/dist/esm/ControlledDateTimePicker.js.map +1 -1
  75. package/dist/esm/config/useChangeHandlers.js.map +2 -2
  76. package/dist/esm/config/useControlledDateTimePicker.js +1 -1
  77. package/dist/esm/config/useControlledDateTimePicker.js.map +1 -1
  78. package/dist/esm/config/useGetFlags.js +6 -6
  79. package/dist/esm/config/useGetFlags.js.map +2 -2
  80. package/dist/esm/config/useGetPropsWithDefault.js +1 -1
  81. package/dist/esm/config/useGetPropsWithDefault.js.map +1 -1
  82. package/dist/esm/parts/ClearButton/ClearButton.js +8 -2
  83. package/dist/esm/parts/ClearButton/ClearButton.js.map +3 -3
  84. package/dist/esm/parts/ControlledDateTimePickerContent.js +8 -1
  85. package/dist/esm/parts/ControlledDateTimePickerContent.js.map +3 -3
  86. package/dist/esm/parts/DateInputs/DDInput.js +4 -2
  87. package/dist/esm/parts/DateInputs/DDInput.js.map +2 -2
  88. package/dist/esm/parts/DateInputs/DateInputs.js +23 -5
  89. package/dist/esm/parts/DateInputs/DateInputs.js.map +3 -3
  90. package/dist/esm/parts/DateInputs/MMInput.js +4 -2
  91. package/dist/esm/parts/DateInputs/MMInput.js.map +2 -2
  92. package/dist/esm/parts/DateInputs/YYYYInput.js +4 -2
  93. package/dist/esm/parts/DateInputs/YYYYInput.js.map +2 -2
  94. package/dist/esm/parts/DateInputs/useDateInputs.js +1 -1
  95. package/dist/esm/parts/DateInputs/useDateInputs.js.map +2 -2
  96. package/dist/esm/parts/Pickers/Calendar/Calendar.js.map +2 -2
  97. package/dist/esm/parts/Pickers/Calendar/CalendarContent.js +9 -1
  98. package/dist/esm/parts/Pickers/Calendar/CalendarContent.js.map +3 -3
  99. package/dist/esm/parts/Pickers/Calendar/CalendarFooter.js +16 -2
  100. package/dist/esm/parts/Pickers/Calendar/CalendarFooter.js.map +3 -3
  101. package/dist/esm/parts/Pickers/Calendar/CalendarHead.js +35 -2
  102. package/dist/esm/parts/Pickers/Calendar/CalendarHead.js.map +2 -2
  103. package/dist/esm/parts/Pickers/Calendar/CalendarIconTrigger.js +16 -2
  104. package/dist/esm/parts/Pickers/Calendar/CalendarIconTrigger.js.map +3 -3
  105. package/dist/esm/parts/Pickers/Calendar/CalendarMonthDays.js.map +2 -2
  106. package/dist/esm/parts/Pickers/Calendar/CalendarWrapper.js +8 -2
  107. package/dist/esm/parts/Pickers/Calendar/CalendarWrapper.js.map +3 -3
  108. package/dist/esm/parts/Pickers/Calendar/Day.js +4 -0
  109. package/dist/esm/parts/Pickers/Calendar/Day.js.map +2 -2
  110. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js +8 -2
  111. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js.map +3 -3
  112. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js +8 -1
  113. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js.map +3 -3
  114. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +10 -1
  115. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +3 -3
  116. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js +9 -1
  117. package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js.map +3 -3
  118. package/dist/esm/parts/Pickers/TimeWheel/HoursList.js +23 -2
  119. package/dist/esm/parts/Pickers/TimeWheel/HoursList.js.map +3 -3
  120. package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js +24 -2
  121. package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js.map +3 -3
  122. package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js +23 -2
  123. package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js.map +3 -3
  124. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContent.js +19 -2
  125. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContent.js.map +2 -2
  126. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelFooter.js +16 -2
  127. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelFooter.js.map +3 -3
  128. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +16 -2
  129. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +3 -3
  130. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelWrapper.js +8 -2
  131. package/dist/esm/parts/Pickers/TimeWheel/TimeWheelWrapper.js.map +3 -3
  132. package/dist/esm/parts/TimeInputs/HHInput.js +4 -2
  133. package/dist/esm/parts/TimeInputs/HHInput.js.map +2 -2
  134. package/dist/esm/parts/TimeInputs/MeridiemInput.js +4 -2
  135. package/dist/esm/parts/TimeInputs/MeridiemInput.js.map +2 -2
  136. package/dist/esm/parts/TimeInputs/MinutesInput.js +4 -2
  137. package/dist/esm/parts/TimeInputs/MinutesInput.js.map +2 -2
  138. package/dist/esm/parts/TimeInputs/TimeInputs.js +23 -5
  139. package/dist/esm/parts/TimeInputs/TimeInputs.js.map +3 -3
  140. package/dist/esm/propTypes.js +9 -2
  141. package/dist/esm/propTypes.js.map +2 -2
  142. package/dist/esm/tests/custom-props/customProps.js +207 -0
  143. package/dist/esm/tests/custom-props/customProps.js.map +7 -0
  144. package/dist/types/ControlledDateTimePicker.d.ts +1 -1
  145. package/dist/types/config/useGetFlags.d.ts +2 -2
  146. package/dist/types/parts/DateInputs/DDInput.d.ts +2 -1
  147. package/dist/types/parts/DateInputs/MMInput.d.ts +3 -2
  148. package/dist/types/parts/DateInputs/YYYYInput.d.ts +2 -1
  149. package/dist/types/parts/TimeInputs/HHInput.d.ts +2 -1
  150. package/dist/types/parts/TimeInputs/MeridiemInput.d.ts +2 -1
  151. package/dist/types/parts/TimeInputs/MinutesInput.d.ts +2 -1
  152. package/dist/types/propTypes.d.ts +11 -3
  153. package/dist/types/sharedTypes.d.ts +1 -1
  154. package/dist/types/tests/custom-props/customProps.d.ts +397 -0
  155. package/dist/types/tests/custom-props/date-time-picker.date-custom-props.test.d.ts +1 -0
  156. package/dist/types/tests/custom-props/date-time-picker.date-time-custom-props.test.d.ts +1 -0
  157. package/dist/types/tests/custom-props/date-time-picker.time-custom-props.test.d.ts +1 -0
  158. package/package.json +10 -9
@@ -1,16 +1,30 @@
1
1
  import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { useContext } from "react";
3
+ import React2, { useContext } from "react";
4
4
  import { ControlledDateTimePickerDatatestid } from "../../../ControlledDateTimePickerDatatestid";
5
5
  import { ControlledDateTimePickerContext } from "../../../ControlledDateTimePickerCTX";
6
6
  import { TimeWheelFooterMessage } from "./Styleds";
7
+ import { getPropsPerDatatestid } from "@elliemae/ds-props-helpers";
7
8
  const TimeWheelFooter = () => {
8
9
  const {
10
+ props,
9
11
  props: { pickerFooterMsg, hasError },
10
12
  isWithCalendarToo
11
13
  } = useContext(ControlledDateTimePickerContext);
14
+ const ariaAndDataProps = React2.useMemo(
15
+ () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.FOOTERS.TIMEWHEEL]),
16
+ [props]
17
+ );
12
18
  if (!isWithCalendarToo && pickerFooterMsg !== void 0 && hasError)
13
- return /* @__PURE__ */ jsx(TimeWheelFooterMessage, { role: "alert", "data-testid": ControlledDateTimePickerDatatestid.FOOTERS.TIMEWHEEL, children: pickerFooterMsg });
19
+ return /* @__PURE__ */ jsx(
20
+ TimeWheelFooterMessage,
21
+ {
22
+ role: "alert",
23
+ "data-testid": ControlledDateTimePickerDatatestid.FOOTERS.TIMEWHEEL,
24
+ ...ariaAndDataProps,
25
+ children: pickerFooterMsg
26
+ }
27
+ );
14
28
  return null;
15
29
  };
16
30
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/Pickers/TimeWheel/TimeWheelFooter.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX';\nimport { TimeWheelFooterMessage } from './Styleds';\n\nexport const TimeWheelFooter: React.ComponentType = () => {\n const {\n props: { pickerFooterMsg, hasError },\n isWithCalendarToo,\n } = useContext(ControlledDateTimePickerContext);\n if (!isWithCalendarToo && pickerFooterMsg !== undefined && hasError)\n return (\n <TimeWheelFooterMessage role=\"alert\" data-testid={ControlledDateTimePickerDatatestid.FOOTERS.TIMEWHEEL}>\n {pickerFooterMsg}\n </TimeWheelFooterMessage>\n );\n return null;\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACYjB;AAZN,SAAgB,kBAAkB;AAClC,SAAS,0CAA0C;AACnD,SAAS,uCAAuC;AAChD,SAAS,8BAA8B;AAEhC,MAAM,kBAAuC,MAAM;AACxD,QAAM;AAAA,IACJ,OAAO,EAAE,iBAAiB,SAAS;AAAA,IACnC;AAAA,EACF,IAAI,WAAW,+BAA+B;AAC9C,MAAI,CAAC,qBAAqB,oBAAoB,UAAa;AACzD,WACE,oBAAC,0BAAuB,MAAK,SAAQ,eAAa,mCAAmC,QAAQ,WAC1F,2BACH;AAEJ,SAAO;AACT;",
6
- "names": []
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX';\nimport { TimeWheelFooterMessage } from './Styleds';\nimport { getPropsPerDatatestid } from '@elliemae/ds-props-helpers';\n\nexport const TimeWheelFooter: React.ComponentType = () => {\n const {\n props,\n props: { pickerFooterMsg, hasError },\n isWithCalendarToo,\n } = useContext(ControlledDateTimePickerContext);\n const ariaAndDataProps = React.useMemo(\n () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.FOOTERS.TIMEWHEEL]),\n [props],\n );\n if (!isWithCalendarToo && pickerFooterMsg !== undefined && hasError)\n return (\n <TimeWheelFooterMessage\n role=\"alert\"\n data-testid={ControlledDateTimePickerDatatestid.FOOTERS.TIMEWHEEL}\n {...ariaAndDataProps}\n >\n {pickerFooterMsg}\n </TimeWheelFooterMessage>\n );\n return null;\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACkBjB;AAlBN,OAAOA,UAAS,kBAAkB;AAClC,SAAS,0CAA0C;AACnD,SAAS,uCAAuC;AAChD,SAAS,8BAA8B;AACvC,SAAS,6BAA6B;AAE/B,MAAM,kBAAuC,MAAM;AACxD,QAAM;AAAA,IACJ;AAAA,IACA,OAAO,EAAE,iBAAiB,SAAS;AAAA,IACnC;AAAA,EACF,IAAI,WAAW,+BAA+B;AAC9C,QAAM,mBAAmBA,OAAM;AAAA,IAC7B,MAAM,sBAAsB,MAAM,mCAAmC,QAAQ,UAAU;AAAA,IACvF,CAAC,KAAK;AAAA,EACR;AACA,MAAI,CAAC,qBAAqB,oBAAoB,UAAa;AACzD,WACE;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,eAAa,mCAAmC,QAAQ;AAAA,QACvD,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAEJ,SAAO;AACT;",
6
+ "names": ["React"]
7
7
  }
@@ -1,6 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { useContext, useMemo } from "react";
3
+ import React2, { useContext, useMemo } from "react";
4
+ import { getPropsPerDatatestid } from "@elliemae/ds-props-helpers";
4
5
  import { BUTTON_SIZES } from "@elliemae/ds-button";
5
6
  import { RecentDocuments } from "@elliemae/ds-icons";
6
7
  import { TimeWheelContext } from "./TimeWheelContext";
@@ -10,9 +11,14 @@ import { StyledIconTriggerButton } from "./Styleds";
10
11
  const TimeWheelIconTrigger = () => {
11
12
  const { handleSetTriggerRef, handleToggleTimePicker, handlePickerIconKeyDown } = useContext(TimeWheelContext);
12
13
  const {
14
+ props,
13
15
  props: { disabled },
14
16
  ariaCurrentValueForInputs
15
17
  } = useContext(ControlledDateTimePickerContext);
18
+ const ariaAndDataProps = React2.useMemo(
19
+ () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.PICKER_ICONS.TIMEWHEEL]),
20
+ [props]
21
+ );
16
22
  return useMemo(
17
23
  () => /* @__PURE__ */ jsx(
18
24
  StyledIconTriggerButton,
@@ -26,10 +32,18 @@ const TimeWheelIconTrigger = () => {
26
32
  "data-testid": ControlledDateTimePickerDatatestid.PICKER_ICONS.TIMEWHEEL,
27
33
  disabled,
28
34
  type: "button",
35
+ ...ariaAndDataProps,
29
36
  children: /* @__PURE__ */ jsx(RecentDocuments, {})
30
37
  }
31
38
  ),
32
- [ariaCurrentValueForInputs, disabled, handlePickerIconKeyDown, handleSetTriggerRef, handleToggleTimePicker]
39
+ [
40
+ ariaAndDataProps,
41
+ ariaCurrentValueForInputs,
42
+ disabled,
43
+ handlePickerIconKeyDown,
44
+ handleSetTriggerRef,
45
+ handleToggleTimePicker
46
+ ]
33
47
  );
34
48
  };
35
49
  export {
@@ -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';\nimport { RecentDocuments } from '@elliemae/ds-icons';\nimport { TimeWheelContext } from './TimeWheelContext';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX';\nimport { StyledIconTriggerButton } from './Styleds';\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 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 >\n <RecentDocuments />\n </StyledIconTriggerButton>\n ),\n [ariaCurrentValueForInputs, disabled, handlePickerIconKeyDown, handleSetTriggerRef, handleToggleTimePicker],\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC8Bf;AA9BR,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,SAAS;AAAA,IAClB;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,SAAS;AAAA,QACT,WAAW;AAAA,QACX,eAAa,mCAAmC,aAAa;AAAA,QAC7D;AAAA,QACA,MAAK;AAAA,QAEL,8BAAC,mBAAgB;AAAA;AAAA,IACnB;AAAA,IAEF,CAAC,2BAA2B,UAAU,yBAAyB,qBAAqB,sBAAsB;AAAA,EAC5G;AACF;",
6
- "names": []
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext, useMemo } from 'react';\nimport { getPropsPerDatatestid } from '@elliemae/ds-props-helpers';\nimport { BUTTON_SIZES } from '@elliemae/ds-button';\nimport { RecentDocuments } from '@elliemae/ds-icons';\nimport { TimeWheelContext } from './TimeWheelContext';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX';\nimport { StyledIconTriggerButton } from './Styleds';\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,\n props: { disabled },\n ariaCurrentValueForInputs,\n } = useContext(ControlledDateTimePickerContext);\n const ariaAndDataProps = React.useMemo(\n () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.PICKER_ICONS.TIMEWHEEL]),\n [props],\n );\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 {...ariaAndDataProps}\n >\n <RecentDocuments />\n </StyledIconTriggerButton>\n ),\n [\n ariaAndDataProps,\n ariaCurrentValueForInputs,\n disabled,\n handlePickerIconKeyDown,\n handleSetTriggerRef,\n handleToggleTimePicker,\n ],\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACqCf;AArCR,OAAOA,UAAS,YAAY,eAAe;AAC3C,SAAS,6BAA6B;AACtC,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;AAAA,IACA,OAAO,EAAE,SAAS;AAAA,IAClB;AAAA,EACF,IAAI,WAAW,+BAA+B;AAC9C,QAAM,mBAAmBA,OAAM;AAAA,IAC7B,MAAM,sBAAsB,MAAM,mCAAmC,aAAa,UAAU;AAAA,IAC5F,CAAC,KAAK;AAAA,EACR;AACA,SAAO;AAAA,IACL,MACE;AAAA,MAAC;AAAA;AAAA,QACC,cAAY,qCAAqC;AAAA,QACjD,YAAW;AAAA,QACX,MAAM,aAAa;AAAA,QACnB,UAAU;AAAA,QACV,SAAS;AAAA,QACT,WAAW;AAAA,QACX,eAAa,mCAAmC,aAAa;AAAA,QAC7D;AAAA,QACA,MAAK;AAAA,QACJ,GAAG;AAAA,QAEJ,8BAAC,mBAAgB;AAAA;AAAA,IACnB;AAAA,IAEF;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
6
+ "names": ["React"]
7
7
  }
@@ -1,6 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { useContext } from "react";
3
+ import React2, { useContext } from "react";
4
+ import { getPropsPerDatatestid } from "@elliemae/ds-props-helpers";
4
5
  import { DSPopperJS } from "@elliemae/ds-popperjs";
5
6
  import { ControlledDateTimePickerDatatestid } from "../../../ControlledDateTimePickerDatatestid";
6
7
  import { ControlledDateTimePickerContext } from "../../../ControlledDateTimePickerCTX";
@@ -8,7 +9,11 @@ import { TimeWheelContent } from "./TimeWheelContent";
8
9
  import { TimeWheelContext } from "./TimeWheelContext";
9
10
  const TimeWheelWrapper = () => {
10
11
  const { referenceElement, closeTimePicker } = useContext(TimeWheelContext);
11
- const { isControllerOnly } = useContext(ControlledDateTimePickerContext);
12
+ const { isControllerOnly, props } = useContext(ControlledDateTimePickerContext);
13
+ const ariaAndDataProps = React2.useMemo(
14
+ () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.CONTEXTUAL_MENU.TIMEWHEEL]),
15
+ [props]
16
+ );
12
17
  if (isControllerOnly)
13
18
  return /* @__PURE__ */ jsx(TimeWheelContent, {});
14
19
  return /* @__PURE__ */ jsx(
@@ -19,6 +24,7 @@ const TimeWheelWrapper = () => {
19
24
  referenceElement,
20
25
  withoutArrow: true,
21
26
  onClickOutside: closeTimePicker,
27
+ ...ariaAndDataProps,
22
28
  children: /* @__PURE__ */ jsx(TimeWheelContent, {})
23
29
  }
24
30
  );
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/Pickers/TimeWheel/TimeWheelWrapper.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { DSPopperJS } from '@elliemae/ds-popperjs';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX';\nimport { TimeWheelContent } from './TimeWheelContent';\nimport { TimeWheelContext } from './TimeWheelContext';\n\nexport const TimeWheelWrapper = (): JSX.Element => {\n const { referenceElement, closeTimePicker } = useContext(TimeWheelContext);\n const { isControllerOnly } = useContext(ControlledDateTimePickerContext);\n if (isControllerOnly) return <TimeWheelContent />;\n return (\n <DSPopperJS\n showPopover\n data-testid={ControlledDateTimePickerDatatestid.CONTEXTUAL_MENU.TIMEWHEEL}\n referenceElement={referenceElement}\n withoutArrow\n onClickOutside={closeTimePicker}\n >\n <TimeWheelContent />\n </DSPopperJS>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACUQ;AAV/B,SAAgB,kBAAkB;AAClC,SAAS,kBAAkB;AAC3B,SAAS,0CAA0C;AACnD,SAAS,uCAAuC;AAChD,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AAE1B,MAAM,mBAAmB,MAAmB;AACjD,QAAM,EAAE,kBAAkB,gBAAgB,IAAI,WAAW,gBAAgB;AACzE,QAAM,EAAE,iBAAiB,IAAI,WAAW,+BAA+B;AACvE,MAAI;AAAkB,WAAO,oBAAC,oBAAiB;AAC/C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAW;AAAA,MACX,eAAa,mCAAmC,gBAAgB;AAAA,MAChE;AAAA,MACA,cAAY;AAAA,MACZ,gBAAgB;AAAA,MAEhB,8BAAC,oBAAiB;AAAA;AAAA,EACpB;AAEJ;",
6
- "names": []
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { getPropsPerDatatestid } from '@elliemae/ds-props-helpers';\nimport { DSPopperJS } from '@elliemae/ds-popperjs';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX';\nimport { TimeWheelContent } from './TimeWheelContent';\nimport { TimeWheelContext } from './TimeWheelContext';\n\nexport const TimeWheelWrapper = (): JSX.Element => {\n const { referenceElement, closeTimePicker } = useContext(TimeWheelContext);\n const { isControllerOnly, props } = useContext(ControlledDateTimePickerContext);\n const ariaAndDataProps = React.useMemo(\n () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.CONTEXTUAL_MENU.TIMEWHEEL]),\n [props],\n );\n if (isControllerOnly) return <TimeWheelContent />;\n return (\n <DSPopperJS\n showPopover\n data-testid={ControlledDateTimePickerDatatestid.CONTEXTUAL_MENU.TIMEWHEEL}\n referenceElement={referenceElement}\n withoutArrow\n onClickOutside={closeTimePicker}\n {...ariaAndDataProps}\n >\n <TimeWheelContent />\n </DSPopperJS>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACeQ;AAf/B,OAAOA,UAAS,kBAAkB;AAClC,SAAS,6BAA6B;AACtC,SAAS,kBAAkB;AAC3B,SAAS,0CAA0C;AACnD,SAAS,uCAAuC;AAChD,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AAE1B,MAAM,mBAAmB,MAAmB;AACjD,QAAM,EAAE,kBAAkB,gBAAgB,IAAI,WAAW,gBAAgB;AACzE,QAAM,EAAE,kBAAkB,MAAM,IAAI,WAAW,+BAA+B;AAC9E,QAAM,mBAAmBA,OAAM;AAAA,IAC7B,MAAM,sBAAsB,MAAM,mCAAmC,gBAAgB,UAAU;AAAA,IAC/F,CAAC,KAAK;AAAA,EACR;AACA,MAAI;AAAkB,WAAO,oBAAC,oBAAiB;AAC/C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAW;AAAA,MACX,eAAa,mCAAmC,gBAAgB;AAAA,MAChE;AAAA,MACA,cAAY;AAAA,MACZ,gBAAgB;AAAA,MACf,GAAG;AAAA,MAEJ,8BAAC,oBAAiB;AAAA;AAAA,EACpB;AAEJ;",
6
+ "names": ["React"]
7
7
  }
@@ -22,7 +22,8 @@ const HHInput = React2.memo(
22
22
  ariaCurrentValueForInputs,
23
23
  contextRef,
24
24
  autoFocusHourInput,
25
- isFocused
25
+ isFocused,
26
+ ariaAndDataProps
26
27
  }) => {
27
28
  const validateOnChange = useCallback(
28
29
  (e) => {
@@ -52,7 +53,8 @@ const HHInput = React2.memo(
52
53
  "aria-label": `hours input field ${ariaCurrentValueForInputs}`,
53
54
  "data-testid": ControlledDateTimePickerDatatestid.TIME_INPUTS.HOUR,
54
55
  disabled,
55
- "aria-disabled": disabled
56
+ "aria-disabled": disabled,
57
+ ...ariaAndDataProps
56
58
  }
57
59
  );
58
60
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/TimeInputs/HHInput.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { Styled2DigitsInput } from '../Styleds';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidHour = (hours: string) => {\n if (hours === '') return false;\n const numberOnly = regExpNumbers.test(hours);\n return hours.length > 2 || hours === '00' || !numberOnly || Number.parseInt(hours, 10) > 12;\n};\ninterface HHInputsPropsT {\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 autoFocusHourInput: boolean;\n isFocused: boolean;\n}\nexport const HHInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n placeholder,\n ariaCurrentValueForInputs,\n contextRef,\n autoFocusHourInput,\n isFocused,\n }: HHInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidHour(e.target.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n return (\n <Styled2DigitsInput\n autoFocus={autoFocusHourInput}\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n ref={(DomElem: HTMLInputElement) => {\n contextRef.current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n placeholder={placeholder}\n aria-label={`hours input field ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.TIME_INPUTS.HOUR}\n disabled={disabled}\n aria-disabled={disabled}\n />\n );\n },\n);\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACiDjB;AAjDN,OAAOA,UAAS,mBAAmB;AACnC,SAAS,0BAA0B;AACnC,SAAS,0CAA0C;AAGnD,MAAM,gBAAgB;AACtB,MAAM,gBAAgB,CAAC,UAAkB;AACvC,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;AAcO,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,EACF,MAAmC;AACjC,UAAM,mBAAmB;AAAA,MACvB,CAAC,MAA2C;AAC1C,YAAI,cAAc,EAAE,OAAO,KAAK,GAAG;AACjC,YAAE,eAAe;AACjB;AAAA,QACF;AACA,iBAAS,CAAC;AAAA,MACZ;AAAA,MACA,CAAC,QAAQ;AAAA,IACX;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,QACX,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,KAAK,CAAC,YAA8B;AAClC,qBAAW,UAAU;AACrB,cAAI;AAAW,qBAAS,QAAQ;AAAA,QAClC;AAAA,QACA;AAAA,QACA,cAAY,qBAAqB;AAAA,QACjC,eAAa,mCAAmC,YAAY;AAAA,QAC5D;AAAA,QACA,iBAAe;AAAA;AAAA,IACjB;AAAA,EAEJ;AACF;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { Styled2DigitsInput } from '../Styleds';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidHour = (hours: string) => {\n if (hours === '') return false;\n const numberOnly = regExpNumbers.test(hours);\n return hours.length > 2 || hours === '00' || !numberOnly || Number.parseInt(hours, 10) > 12;\n};\ninterface HHInputsPropsT {\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 autoFocusHourInput: boolean;\n isFocused: boolean;\n ariaAndDataProps?: AriaAndDataProps;\n}\nexport const HHInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n placeholder,\n ariaCurrentValueForInputs,\n contextRef,\n autoFocusHourInput,\n isFocused,\n ariaAndDataProps,\n }: HHInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidHour(e.target.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n return (\n <Styled2DigitsInput\n autoFocus={autoFocusHourInput}\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n ref={(DomElem: HTMLInputElement) => {\n contextRef.current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n placeholder={placeholder}\n aria-label={`hours input field ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.TIME_INPUTS.HOUR}\n disabled={disabled}\n aria-disabled={disabled}\n {...ariaAndDataProps}\n />\n );\n },\n);\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACmDjB;AAnDN,OAAOA,UAAS,mBAAmB;AACnC,SAAS,0BAA0B;AACnC,SAAS,0CAA0C;AAGnD,MAAM,gBAAgB;AACtB,MAAM,gBAAgB,CAAC,UAAkB;AACvC,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;AAeO,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,cAAc,EAAE,OAAO,KAAK,GAAG;AACjC,YAAE,eAAe;AACjB;AAAA,QACF;AACA,iBAAS,CAAC;AAAA,MACZ;AAAA,MACA,CAAC,QAAQ;AAAA,IACX;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,QACX,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,KAAK,CAAC,YAA8B;AAClC,qBAAW,UAAU;AACrB,cAAI;AAAW,qBAAS,QAAQ;AAAA,QAClC;AAAA,QACA;AAAA,QACA,cAAY,qBAAqB;AAAA,QACjC,eAAa,mCAAmC,YAAY;AAAA,QAC5D;AAAA,QACA,iBAAe;AAAA,QACd,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;",
6
6
  "names": ["React"]
7
7
  }
@@ -24,7 +24,8 @@ const MeridiemInput = React2.memo(
24
24
  placeholder,
25
25
  ariaCurrentValueForInputs,
26
26
  contextRef,
27
- isFocused
27
+ isFocused,
28
+ ariaAndDataProps
28
29
  }) => {
29
30
  const validateOnChange = useCallback(
30
31
  (e) => {
@@ -53,7 +54,8 @@ const MeridiemInput = React2.memo(
53
54
  "aria-label": `meridiem input field ${ariaCurrentValueForInputs}`,
54
55
  "data-testid": ControlledDateTimePickerDatatestid.TIME_INPUTS.MERIDIEM,
55
56
  disabled,
56
- "aria-disabled": disabled
57
+ "aria-disabled": disabled,
58
+ ...ariaAndDataProps
57
59
  }
58
60
  );
59
61
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/TimeInputs/MeridiemInput.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { Styled2DigitsInput } from '../Styleds';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes';\n\nconst validFirstDigits = ['a', 'A', 'p', 'P'];\nconst validSecondDigits = ['m', 'M'];\nconst isInvalidMeridiem = (meridiem: string) => {\n if (meridiem === '') return false;\n const [firstDigit, secondDigit] = meridiem.split('');\n const isValidFirstDigit = (meridiem.length < 1 && !firstDigit) || validFirstDigits.includes(firstDigit);\n const isValidSecondDigit = !secondDigit || validSecondDigits.includes(secondDigit);\n return meridiem.length > 2 || !isValidFirstDigit || !isValidSecondDigit;\n};\n\ninterface MeridiemInputsPropsT {\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}\nexport const MeridiemInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n placeholder,\n ariaCurrentValueForInputs,\n contextRef,\n isFocused,\n }: MeridiemInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidMeridiem(e?.target?.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n return (\n <Styled2DigitsInput\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n ref={(DomElem: HTMLInputElement) => {\n contextRef.current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n placeholder={placeholder}\n aria-label={`meridiem input field ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.TIME_INPUTS.MERIDIEM}\n disabled={disabled}\n aria-disabled={disabled}\n />\n );\n },\n);\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACmDjB;AAnDN,OAAOA,UAAS,mBAAmB;AACnC,SAAS,0BAA0B;AACnC,SAAS,0CAA0C;AAGnD,MAAM,mBAAmB,CAAC,KAAK,KAAK,KAAK,GAAG;AAC5C,MAAM,oBAAoB,CAAC,KAAK,GAAG;AACnC,MAAM,oBAAoB,CAAC,aAAqB;AAC9C,MAAI,aAAa;AAAI,WAAO;AAC5B,QAAM,CAAC,YAAY,WAAW,IAAI,SAAS,MAAM,EAAE;AACnD,QAAM,oBAAqB,SAAS,SAAS,KAAK,CAAC,cAAe,iBAAiB,SAAS,UAAU;AACtG,QAAM,qBAAqB,CAAC,eAAe,kBAAkB,SAAS,WAAW;AACjF,SAAO,SAAS,SAAS,KAAK,CAAC,qBAAqB,CAAC;AACvD;AAcO,MAAM,gBAAgBA,OAAM;AAAA,EACjC,CAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,MAAyC;AACvC,UAAM,mBAAmB;AAAA,MACvB,CAAC,MAA2C;AAC1C,YAAI,kBAAkB,GAAG,QAAQ,KAAK,GAAG;AACvC,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,KAAK,CAAC,YAA8B;AAClC,qBAAW,UAAU;AACrB,cAAI;AAAW,qBAAS,QAAQ;AAAA,QAClC;AAAA,QACA;AAAA,QACA,cAAY,wBAAwB;AAAA,QACpC,eAAa,mCAAmC,YAAY;AAAA,QAC5D;AAAA,QACA,iBAAe;AAAA;AAAA,IACjB;AAAA,EAEJ;AACF;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { Styled2DigitsInput } from '../Styleds';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes';\n\nconst validFirstDigits = ['a', 'A', 'p', 'P'];\nconst validSecondDigits = ['m', 'M'];\nconst isInvalidMeridiem = (meridiem: string) => {\n if (meridiem === '') return false;\n const [firstDigit, secondDigit] = meridiem.split('');\n const isValidFirstDigit = (meridiem.length < 1 && !firstDigit) || validFirstDigits.includes(firstDigit);\n const isValidSecondDigit = !secondDigit || validSecondDigits.includes(secondDigit);\n return meridiem.length > 2 || !isValidFirstDigit || !isValidSecondDigit;\n};\n\ninterface MeridiemInputsPropsT {\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 ariaAndDataProps?: AriaAndDataProps;\n}\nexport const MeridiemInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n placeholder,\n ariaCurrentValueForInputs,\n contextRef,\n isFocused,\n ariaAndDataProps,\n }: MeridiemInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidMeridiem(e?.target?.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n return (\n <Styled2DigitsInput\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n ref={(DomElem: HTMLInputElement) => {\n contextRef.current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n placeholder={placeholder}\n aria-label={`meridiem input field ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.TIME_INPUTS.MERIDIEM}\n disabled={disabled}\n aria-disabled={disabled}\n {...ariaAndDataProps}\n />\n );\n },\n);\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACqDjB;AArDN,OAAOA,UAAS,mBAAmB;AACnC,SAAS,0BAA0B;AACnC,SAAS,0CAA0C;AAGnD,MAAM,mBAAmB,CAAC,KAAK,KAAK,KAAK,GAAG;AAC5C,MAAM,oBAAoB,CAAC,KAAK,GAAG;AACnC,MAAM,oBAAoB,CAAC,aAAqB;AAC9C,MAAI,aAAa;AAAI,WAAO;AAC5B,QAAM,CAAC,YAAY,WAAW,IAAI,SAAS,MAAM,EAAE;AACnD,QAAM,oBAAqB,SAAS,SAAS,KAAK,CAAC,cAAe,iBAAiB,SAAS,UAAU;AACtG,QAAM,qBAAqB,CAAC,eAAe,kBAAkB,SAAS,WAAW;AACjF,SAAO,SAAS,SAAS,KAAK,CAAC,qBAAqB,CAAC;AACvD;AAeO,MAAM,gBAAgBA,OAAM;AAAA,EACjC,CAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,MAAyC;AACvC,UAAM,mBAAmB;AAAA,MACvB,CAAC,MAA2C;AAC1C,YAAI,kBAAkB,GAAG,QAAQ,KAAK,GAAG;AACvC,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,KAAK,CAAC,YAA8B;AAClC,qBAAW,UAAU;AACrB,cAAI;AAAW,qBAAS,QAAQ;AAAA,QAClC;AAAA,QACA;AAAA,QACA,cAAY,wBAAwB;AAAA,QACpC,eAAa,mCAAmC,YAAY;AAAA,QAC5D;AAAA,QACA,iBAAe;AAAA,QACd,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;",
6
6
  "names": ["React"]
7
7
  }
@@ -21,7 +21,8 @@ const MinutesInput = React2.memo(
21
21
  placeholder,
22
22
  ariaCurrentValueForInputs,
23
23
  contextRef,
24
- isFocused
24
+ isFocused,
25
+ ariaAndDataProps
25
26
  }) => {
26
27
  const validateOnChange = useCallback(
27
28
  (e) => {
@@ -50,7 +51,8 @@ const MinutesInput = React2.memo(
50
51
  "aria-label": `minutes input field ${ariaCurrentValueForInputs}`,
51
52
  "data-testid": ControlledDateTimePickerDatatestid.TIME_INPUTS.MINUTE,
52
53
  disabled,
53
- "aria-disabled": disabled
54
+ "aria-disabled": disabled,
55
+ ...ariaAndDataProps
54
56
  }
55
57
  );
56
58
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/TimeInputs/MinutesInput.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid';\nimport { Styled2DigitsInput } from '../Styleds';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidMinute = (minutes: string) => {\n if (minutes === '') return false;\n const numberOnly = regExpNumbers.test(minutes);\n return minutes.length > 2 || !numberOnly || Number.parseInt(minutes, 10) > 60;\n};\ninterface MinutesInputsPropsT {\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}\nexport const MinutesInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n placeholder,\n ariaCurrentValueForInputs,\n contextRef,\n isFocused,\n }: MinutesInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidMinute(e?.target?.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n return (\n <Styled2DigitsInput\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n ref={(DomElem: HTMLInputElement) => {\n contextRef.current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n placeholder={placeholder}\n aria-label={`minutes input field ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.TIME_INPUTS.MINUTE}\n disabled={disabled}\n aria-disabled={disabled}\n />\n );\n },\n);\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC+CjB;AA/CN,OAAOA,UAAS,mBAAmB;AACnC,SAAS,0CAA0C;AACnD,SAAS,0BAA0B;AAGnC,MAAM,gBAAgB;AACtB,MAAM,kBAAkB,CAAC,YAAoB;AAC3C,MAAI,YAAY;AAAI,WAAO;AAC3B,QAAM,aAAa,cAAc,KAAK,OAAO;AAC7C,SAAO,QAAQ,SAAS,KAAK,CAAC,cAAc,OAAO,SAAS,SAAS,EAAE,IAAI;AAC7E;AAaO,MAAM,eAAeA,OAAM;AAAA,EAChC,CAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,MAAwC;AACtC,UAAM,mBAAmB;AAAA,MACvB,CAAC,MAA2C;AAC1C,YAAI,gBAAgB,GAAG,QAAQ,KAAK,GAAG;AACrC,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,KAAK,CAAC,YAA8B;AAClC,qBAAW,UAAU;AACrB,cAAI;AAAW,qBAAS,QAAQ;AAAA,QAClC;AAAA,QACA;AAAA,QACA,cAAY,uBAAuB;AAAA,QACnC,eAAa,mCAAmC,YAAY;AAAA,QAC5D;AAAA,QACA,iBAAe;AAAA;AAAA,IACjB;AAAA,EAEJ;AACF;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid';\nimport { Styled2DigitsInput } from '../Styleds';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidMinute = (minutes: string) => {\n if (minutes === '') return false;\n const numberOnly = regExpNumbers.test(minutes);\n return minutes.length > 2 || !numberOnly || Number.parseInt(minutes, 10) > 60;\n};\ninterface MinutesInputsPropsT {\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 ariaAndDataProps?: AriaAndDataProps;\n}\nexport const MinutesInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n placeholder,\n ariaCurrentValueForInputs,\n contextRef,\n isFocused,\n ariaAndDataProps,\n }: MinutesInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidMinute(e?.target?.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n return (\n <Styled2DigitsInput\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n ref={(DomElem: HTMLInputElement) => {\n contextRef.current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n placeholder={placeholder}\n aria-label={`minutes input field ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.TIME_INPUTS.MINUTE}\n disabled={disabled}\n aria-disabled={disabled}\n {...ariaAndDataProps}\n />\n );\n },\n);\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACiDjB;AAjDN,OAAOA,UAAS,mBAAmB;AACnC,SAAS,0CAA0C;AACnD,SAAS,0BAA0B;AAGnC,MAAM,gBAAgB;AACtB,MAAM,kBAAkB,CAAC,YAAoB;AAC3C,MAAI,YAAY;AAAI,WAAO;AAC3B,QAAM,aAAa,cAAc,KAAK,OAAO;AAC7C,SAAO,QAAQ,SAAS,KAAK,CAAC,cAAc,OAAO,SAAS,SAAS,EAAE,IAAI;AAC7E;AAcO,MAAM,eAAeA,OAAM;AAAA,EAChC,CAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,MAAwC;AACtC,UAAM,mBAAmB;AAAA,MACvB,CAAC,MAA2C;AAC1C,YAAI,gBAAgB,GAAG,QAAQ,KAAK,GAAG;AACrC,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,KAAK,CAAC,YAA8B;AAClC,qBAAW,UAAU;AACrB,cAAI;AAAW,qBAAS,QAAQ;AAAA,QAClC;AAAA,QACA;AAAA,QACA,cAAY,uBAAuB;AAAA,QACnC,eAAa,mCAAmC,YAAY;AAAA,QAC5D;AAAA,QACA,iBAAe;AAAA,QACd,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;",
6
6
  "names": ["React"]
7
7
  }
@@ -1,8 +1,10 @@
1
1
  import * as React from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { useContext } from "react";
3
+ import React2, { useContext } from "react";
4
4
  import { Grid } from "@elliemae/ds-grid";
5
+ import { getPropsPerDatatestid } from "@elliemae/ds-props-helpers";
5
6
  import { ControlledDateTimePickerContext } from "../../ControlledDateTimePickerCTX";
7
+ import { ControlledDateTimePickerDatatestid } from "../../ControlledDateTimePickerDatatestid";
6
8
  import { HHInput } from "./HHInput";
7
9
  import { MinutesInput } from "./MinutesInput";
8
10
  import { MeridiemInput } from "./MeridiemInput";
@@ -35,8 +37,21 @@ const TimeInputs = () => {
35
37
  meridiemInputRef,
36
38
  ariaCurrentValueForInputs,
37
39
  latestInteractionRegion,
38
- currFocusDescriber
40
+ currFocusDescriber,
41
+ props
39
42
  } = useContext(ControlledDateTimePickerContext);
43
+ const ariaAndDataPropsHoursInput = React2.useMemo(
44
+ () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.TIME_INPUTS.HOUR]),
45
+ [props]
46
+ );
47
+ const ariaAndDataPropsMinutesInput = React2.useMemo(
48
+ () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.TIME_INPUTS.MINUTE]),
49
+ [props]
50
+ );
51
+ const ariaAndDataPropsMeridiemInput = React2.useMemo(
52
+ () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.TIME_INPUTS.MERIDIEM]),
53
+ [props]
54
+ );
40
55
  return /* @__PURE__ */ jsxs(
41
56
  Grid,
42
57
  {
@@ -61,7 +76,8 @@ const TimeInputs = () => {
61
76
  ariaCurrentValueForInputs,
62
77
  autoFocusHourInput,
63
78
  disabled,
64
- isFocused: latestInteractionRegion === "time-inputs" && currFocusDescriber === "hour-input"
79
+ isFocused: latestInteractionRegion === "time-inputs" && currFocusDescriber === "hour-input",
80
+ ariaAndDataProps: ariaAndDataPropsHoursInput
65
81
  }
66
82
  ) }),
67
83
  /* @__PURE__ */ jsx(StyledColonSeparator, { alignItems: "center", children: ":" }),
@@ -77,7 +93,8 @@ const TimeInputs = () => {
77
93
  placeholder: "MM",
78
94
  ariaCurrentValueForInputs,
79
95
  disabled,
80
- isFocused: latestInteractionRegion === "time-inputs" && currFocusDescriber === "minute-input"
96
+ isFocused: latestInteractionRegion === "time-inputs" && currFocusDescriber === "minute-input",
97
+ ariaAndDataProps: ariaAndDataPropsMinutesInput
81
98
  }
82
99
  ) }),
83
100
  /* @__PURE__ */ jsx(StyledSeparator, { children: " " }),
@@ -93,7 +110,8 @@ const TimeInputs = () => {
93
110
  placeholder: "AM",
94
111
  ariaCurrentValueForInputs,
95
112
  disabled,
96
- isFocused: latestInteractionRegion === "time-inputs" && currFocusDescriber === "meridiem-input"
113
+ isFocused: latestInteractionRegion === "time-inputs" && currFocusDescriber === "meridiem-input",
114
+ ariaAndDataProps: ariaAndDataPropsMeridiemInput
97
115
  }
98
116
  ) })
99
117
  ]
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/TimeInputs/TimeInputs.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';\nimport { HHInput } from './HHInput';\nimport { MinutesInput } from './MinutesInput';\n// import { SSInput } from './SSInput';\nimport { MeridiemInput } from './MeridiemInput';\nimport { useTimeInputs } from './useTimeInputs';\nimport { fixedValues } from '../config';\nimport { StyledColonSeparator, StyledSeparator, StyledFocusWithIn } from '../Styleds';\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 } = useContext(ControlledDateTimePickerContext);\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 />\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 />\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 />\n </StyledFocusWithIn>\n </Grid>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC0CnB,SAUI,KAVJ;AA1CJ,SAAgB,kBAAkB;AAClC,SAAS,YAAY;AACrB,SAAS,uCAAuC;AAChD,SAAS,eAAe;AACxB,SAAS,oBAAoB;AAE7B,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB,iBAAiB,yBAAyB;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,IAAI,cAAc;AAGlB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,+BAA+B;AAC9C,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,OAAO;AAAA,YACP,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,WAAW;AAAA,YACX,YAAY;AAAA,YACZ,aAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACA;AAAA,YACA,WAAW,4BAA4B,iBAAiB,uBAAuB;AAAA;AAAA,QACjF,GACF;AAAA,QACA,oBAAC,wBAAqB,YAAW,UAAS,eAAC;AAAA,QAC3C,oBAAC,qBACC;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,YACP,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,WAAW;AAAA,YACX,YAAY;AAAA,YACZ,aAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACA,WAAW,4BAA4B,iBAAiB,uBAAuB;AAAA;AAAA,QACjF,GACF;AAAA,QACA,oBAAC,mBAAgB,eAAC;AAAA,QAClB,oBAAC,qBACC;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,YACP,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,WAAW;AAAA,YACX,YAAY;AAAA,YACZ,aAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACA,WAAW,4BAA4B,iBAAiB,uBAAuB;AAAA;AAAA,QACjF,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;",
6
- "names": []
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { getPropsPerDatatestid } from '@elliemae/ds-props-helpers';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid';\nimport { HHInput } from './HHInput';\nimport { MinutesInput } from './MinutesInput';\nimport { MeridiemInput } from './MeridiemInput';\nimport { useTimeInputs } from './useTimeInputs';\nimport { fixedValues } from '../config';\nimport { StyledColonSeparator, StyledSeparator, StyledFocusWithIn } from '../Styleds';\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 props,\n } = useContext(ControlledDateTimePickerContext);\n const ariaAndDataPropsHoursInput = React.useMemo(\n () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.TIME_INPUTS.HOUR]),\n [props],\n );\n const ariaAndDataPropsMinutesInput = React.useMemo(\n () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.TIME_INPUTS.MINUTE]),\n [props],\n );\n const ariaAndDataPropsMeridiemInput = React.useMemo(\n () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.TIME_INPUTS.MERIDIEM]),\n [props],\n );\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 ariaAndDataProps={ariaAndDataPropsHoursInput}\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 ariaAndDataProps={ariaAndDataPropsMinutesInput}\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 ariaAndDataProps={ariaAndDataPropsMeridiemInput}\n />\n </StyledFocusWithIn>\n </Grid>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACyDnB,SAUI,KAVJ;AAzDJ,OAAOA,UAAS,kBAAkB;AAClC,SAAS,YAAY;AACrB,SAAS,6BAA6B;AACtC,SAAS,uCAAuC;AAChD,SAAS,0CAA0C;AACnD,SAAS,eAAe;AACxB,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB,iBAAiB,yBAAyB;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,IAAI,cAAc;AAGlB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,+BAA+B;AAC9C,QAAM,6BAA6BA,OAAM;AAAA,IACvC,MAAM,sBAAsB,MAAM,mCAAmC,YAAY,KAAK;AAAA,IACtF,CAAC,KAAK;AAAA,EACR;AACA,QAAM,+BAA+BA,OAAM;AAAA,IACzC,MAAM,sBAAsB,MAAM,mCAAmC,YAAY,OAAO;AAAA,IACxF,CAAC,KAAK;AAAA,EACR;AACA,QAAM,gCAAgCA,OAAM;AAAA,IAC1C,MAAM,sBAAsB,MAAM,mCAAmC,YAAY,SAAS;AAAA,IAC1F,CAAC,KAAK;AAAA,EACR;AAEA,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,OAAO;AAAA,YACP,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,WAAW;AAAA,YACX,YAAY;AAAA,YACZ,aAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACA;AAAA,YACA,WAAW,4BAA4B,iBAAiB,uBAAuB;AAAA,YAC/E,kBAAkB;AAAA;AAAA,QACpB,GACF;AAAA,QACA,oBAAC,wBAAqB,YAAW,UAAS,eAAC;AAAA,QAC3C,oBAAC,qBACC;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,YACP,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,WAAW;AAAA,YACX,YAAY;AAAA,YACZ,aAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACA,WAAW,4BAA4B,iBAAiB,uBAAuB;AAAA,YAC/E,kBAAkB;AAAA;AAAA,QACpB,GACF;AAAA,QACA,oBAAC,mBAAgB,eAAC;AAAA,QAClB,oBAAC,qBACC;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,YACP,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,WAAW;AAAA,YACX,YAAY;AAAA,YACZ,aAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACA,WAAW,4BAA4B,iBAAiB,uBAAuB;AAAA,YAC/E,kBAAkB;AAAA;AAAA,QACpB,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;",
6
+ "names": ["React"]
7
7
  }
@@ -1,5 +1,11 @@
1
1
  import * as React from "react";
2
- import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from "@elliemae/ds-utilities";
2
+ import {
3
+ PropTypes,
4
+ globalAttributesPropTypes,
5
+ xstyledPropTypes,
6
+ getPropsPerDatatestIdPropTypes
7
+ } from "@elliemae/ds-props-helpers";
8
+ import { ControlledDateTimePickerDatatestid } from "./ControlledDateTimePickerDatatestid";
3
9
  const noop = () => {
4
10
  };
5
11
  const defaultReturnFalse = () => false;
@@ -76,7 +82,8 @@ const propTypes = {
76
82
  'which day to start the timewheel on picker open when value is empty, string following the HH:MM AA" pattern'
77
83
  ).defaultValue("01:00 AM"),
78
84
  minutesInterval: PropTypes.number.description("increments/decrements of minutes in time related controllers interactions").defaultValue("1"),
79
- "data-testid": PropTypes.string.description("Unique id for tests.").defaultValue("")
85
+ "data-testid": PropTypes.string.description("Unique id for tests.").defaultValue(""),
86
+ ...getPropsPerDatatestIdPropTypes(ControlledDateTimePickerDatatestid)
80
87
  };
81
88
  export {
82
89
  defaultProps,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/propTypes.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport type { WeakValidationMap } from 'react';\nimport type React from 'react';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-utilities';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = (): void => {};\nconst defaultReturnFalse = (): false => false;\nexport declare namespace DSControlledDateTimePickerT {\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 {\n emptyPickerStartingMonth?: string;\n onCalendarOpenFocusedDay?: string;\n pickerFooterMsg?: string;\n innerRef?: React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null>;\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 {\n pickerFooterMsg?: string;\n onTimeWheelOpenStartingTime?: string;\n innerRef?: React.MutableRefObject<HTMLInputElement | HTMLButtonElement>;\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 = 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} as WeakValidationMap<unknown>;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,2BAA2B,wBAAwB;AAGvE,MAAM,OAAO,MAAY;AAAC;AAC1B,MAAM,qBAAqB,MAAa;AA4IjC,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,UAAU,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,UAAU,KAAK,YAAY,qCAAqC,EAAE,aAAa,KAAK;AAAA,EAC9F,aAAa,UAAU,KAAK,YAAY,kCAAkC,EAAE,aAAa,KAAK;AAAA,EAC9F,UAAU,UAAU,OAAO,YAAY,iEAAiE;AAAA,EACxG,MAAM,UAAU,OAAO,YAAY,4DAA4D;AAAA,EAC/F,MAAM,UAAU,OAAO,YAAY,4DAA4D;AAAA,EAC/F,cAAc,UAAU,KAAK,YAAY,2CAA2C;AAAA,EACpF,cAAc,UAAU,KAAK,YAAY,2CAA2C;AAAA,EACpF,kBAAkB,UAAU,KAAK,YAAY,+CAA+C;AAAA,EAC5F,eAAe,UAAU,KAAK,YAAY,mDAAmD;AAAA,EAC7F,aAAa,UAAU,KAAK,YAAY,iDAAiD;AAAA,EACzF,cAAc,UAAU,KAAK,YAAY,kDAAkD;AAAA,EAC3F,cAAc,UAAU,KAAK,YAAY,kDAAkD;AAAA,EAC3F,gBAAgB,UAAU,KAAK,YAAY,oDAAoD;AAAA,EAC/F,kBAAkB,UAAU,KAAK,YAAY,sDAAsD;AAAA,EACnG,kBAAkB,UAAU,KAAK;AAAA,IAC/B;AAAA,EACF;AAAA,EACA,oBAAoB,UAAU,KAAK;AAAA,IACjC;AAAA,EACF;AAAA,EACA,mBAAmB,UAAU,KAAK;AAAA,IAChC;AAAA,EACF;AAAA,EACA,0BAA0B,UAAU,OAAO;AAAA,IACzC;AAAA,EACF;AAAA,EACA,0BAA0B,UAAU,OACjC,YAAY,oGAAoG,EAChH,aAAa,qDAAqD;AAAA,EACrE,6BAA6B,UAAU,OACpC;AAAA,IACC;AAAA,EACF,EACC,aAAa,UAAU;AAAA,EAC1B,iBAAiB,UAAU,OACxB,YAAY,2EAA2E,EACvF,aAAa,GAAG;AAAA,EACnB,eAAe,UAAU,OAAO,YAAY,sBAAsB,EAAE,aAAa,EAAE;AACrF;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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';\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?: React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null>;\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?: React.MutableRefObject<HTMLInputElement | HTMLButtonElement>;\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"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0CAA0C;AAGnD,MAAM,OAAO,MAAY;AAAC;AAC1B,MAAM,qBAAqB,MAAa;AA4JjC,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,UAAU,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,UAAU,KAAK,YAAY,qCAAqC,EAAE,aAAa,KAAK;AAAA,EAC9F,aAAa,UAAU,KAAK,YAAY,kCAAkC,EAAE,aAAa,KAAK;AAAA,EAC9F,UAAU,UAAU,OAAO,YAAY,iEAAiE;AAAA,EACxG,MAAM,UAAU,OAAO,YAAY,4DAA4D;AAAA,EAC/F,MAAM,UAAU,OAAO,YAAY,4DAA4D;AAAA,EAC/F,cAAc,UAAU,KAAK,YAAY,2CAA2C;AAAA,EACpF,cAAc,UAAU,KAAK,YAAY,2CAA2C;AAAA,EACpF,kBAAkB,UAAU,KAAK,YAAY,+CAA+C;AAAA,EAC5F,eAAe,UAAU,KAAK,YAAY,mDAAmD;AAAA,EAC7F,aAAa,UAAU,KAAK,YAAY,iDAAiD;AAAA,EACzF,cAAc,UAAU,KAAK,YAAY,kDAAkD;AAAA,EAC3F,cAAc,UAAU,KAAK,YAAY,kDAAkD;AAAA,EAC3F,gBAAgB,UAAU,KAAK,YAAY,oDAAoD;AAAA,EAC/F,kBAAkB,UAAU,KAAK,YAAY,sDAAsD;AAAA,EACnG,kBAAkB,UAAU,KAAK;AAAA,IAC/B;AAAA,EACF;AAAA,EACA,oBAAoB,UAAU,KAAK;AAAA,IACjC;AAAA,EACF;AAAA,EACA,mBAAmB,UAAU,KAAK;AAAA,IAChC;AAAA,EACF;AAAA,EACA,0BAA0B,UAAU,OAAO;AAAA,IACzC;AAAA,EACF;AAAA,EACA,0BAA0B,UAAU,OACjC,YAAY,oGAAoG,EAChH,aAAa,qDAAqD;AAAA,EACrE,6BAA6B,UAAU,OACpC;AAAA,IACC;AAAA,EACF,EACC,aAAa,UAAU;AAAA,EAC1B,iBAAiB,UAAU,OACxB,YAAY,2EAA2E,EACvF,aAAa,GAAG;AAAA,EACnB,eAAe,UAAU,OAAO,YAAY,sBAAsB,EAAE,aAAa,EAAE;AAAA,EACnF,GAAG,+BAA+B,kCAAkC;AACtE;",
6
6
  "names": []
7
7
  }