@elliemae/ds-form 3.12.0-next.0 → 3.12.0-next.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.
Files changed (135) hide show
  1. package/dist/cjs/CheckboxGroup/DSCheckboxGroup.js.map +2 -2
  2. package/dist/cjs/ComboBox/index.js.map +1 -1
  3. package/dist/cjs/ComboBoxFreeSolo/ComboBoxFreeSolo.js +28 -30
  4. package/dist/cjs/ComboBoxFreeSolo/ComboBoxFreeSolo.js.map +2 -2
  5. package/dist/cjs/ComboBoxFreeSolo/components/MultiValueLabel.js.map +2 -2
  6. package/dist/cjs/ComboBoxFreeSolo/components/SingleValue.js.map +2 -2
  7. package/dist/cjs/DateInput/props.js +12 -33
  8. package/dist/cjs/DateInput/props.js.map +2 -2
  9. package/dist/cjs/DateInputV2/components/helpers.js.map +2 -2
  10. package/dist/cjs/DateInputV2/components/props.js +8 -25
  11. package/dist/cjs/DateInputV2/components/props.js.map +2 -2
  12. package/dist/cjs/DateInputV2/components/propsTypes.js +1 -4
  13. package/dist/cjs/DateInputV2/components/propsTypes.js.map +2 -2
  14. package/dist/cjs/DateInputV2/components/styled.js.map +2 -2
  15. package/dist/cjs/DateInputV2/components/utils.js +1 -4
  16. package/dist/cjs/DateInputV2/components/utils.js.map +2 -2
  17. package/dist/cjs/FloatingLabelInput/getSvgPath.js.map +2 -2
  18. package/dist/cjs/FormItem/Label/DSLabel.js +1 -9
  19. package/dist/cjs/FormItem/Label/DSLabel.js.map +2 -2
  20. package/dist/cjs/FormItem/Suffix/Suffix.js.map +2 -2
  21. package/dist/cjs/FormItem/ValidationFieldWrapper.js.map +2 -2
  22. package/dist/cjs/Input/index.js.map +1 -1
  23. package/dist/cjs/InputGroup/AddonWrapper.js +1 -7
  24. package/dist/cjs/InputGroup/AddonWrapper.js.map +2 -2
  25. package/dist/cjs/InputGroup/props.js +5 -12
  26. package/dist/cjs/InputGroup/props.js.map +2 -2
  27. package/dist/cjs/InputMask/DSInputMask.js +2 -6
  28. package/dist/cjs/InputMask/DSInputMask.js.map +2 -2
  29. package/dist/cjs/InputMask/InputMaskContext.js.map +1 -1
  30. package/dist/cjs/InputMask/addons/AutoCorrectedDatePipe.js +3 -12
  31. package/dist/cjs/InputMask/addons/AutoCorrectedDatePipe.js.map +2 -2
  32. package/dist/cjs/InputMask/mask_types/DateInputMask.js +1 -5
  33. package/dist/cjs/InputMask/mask_types/DateInputMask.js.map +2 -2
  34. package/dist/cjs/InputMask/mask_types/DateTimeInputMask.js +1 -5
  35. package/dist/cjs/InputMask/mask_types/DateTimeInputMask.js.map +2 -2
  36. package/dist/cjs/InputMask/mask_types/DictionaryInputMask.js +1 -7
  37. package/dist/cjs/InputMask/mask_types/DictionaryInputMask.js.map +2 -2
  38. package/dist/cjs/InputMask/mask_types/PhoneInputMask.js +1 -5
  39. package/dist/cjs/InputMask/mask_types/PhoneInputMask.js.map +2 -2
  40. package/dist/cjs/InputMask/mask_types/PhoneInternationalInputMask.js +1 -5
  41. package/dist/cjs/InputMask/mask_types/PhoneInternationalInputMask.js.map +2 -2
  42. package/dist/cjs/InputMask/mask_types/SsnInputMask.js +1 -5
  43. package/dist/cjs/InputMask/mask_types/SsnInputMask.js.map +2 -2
  44. package/dist/cjs/InputMask/mask_types/ZipCodeSearchInputMask.js +1 -5
  45. package/dist/cjs/InputMask/mask_types/ZipCodeSearchInputMask.js.map +2 -2
  46. package/dist/cjs/InputMask/mask_types/index.js.map +2 -2
  47. package/dist/cjs/InputMask/props.js +19 -59
  48. package/dist/cjs/InputMask/props.js.map +2 -2
  49. package/dist/cjs/InputProtected/props.js +8 -21
  50. package/dist/cjs/InputProtected/props.js.map +2 -2
  51. package/dist/cjs/LargeInputText/DSLargeInputText.js +13 -19
  52. package/dist/cjs/LargeInputText/DSLargeInputText.js.map +2 -2
  53. package/dist/cjs/LargeInputText/props.js +13 -39
  54. package/dist/cjs/LargeInputText/props.js.map +2 -2
  55. package/dist/cjs/Radio/Circle.js.map +2 -2
  56. package/dist/cjs/RadioGroup/DSRadioGroup.js.map +2 -2
  57. package/dist/cjs/TimeInput/DSTimeInput.js +8 -19
  58. package/dist/cjs/TimeInput/DSTimeInput.js.map +2 -2
  59. package/dist/cjs/TimeInput/TimeInputImpl.js +1 -3
  60. package/dist/cjs/TimeInput/TimeInputImpl.js.map +2 -2
  61. package/dist/cjs/TimeInput/utils.js +4 -5
  62. package/dist/cjs/TimeInput/utils.js.map +3 -3
  63. package/dist/cjs/Toggle/DSToggleImpl.js.map +2 -2
  64. package/dist/cjs/Toggle/DSToggleRender.js +13 -15
  65. package/dist/cjs/Toggle/DSToggleRender.js.map +2 -2
  66. package/dist/cjs/Toggle/toggleHelper.js +1 -7
  67. package/dist/cjs/Toggle/toggleHelper.js.map +2 -2
  68. package/dist/esm/CheckboxGroup/DSCheckboxGroup.js.map +2 -2
  69. package/dist/esm/ComboBox/index.js.map +1 -1
  70. package/dist/esm/ComboBoxFreeSolo/ComboBoxFreeSolo.js +28 -30
  71. package/dist/esm/ComboBoxFreeSolo/ComboBoxFreeSolo.js.map +2 -2
  72. package/dist/esm/ComboBoxFreeSolo/components/MultiValueLabel.js.map +2 -2
  73. package/dist/esm/ComboBoxFreeSolo/components/SingleValue.js.map +2 -2
  74. package/dist/esm/DateInput/props.js +12 -33
  75. package/dist/esm/DateInput/props.js.map +2 -2
  76. package/dist/esm/DateInputV2/components/helpers.js.map +2 -2
  77. package/dist/esm/DateInputV2/components/props.js +8 -25
  78. package/dist/esm/DateInputV2/components/props.js.map +2 -2
  79. package/dist/esm/DateInputV2/components/propsTypes.js +1 -4
  80. package/dist/esm/DateInputV2/components/propsTypes.js.map +2 -2
  81. package/dist/esm/DateInputV2/components/styled.js.map +2 -2
  82. package/dist/esm/DateInputV2/components/utils.js +1 -4
  83. package/dist/esm/DateInputV2/components/utils.js.map +2 -2
  84. package/dist/esm/FloatingLabelInput/getSvgPath.js.map +2 -2
  85. package/dist/esm/FormItem/Label/DSLabel.js +1 -9
  86. package/dist/esm/FormItem/Label/DSLabel.js.map +2 -2
  87. package/dist/esm/FormItem/Suffix/Suffix.js.map +2 -2
  88. package/dist/esm/FormItem/ValidationFieldWrapper.js.map +2 -2
  89. package/dist/esm/Input/index.js.map +1 -1
  90. package/dist/esm/InputGroup/AddonWrapper.js +1 -7
  91. package/dist/esm/InputGroup/AddonWrapper.js.map +2 -2
  92. package/dist/esm/InputGroup/props.js +5 -12
  93. package/dist/esm/InputGroup/props.js.map +2 -2
  94. package/dist/esm/InputMask/DSInputMask.js +2 -6
  95. package/dist/esm/InputMask/DSInputMask.js.map +2 -2
  96. package/dist/esm/InputMask/InputMaskContext.js.map +1 -1
  97. package/dist/esm/InputMask/addons/AutoCorrectedDatePipe.js +3 -12
  98. package/dist/esm/InputMask/addons/AutoCorrectedDatePipe.js.map +2 -2
  99. package/dist/esm/InputMask/mask_types/DateInputMask.js +1 -5
  100. package/dist/esm/InputMask/mask_types/DateInputMask.js.map +2 -2
  101. package/dist/esm/InputMask/mask_types/DateTimeInputMask.js +1 -5
  102. package/dist/esm/InputMask/mask_types/DateTimeInputMask.js.map +2 -2
  103. package/dist/esm/InputMask/mask_types/DictionaryInputMask.js +1 -7
  104. package/dist/esm/InputMask/mask_types/DictionaryInputMask.js.map +2 -2
  105. package/dist/esm/InputMask/mask_types/PhoneInputMask.js +1 -5
  106. package/dist/esm/InputMask/mask_types/PhoneInputMask.js.map +2 -2
  107. package/dist/esm/InputMask/mask_types/PhoneInternationalInputMask.js +1 -5
  108. package/dist/esm/InputMask/mask_types/PhoneInternationalInputMask.js.map +2 -2
  109. package/dist/esm/InputMask/mask_types/SsnInputMask.js +1 -5
  110. package/dist/esm/InputMask/mask_types/SsnInputMask.js.map +2 -2
  111. package/dist/esm/InputMask/mask_types/ZipCodeSearchInputMask.js +1 -5
  112. package/dist/esm/InputMask/mask_types/ZipCodeSearchInputMask.js.map +2 -2
  113. package/dist/esm/InputMask/mask_types/index.js.map +2 -2
  114. package/dist/esm/InputMask/props.js +19 -59
  115. package/dist/esm/InputMask/props.js.map +2 -2
  116. package/dist/esm/InputProtected/props.js +8 -21
  117. package/dist/esm/InputProtected/props.js.map +2 -2
  118. package/dist/esm/LargeInputText/DSLargeInputText.js +14 -23
  119. package/dist/esm/LargeInputText/DSLargeInputText.js.map +2 -2
  120. package/dist/esm/LargeInputText/props.js +13 -39
  121. package/dist/esm/LargeInputText/props.js.map +2 -2
  122. package/dist/esm/Radio/Circle.js.map +2 -2
  123. package/dist/esm/RadioGroup/DSRadioGroup.js.map +2 -2
  124. package/dist/esm/TimeInput/DSTimeInput.js +8 -19
  125. package/dist/esm/TimeInput/DSTimeInput.js.map +2 -2
  126. package/dist/esm/TimeInput/TimeInputImpl.js +1 -3
  127. package/dist/esm/TimeInput/TimeInputImpl.js.map +2 -2
  128. package/dist/esm/TimeInput/utils.js +1 -2
  129. package/dist/esm/TimeInput/utils.js.map +2 -2
  130. package/dist/esm/Toggle/DSToggleImpl.js.map +2 -2
  131. package/dist/esm/Toggle/DSToggleRender.js +13 -15
  132. package/dist/esm/Toggle/DSToggleRender.js.map +2 -2
  133. package/dist/esm/Toggle/toggleHelper.js +1 -7
  134. package/dist/esm/Toggle/toggleHelper.js.map +2 -2
  135. package/package.json +12 -12
@@ -1,45 +1,24 @@
1
1
  import * as React from "react";
2
2
  import { PropTypes } from "@elliemae/ds-utilities";
3
3
  const props = {
4
- containerProps: PropTypes.object.description(
5
- "props injected to date input wrapper node"
4
+ containerProps: PropTypes.object.description("props injected to date input wrapper node"),
5
+ innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]).description(
6
+ "inner ref for input wrapper"
6
7
  ),
7
- innerRef: PropTypes.oneOfType([
8
- PropTypes.func,
9
- PropTypes.shape({ current: PropTypes.any })
10
- ]).description("inner ref for input wrapper"),
11
8
  className: PropTypes.string.description("class for input"),
12
9
  style: PropTypes.object.description("Set style for the date input"),
13
- onBlur: PropTypes.func.description(
14
- "Triggers the onBlur when focus moves out of date input"
15
- ),
16
- onFocus: PropTypes.func.description(
17
- "Triggers the onFocus when the component gets the focus"
18
- ),
10
+ onBlur: PropTypes.func.description("Triggers the onBlur when focus moves out of date input"),
11
+ onFocus: PropTypes.func.description("Triggers the onFocus when the component gets the focus"),
19
12
  onClear: PropTypes.func.description("Triggers the onClear"),
20
13
  onKeyDown: PropTypes.func.description("Triggers the onKeyDown"),
21
- onChange: PropTypes.func.description(
22
- "Allows a function that is triggered once the date input changes"
23
- ),
24
- onError: PropTypes.func.description(
25
- "Triggers the onError once one input date is wrong"
26
- ),
14
+ onChange: PropTypes.func.description("Allows a function that is triggered once the date input changes"),
15
+ onError: PropTypes.func.description("Triggers the onError once one input date is wrong"),
27
16
  format: PropTypes.string.description("Format type for date input"),
28
- value: PropTypes.string.description(
29
- "Default value once the component is initialized"
30
- ),
31
- clearable: PropTypes.bool.description(
32
- "Whether the date input is clearable or not"
33
- ),
34
- disabled: PropTypes.bool.description(
35
- "Whether the date input is disabled or not"
36
- ),
37
- yearMaxRange: PropTypes.number.description(
38
- "Max year that can be accepted by the date input"
39
- ),
40
- yearMinRange: PropTypes.number.description(
41
- "Min year that can be accepted by the date input"
42
- )
17
+ value: PropTypes.string.description("Default value once the component is initialized"),
18
+ clearable: PropTypes.bool.description("Whether the date input is clearable or not"),
19
+ disabled: PropTypes.bool.description("Whether the date input is disabled or not"),
20
+ yearMaxRange: PropTypes.number.description("Max year that can be accepted by the date input"),
21
+ yearMinRange: PropTypes.number.description("Min year that can be accepted by the date input")
43
22
  };
44
23
  export {
45
24
  props
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/DateInput/props.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from '@elliemae/ds-utilities';\n\nexport const props = {\n /** props injected to date input wrapper node */\n containerProps: PropTypes.object.description(\n 'props injected to date input wrapper node',\n ),\n /** inner ref for input wrapper */\n innerRef: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({ current: PropTypes.any }),\n ]).description('inner ref for input wrapper'),\n /** class for input */\n className: PropTypes.string.description('class for input'),\n /**\n * Set style for the date input\n */\n style: PropTypes.object.description('Set style for the date input'),\n /**\n * Triggers the onBlur when focus moves out of date input\n */\n onBlur: PropTypes.func.description(\n 'Triggers the onBlur when focus moves out of date input',\n ),\n /**\n * Triggers the onFocus when the component gets the focus\n */\n onFocus: PropTypes.func.description(\n 'Triggers the onFocus when the component gets the focus',\n ),\n /**\n * Triggers the onClear\n */\n onClear: PropTypes.func.description('Triggers the onClear'),\n /**\n * Triggers the onKeyDown\n */\n onKeyDown: PropTypes.func.description('Triggers the onKeyDown'),\n /**\n * Allows a function that is triggered once the date input changes\n */\n onChange: PropTypes.func.description(\n 'Allows a function that is triggered once the date input changes',\n ),\n /**\n * Triggers the onError once one input date is wrong\n */\n onError: PropTypes.func.description(\n 'Triggers the onError once one input date is wrong',\n ),\n /**\n * Format type for date input\n */\n format: PropTypes.string.description('Format type for date input'),\n /**\n * Default value once the component is initialized\n */\n value: PropTypes.string.description(\n 'Default value once the component is initialized',\n ),\n /**\n * Whether the date input is clearable or not\n */\n clearable: PropTypes.bool.description(\n 'Whether the date input is clearable or not',\n ),\n /**\n * Whether the date input is disabled or not\n */\n disabled: PropTypes.bool.description(\n 'Whether the date input is disabled or not',\n ),\n /**\n * Max year that can be accepted by the date input\n */\n yearMaxRange: PropTypes.number.description(\n 'Max year that can be accepted by the date input',\n ),\n /**\n * Min year that can be accepted by the date input\n */\n yearMinRange: PropTypes.number.description(\n 'Min year that can be accepted by the date input',\n ),\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAEnB,MAAM,QAAQ;AAAA,EAEnB,gBAAgB,UAAU,OAAO;AAAA,IAC/B;AAAA,EACF;AAAA,EAEA,UAAU,UAAU,UAAU;AAAA,IAC5B,UAAU;AAAA,IACV,UAAU,MAAM,EAAE,SAAS,UAAU,IAAI,CAAC;AAAA,EAC5C,CAAC,EAAE,YAAY,6BAA6B;AAAA,EAE5C,WAAW,UAAU,OAAO,YAAY,iBAAiB;AAAA,EAIzD,OAAO,UAAU,OAAO,YAAY,8BAA8B;AAAA,EAIlE,QAAQ,UAAU,KAAK;AAAA,IACrB;AAAA,EACF;AAAA,EAIA,SAAS,UAAU,KAAK;AAAA,IACtB;AAAA,EACF;AAAA,EAIA,SAAS,UAAU,KAAK,YAAY,sBAAsB;AAAA,EAI1D,WAAW,UAAU,KAAK,YAAY,wBAAwB;AAAA,EAI9D,UAAU,UAAU,KAAK;AAAA,IACvB;AAAA,EACF;AAAA,EAIA,SAAS,UAAU,KAAK;AAAA,IACtB;AAAA,EACF;AAAA,EAIA,QAAQ,UAAU,OAAO,YAAY,4BAA4B;AAAA,EAIjE,OAAO,UAAU,OAAO;AAAA,IACtB;AAAA,EACF;AAAA,EAIA,WAAW,UAAU,KAAK;AAAA,IACxB;AAAA,EACF;AAAA,EAIA,UAAU,UAAU,KAAK;AAAA,IACvB;AAAA,EACF;AAAA,EAIA,cAAc,UAAU,OAAO;AAAA,IAC7B;AAAA,EACF;AAAA,EAIA,cAAc,UAAU,OAAO;AAAA,IAC7B;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from '@elliemae/ds-utilities';\n\nexport const props = {\n /** props injected to date input wrapper node */\n containerProps: PropTypes.object.description('props injected to date input wrapper node'),\n /** inner ref for input wrapper */\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]).description(\n 'inner ref for input wrapper',\n ),\n /** class for input */\n className: PropTypes.string.description('class for input'),\n /**\n * Set style for the date input\n */\n style: PropTypes.object.description('Set style for the date input'),\n /**\n * Triggers the onBlur when focus moves out of date input\n */\n onBlur: PropTypes.func.description('Triggers the onBlur when focus moves out of date input'),\n /**\n * Triggers the onFocus when the component gets the focus\n */\n onFocus: PropTypes.func.description('Triggers the onFocus when the component gets the focus'),\n /**\n * Triggers the onClear\n */\n onClear: PropTypes.func.description('Triggers the onClear'),\n /**\n * Triggers the onKeyDown\n */\n onKeyDown: PropTypes.func.description('Triggers the onKeyDown'),\n /**\n * Allows a function that is triggered once the date input changes\n */\n onChange: PropTypes.func.description('Allows a function that is triggered once the date input changes'),\n /**\n * Triggers the onError once one input date is wrong\n */\n onError: PropTypes.func.description('Triggers the onError once one input date is wrong'),\n /**\n * Format type for date input\n */\n format: PropTypes.string.description('Format type for date input'),\n /**\n * Default value once the component is initialized\n */\n value: PropTypes.string.description('Default value once the component is initialized'),\n /**\n * Whether the date input is clearable or not\n */\n clearable: PropTypes.bool.description('Whether the date input is clearable or not'),\n /**\n * Whether the date input is disabled or not\n */\n disabled: PropTypes.bool.description('Whether the date input is disabled or not'),\n /**\n * Max year that can be accepted by the date input\n */\n yearMaxRange: PropTypes.number.description('Max year that can be accepted by the date input'),\n /**\n * Min year that can be accepted by the date input\n */\n yearMinRange: PropTypes.number.description('Min year that can be accepted by the date input'),\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAEnB,MAAM,QAAQ;AAAA,EAEnB,gBAAgB,UAAU,OAAO,YAAY,2CAA2C;AAAA,EAExF,UAAU,UAAU,UAAU,CAAC,UAAU,MAAM,UAAU,MAAM,EAAE,SAAS,UAAU,IAAI,CAAC,CAAC,CAAC,EAAE;AAAA,IAC3F;AAAA,EACF;AAAA,EAEA,WAAW,UAAU,OAAO,YAAY,iBAAiB;AAAA,EAIzD,OAAO,UAAU,OAAO,YAAY,8BAA8B;AAAA,EAIlE,QAAQ,UAAU,KAAK,YAAY,wDAAwD;AAAA,EAI3F,SAAS,UAAU,KAAK,YAAY,wDAAwD;AAAA,EAI5F,SAAS,UAAU,KAAK,YAAY,sBAAsB;AAAA,EAI1D,WAAW,UAAU,KAAK,YAAY,wBAAwB;AAAA,EAI9D,UAAU,UAAU,KAAK,YAAY,iEAAiE;AAAA,EAItG,SAAS,UAAU,KAAK,YAAY,mDAAmD;AAAA,EAIvF,QAAQ,UAAU,OAAO,YAAY,4BAA4B;AAAA,EAIjE,OAAO,UAAU,OAAO,YAAY,iDAAiD;AAAA,EAIrF,WAAW,UAAU,KAAK,YAAY,4CAA4C;AAAA,EAIlF,UAAU,UAAU,KAAK,YAAY,2CAA2C;AAAA,EAIhF,cAAc,UAAU,OAAO,YAAY,iDAAiD;AAAA,EAI5F,cAAc,UAAU,OAAO,YAAY,iDAAiD;AAC9F;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/DateInputV2/components/helpers.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { cloneDeep } from 'lodash';\nimport { focusNextInput, focusPreviousInput } from './utils';\n\nconst callChange = (event, handlers, isArrowChange) => {\n if (event.target.name === 'day') handlers.onDayChange(event, isArrowChange);\n if (event.target.name === 'month')\n handlers.onMonthChange(event, isArrowChange);\n if (event.target.name === 'year') handlers.onYearChange(event, isArrowChange);\n};\n\nconst setTarget = (event, v) => {\n const n = cloneDeep(event);\n let newValue = parseInt(n.target.value || 0, 10) + v;\n if (newValue < 1) newValue = '01';\n if (event.target.name === 'day' && newValue > 31) newValue = 31;\n if (event.target.name === 'month' && newValue > 12) newValue = 12;\n n.target.value = newValue;\n return n;\n};\n\n// eslint-disable-next-line max-statements, complexity\nexport const onKeyDownHelper = (event, handlers) => {\n switch (event.key) {\n case 'ArrowLeft': {\n event.preventDefault();\n focusPreviousInput(event.target);\n break;\n }\n case 'ArrowUp': {\n event.preventDefault();\n const n = setTarget(event, 1);\n callChange(n, handlers, true);\n break;\n }\n case 'ArrowDown': {\n event.preventDefault();\n const n = setTarget(event, -1);\n callChange(n, handlers, true);\n break;\n }\n case 'ArrowRight': {\n event.preventDefault();\n focusNextInput(event.target);\n break;\n }\n case 'Tab': {\n if (event.shiftKey) break;\n if (event.target.value.length > 0 && event.target.name !== 'year')\n event.preventDefault();\n callChange(event, handlers);\n break;\n }\n case 'Backspace': {\n // HTML Date input behavior, clear everything when deleting\n event.preventDefault();\n const n = cloneDeep(event);\n n.target.value = '';\n callChange(n, handlers, true);\n break;\n }\n case 'Enter': {\n break;\n }\n default:\n break;\n }\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB,0BAA0B;AAEnD,MAAM,aAAa,CAAC,OAAO,UAAU,kBAAkB;AACrD,MAAI,MAAM,OAAO,SAAS;AAAO,aAAS,YAAY,OAAO,aAAa;AAC1E,MAAI,MAAM,OAAO,SAAS;AACxB,aAAS,cAAc,OAAO,aAAa;AAC7C,MAAI,MAAM,OAAO,SAAS;AAAQ,aAAS,aAAa,OAAO,aAAa;AAC9E;AAEA,MAAM,YAAY,CAAC,OAAO,MAAM;AAC9B,QAAM,IAAI,UAAU,KAAK;AACzB,MAAI,WAAW,SAAS,EAAE,OAAO,SAAS,GAAG,EAAE,IAAI;AACnD,MAAI,WAAW;AAAG,eAAW;AAC7B,MAAI,MAAM,OAAO,SAAS,SAAS,WAAW;AAAI,eAAW;AAC7D,MAAI,MAAM,OAAO,SAAS,WAAW,WAAW;AAAI,eAAW;AAC/D,IAAE,OAAO,QAAQ;AACjB,SAAO;AACT;AAGO,MAAM,kBAAkB,CAAC,OAAO,aAAa;AAClD,UAAQ,MAAM,KAAK;AAAA,IACjB,KAAK,aAAa;AAChB,YAAM,eAAe;AACrB,yBAAmB,MAAM,MAAM;AAC/B;AAAA,IACF;AAAA,IACA,KAAK,WAAW;AACd,YAAM,eAAe;AACrB,YAAM,IAAI,UAAU,OAAO,CAAC;AAC5B,iBAAW,GAAG,UAAU,IAAI;AAC5B;AAAA,IACF;AAAA,IACA,KAAK,aAAa;AAChB,YAAM,eAAe;AACrB,YAAM,IAAI,UAAU,OAAO,EAAE;AAC7B,iBAAW,GAAG,UAAU,IAAI;AAC5B;AAAA,IACF;AAAA,IACA,KAAK,cAAc;AACjB,YAAM,eAAe;AACrB,qBAAe,MAAM,MAAM;AAC3B;AAAA,IACF;AAAA,IACA,KAAK,OAAO;AACV,UAAI,MAAM;AAAU;AACpB,UAAI,MAAM,OAAO,MAAM,SAAS,KAAK,MAAM,OAAO,SAAS;AACzD,cAAM,eAAe;AACvB,iBAAW,OAAO,QAAQ;AAC1B;AAAA,IACF;AAAA,IACA,KAAK,aAAa;AAEhB,YAAM,eAAe;AACrB,YAAM,IAAI,UAAU,KAAK;AACzB,QAAE,OAAO,QAAQ;AACjB,iBAAW,GAAG,UAAU,IAAI;AAC5B;AAAA,IACF;AAAA,IACA,KAAK,SAAS;AACZ;AAAA,IACF;AAAA,IACA;AACE;AAAA,EACJ;AACF;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { cloneDeep } from 'lodash';\nimport { focusNextInput, focusPreviousInput } from './utils';\n\nconst callChange = (event, handlers, isArrowChange) => {\n if (event.target.name === 'day') handlers.onDayChange(event, isArrowChange);\n if (event.target.name === 'month') handlers.onMonthChange(event, isArrowChange);\n if (event.target.name === 'year') handlers.onYearChange(event, isArrowChange);\n};\n\nconst setTarget = (event, v) => {\n const n = cloneDeep(event);\n let newValue = parseInt(n.target.value || 0, 10) + v;\n if (newValue < 1) newValue = '01';\n if (event.target.name === 'day' && newValue > 31) newValue = 31;\n if (event.target.name === 'month' && newValue > 12) newValue = 12;\n n.target.value = newValue;\n return n;\n};\n\n// eslint-disable-next-line max-statements, complexity\nexport const onKeyDownHelper = (event, handlers) => {\n switch (event.key) {\n case 'ArrowLeft': {\n event.preventDefault();\n focusPreviousInput(event.target);\n break;\n }\n case 'ArrowUp': {\n event.preventDefault();\n const n = setTarget(event, 1);\n callChange(n, handlers, true);\n break;\n }\n case 'ArrowDown': {\n event.preventDefault();\n const n = setTarget(event, -1);\n callChange(n, handlers, true);\n break;\n }\n case 'ArrowRight': {\n event.preventDefault();\n focusNextInput(event.target);\n break;\n }\n case 'Tab': {\n if (event.shiftKey) break;\n if (event.target.value.length > 0 && event.target.name !== 'year') event.preventDefault();\n callChange(event, handlers);\n break;\n }\n case 'Backspace': {\n // HTML Date input behavior, clear everything when deleting\n event.preventDefault();\n const n = cloneDeep(event);\n n.target.value = '';\n callChange(n, handlers, true);\n break;\n }\n case 'Enter': {\n break;\n }\n default:\n break;\n }\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB,0BAA0B;AAEnD,MAAM,aAAa,CAAC,OAAO,UAAU,kBAAkB;AACrD,MAAI,MAAM,OAAO,SAAS;AAAO,aAAS,YAAY,OAAO,aAAa;AAC1E,MAAI,MAAM,OAAO,SAAS;AAAS,aAAS,cAAc,OAAO,aAAa;AAC9E,MAAI,MAAM,OAAO,SAAS;AAAQ,aAAS,aAAa,OAAO,aAAa;AAC9E;AAEA,MAAM,YAAY,CAAC,OAAO,MAAM;AAC9B,QAAM,IAAI,UAAU,KAAK;AACzB,MAAI,WAAW,SAAS,EAAE,OAAO,SAAS,GAAG,EAAE,IAAI;AACnD,MAAI,WAAW;AAAG,eAAW;AAC7B,MAAI,MAAM,OAAO,SAAS,SAAS,WAAW;AAAI,eAAW;AAC7D,MAAI,MAAM,OAAO,SAAS,WAAW,WAAW;AAAI,eAAW;AAC/D,IAAE,OAAO,QAAQ;AACjB,SAAO;AACT;AAGO,MAAM,kBAAkB,CAAC,OAAO,aAAa;AAClD,UAAQ,MAAM,KAAK;AAAA,IACjB,KAAK,aAAa;AAChB,YAAM,eAAe;AACrB,yBAAmB,MAAM,MAAM;AAC/B;AAAA,IACF;AAAA,IACA,KAAK,WAAW;AACd,YAAM,eAAe;AACrB,YAAM,IAAI,UAAU,OAAO,CAAC;AAC5B,iBAAW,GAAG,UAAU,IAAI;AAC5B;AAAA,IACF;AAAA,IACA,KAAK,aAAa;AAChB,YAAM,eAAe;AACrB,YAAM,IAAI,UAAU,OAAO,EAAE;AAC7B,iBAAW,GAAG,UAAU,IAAI;AAC5B;AAAA,IACF;AAAA,IACA,KAAK,cAAc;AACjB,YAAM,eAAe;AACrB,qBAAe,MAAM,MAAM;AAC3B;AAAA,IACF;AAAA,IACA,KAAK,OAAO;AACV,UAAI,MAAM;AAAU;AACpB,UAAI,MAAM,OAAO,MAAM,SAAS,KAAK,MAAM,OAAO,SAAS;AAAQ,cAAM,eAAe;AACxF,iBAAW,OAAO,QAAQ;AAC1B;AAAA,IACF;AAAA,IACA,KAAK,aAAa;AAEhB,YAAM,eAAe;AACrB,YAAM,IAAI,UAAU,KAAK;AACzB,QAAE,OAAO,QAAQ;AACjB,iBAAW,GAAG,UAAU,IAAI;AAC5B;AAAA,IACF;AAAA,IACA,KAAK,SAAS;AACZ;AAAA,IACF;AAAA,IACA;AACE;AAAA,EACJ;AACF;",
6
6
  "names": []
7
7
  }
@@ -2,35 +2,18 @@ import * as React from "react";
2
2
  import { PropTypes } from "@elliemae/ds-utilities";
3
3
  import { noop } from "lodash";
4
4
  const props = {
5
- containerProps: PropTypes.object.description(
6
- "Props to inject to date input wrapper"
7
- ),
8
- onBlur: PropTypes.func.description(
9
- "Triggers the onBlur when focus moves out of date input"
10
- ),
11
- onFocus: PropTypes.func.description(
12
- "Triggers the onFocus when the component gets the focus"
13
- ),
5
+ containerProps: PropTypes.object.description("Props to inject to date input wrapper"),
6
+ onBlur: PropTypes.func.description("Triggers the onBlur when focus moves out of date input"),
7
+ onFocus: PropTypes.func.description("Triggers the onFocus when the component gets the focus"),
14
8
  onKeyDown: PropTypes.func.description("Triggers the onKeyDown"),
15
- onChange: PropTypes.func.description(
16
- "Allows a function that is triggered once the date input changes"
17
- ),
9
+ onChange: PropTypes.func.description("Allows a function that is triggered once the date input changes"),
18
10
  onDateChange: PropTypes.func.description(
19
11
  " Triggers when the date is completely set and only once you have blurred the corresponding input. For example if you are editing the day and the year and month are already set, once you completely set the day it will trigger."
20
12
  ),
21
- onError: PropTypes.func.description(
22
- "Triggers the onError once one input date is wrong"
23
- ),
24
- value: PropTypes.string.description(
25
- "Default value once the component is initialized MMDDYYYY"
26
- ),
27
- disabled: PropTypes.bool.description(
28
- "Whether the date input is disabled or not"
29
- ),
30
- tabIndex: PropTypes.oneOfType([
31
- PropTypes.number,
32
- PropTypes.string
33
- ]).description("tab index")
13
+ onError: PropTypes.func.description("Triggers the onError once one input date is wrong"),
14
+ value: PropTypes.string.description("Default value once the component is initialized MMDDYYYY"),
15
+ disabled: PropTypes.bool.description("Whether the date input is disabled or not"),
16
+ tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("tab index")
34
17
  };
35
18
  const defaultProps = {
36
19
  onFocus: noop,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/DateInputV2/components/props.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from '@elliemae/ds-utilities';\nimport { noop } from 'lodash';\n\nexport const props = {\n /** Props to inject to date input wrapper */\n containerProps: PropTypes.object.description(\n 'Props to inject to date input wrapper',\n ),\n /**\n * Triggers the onBlur when focus moves out of date input\n */\n onBlur: PropTypes.func.description(\n 'Triggers the onBlur when focus moves out of date input',\n ),\n /**\n * Triggers the onFocus when the component gets the focus\n */\n onFocus: PropTypes.func.description(\n 'Triggers the onFocus when the component gets the focus',\n ),\n /**\n * Triggers the onKeyDown\n */\n onKeyDown: PropTypes.func.description('Triggers the onKeyDown'),\n /**\n * Allows a function that is triggered once the date input changes\n */\n onChange: PropTypes.func.description(\n 'Allows a function that is triggered once the date input changes',\n ),\n /**\n * Triggers when the date is completely set and only once you have blurred the\n * corresponding input. For example if you are editing the day and the year and month\n * are already set, once you completely set the day it will trigger.\n */\n onDateChange: PropTypes.func.description(\n ' Triggers when the date is completely set and only once you have blurred the corresponding input. For example if you are editing the day and the year and month are already set, once you completely set the day it will trigger.',\n ),\n /**\n * Triggers the onError once one input date is wrong\n */\n onError: PropTypes.func.description(\n 'Triggers the onError once one input date is wrong',\n ),\n /**\n * Default value once the component is initialized MMDDYYYY\n */\n value: PropTypes.string.description(\n 'Default value once the component is initialized MMDDYYYY',\n ),\n /**\n * Whether the date input is disabled or not\n */\n disabled: PropTypes.bool.description(\n 'Whether the date input is disabled or not',\n ),\n /**\n * tab index\n */\n tabIndex: PropTypes.oneOfType([\n PropTypes.number,\n PropTypes.string,\n ]).description('tab index'),\n};\n\nexport const defaultProps = {\n onFocus: noop,\n onBlur: noop,\n onChange: noop,\n onDateChange: noop,\n onKeyDown: noop,\n onError: noop,\n value: '',\n disabled: false,\n containerProps: {},\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAC1B,SAAS,YAAY;AAEd,MAAM,QAAQ;AAAA,EAEnB,gBAAgB,UAAU,OAAO;AAAA,IAC/B;AAAA,EACF;AAAA,EAIA,QAAQ,UAAU,KAAK;AAAA,IACrB;AAAA,EACF;AAAA,EAIA,SAAS,UAAU,KAAK;AAAA,IACtB;AAAA,EACF;AAAA,EAIA,WAAW,UAAU,KAAK,YAAY,wBAAwB;AAAA,EAI9D,UAAU,UAAU,KAAK;AAAA,IACvB;AAAA,EACF;AAAA,EAMA,cAAc,UAAU,KAAK;AAAA,IAC3B;AAAA,EACF;AAAA,EAIA,SAAS,UAAU,KAAK;AAAA,IACtB;AAAA,EACF;AAAA,EAIA,OAAO,UAAU,OAAO;AAAA,IACtB;AAAA,EACF;AAAA,EAIA,UAAU,UAAU,KAAK;AAAA,IACvB;AAAA,EACF;AAAA,EAIA,UAAU,UAAU,UAAU;AAAA,IAC5B,UAAU;AAAA,IACV,UAAU;AAAA,EACZ,CAAC,EAAE,YAAY,WAAW;AAC5B;AAEO,MAAM,eAAe;AAAA,EAC1B,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,cAAc;AAAA,EACd,WAAW;AAAA,EACX,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,EACV,gBAAgB,CAAC;AACnB;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from '@elliemae/ds-utilities';\nimport { noop } from 'lodash';\n\nexport const props = {\n /** Props to inject to date input wrapper */\n containerProps: PropTypes.object.description('Props to inject to date input wrapper'),\n /**\n * Triggers the onBlur when focus moves out of date input\n */\n onBlur: PropTypes.func.description('Triggers the onBlur when focus moves out of date input'),\n /**\n * Triggers the onFocus when the component gets the focus\n */\n onFocus: PropTypes.func.description('Triggers the onFocus when the component gets the focus'),\n /**\n * Triggers the onKeyDown\n */\n onKeyDown: PropTypes.func.description('Triggers the onKeyDown'),\n /**\n * Allows a function that is triggered once the date input changes\n */\n onChange: PropTypes.func.description('Allows a function that is triggered once the date input changes'),\n /**\n * Triggers when the date is completely set and only once you have blurred the\n * corresponding input. For example if you are editing the day and the year and month\n * are already set, once you completely set the day it will trigger.\n */\n onDateChange: PropTypes.func.description(\n ' Triggers when the date is completely set and only once you have blurred the corresponding input. For example if you are editing the day and the year and month are already set, once you completely set the day it will trigger.',\n ),\n /**\n * Triggers the onError once one input date is wrong\n */\n onError: PropTypes.func.description('Triggers the onError once one input date is wrong'),\n /**\n * Default value once the component is initialized MMDDYYYY\n */\n value: PropTypes.string.description('Default value once the component is initialized MMDDYYYY'),\n /**\n * Whether the date input is disabled or not\n */\n disabled: PropTypes.bool.description('Whether the date input is disabled or not'),\n /**\n * tab index\n */\n tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('tab index'),\n};\n\nexport const defaultProps = {\n onFocus: noop,\n onBlur: noop,\n onChange: noop,\n onDateChange: noop,\n onKeyDown: noop,\n onError: noop,\n value: '',\n disabled: false,\n containerProps: {},\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAC1B,SAAS,YAAY;AAEd,MAAM,QAAQ;AAAA,EAEnB,gBAAgB,UAAU,OAAO,YAAY,uCAAuC;AAAA,EAIpF,QAAQ,UAAU,KAAK,YAAY,wDAAwD;AAAA,EAI3F,SAAS,UAAU,KAAK,YAAY,wDAAwD;AAAA,EAI5F,WAAW,UAAU,KAAK,YAAY,wBAAwB;AAAA,EAI9D,UAAU,UAAU,KAAK,YAAY,iEAAiE;AAAA,EAMtG,cAAc,UAAU,KAAK;AAAA,IAC3B;AAAA,EACF;AAAA,EAIA,SAAS,UAAU,KAAK,YAAY,mDAAmD;AAAA,EAIvF,OAAO,UAAU,OAAO,YAAY,0DAA0D;AAAA,EAI9F,UAAU,UAAU,KAAK,YAAY,2CAA2C;AAAA,EAIhF,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE,YAAY,WAAW;AAC7F;AAEO,MAAM,eAAe;AAAA,EAC1B,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,cAAc;AAAA,EACd,WAAW;AAAA,EACX,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,EACV,gBAAgB,CAAC;AACnB;",
6
6
  "names": []
7
7
  }
@@ -1,10 +1,7 @@
1
1
  import * as React from "react";
2
2
  import PropTypes from "prop-types";
3
3
  const DateInputsPropTypes = {
4
- innerRef: PropTypes.oneOfType([
5
- PropTypes.func,
6
- PropTypes.shape({ current: PropTypes.any })
7
- ]),
4
+ innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]),
8
5
  onBlur: PropTypes.func,
9
6
  onChange: PropTypes.func,
10
7
  onDateChange: PropTypes.func,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/DateInputV2/components/propsTypes.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import PropTypes from 'prop-types';\n\nexport const DateInputsPropTypes = {\n innerRef: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({ current: PropTypes.any }),\n ]),\n onBlur: PropTypes.func,\n onChange: PropTypes.func,\n onDateChange: PropTypes.func,\n onCustomKeyDown: PropTypes.func,\n onError: PropTypes.func,\n format: PropTypes.string,\n showMonth: PropTypes.bool,\n showDay: PropTypes.bool,\n showYear: PropTypes.bool,\n step: PropTypes.number,\n yearMaxRange: PropTypes.number,\n disabled: PropTypes.bool,\n yearMinRange: PropTypes.number,\n time: PropTypes.string,\n tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,OAAO,eAAe;AAEf,MAAM,sBAAsB;AAAA,EACjC,UAAU,UAAU,UAAU;AAAA,IAC5B,UAAU;AAAA,IACV,UAAU,MAAM,EAAE,SAAS,UAAU,IAAI,CAAC;AAAA,EAC5C,CAAC;AAAA,EACD,QAAQ,UAAU;AAAA,EAClB,UAAU,UAAU;AAAA,EACpB,cAAc,UAAU;AAAA,EACxB,iBAAiB,UAAU;AAAA,EAC3B,SAAS,UAAU;AAAA,EACnB,QAAQ,UAAU;AAAA,EAClB,WAAW,UAAU;AAAA,EACrB,SAAS,UAAU;AAAA,EACnB,UAAU,UAAU;AAAA,EACpB,MAAM,UAAU;AAAA,EAChB,cAAc,UAAU;AAAA,EACxB,UAAU,UAAU;AAAA,EACpB,cAAc,UAAU;AAAA,EACxB,MAAM,UAAU;AAAA,EAChB,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AACpE;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import PropTypes from 'prop-types';\n\nexport const DateInputsPropTypes = {\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]),\n onBlur: PropTypes.func,\n onChange: PropTypes.func,\n onDateChange: PropTypes.func,\n onCustomKeyDown: PropTypes.func,\n onError: PropTypes.func,\n format: PropTypes.string,\n showMonth: PropTypes.bool,\n showDay: PropTypes.bool,\n showYear: PropTypes.bool,\n step: PropTypes.number,\n yearMaxRange: PropTypes.number,\n disabled: PropTypes.bool,\n yearMinRange: PropTypes.number,\n time: PropTypes.string,\n tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,OAAO,eAAe;AAEf,MAAM,sBAAsB;AAAA,EACjC,UAAU,UAAU,UAAU,CAAC,UAAU,MAAM,UAAU,MAAM,EAAE,SAAS,UAAU,IAAI,CAAC,CAAC,CAAC;AAAA,EAC3F,QAAQ,UAAU;AAAA,EAClB,UAAU,UAAU;AAAA,EACpB,cAAc,UAAU;AAAA,EACxB,iBAAiB,UAAU;AAAA,EAC3B,SAAS,UAAU;AAAA,EACnB,QAAQ,UAAU;AAAA,EAClB,WAAW,UAAU;AAAA,EACrB,SAAS,UAAU;AAAA,EACnB,UAAU,UAAU;AAAA,EACpB,MAAM,UAAU;AAAA,EAChB,cAAc,UAAU;AAAA,EACxB,UAAU,UAAU;AAAA,EACpB,cAAc,UAAU;AAAA,EACxB,MAAM,UAAU;AAAA,EAChB,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AACpE;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/DateInputV2/components/styled.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\n\n\nexport const DateInputFluidContainer = styled(Grid)`\n width: 100%;\n height: 100%;\n align-items: center;\n`;\n\nexport const DateInputWrapper = styled(Grid)`\n align-items: center;\n align-content: center;\n ${({ disabled, theme }) =>\n disabled\n ? `\n background: ${theme.colors.neutral[100]};\n color: ${theme.colors.neutral[500]};\n `\n : ''}\n width: 102px;\n\n &:focus {\n outline-style: none;\n box-shadow: none;\n border-color: transparent;\n }\n`;\n\nexport const DateInputInput = styled.input`\n outline: none;\n border: none;\n border-radius: 0;\n width: ${(props) => (props.size === 'l' ? '38px' : '25px')};\n height: ${(props) => props.theme.space.xs};\n ${({ disabled, theme }) =>\n disabled\n ? `\n background: ${theme.colors.neutral[100]};\n color: ${theme.colors.neutral[500]};\n `\n : ''}\n padding-left: 4px;\n padding-right: 0px;\n &::placeholder {\n font-size: 95%;\n font-style: italic;\n }\n :-moz-placeholder {\n font-size: 95%;\n font-style: italic;\n }\n\n ::-moz-placeholder {\n font-size: 95%;\n font-style: italic;\n }\n &:focus {\n background: ${({ theme }) => theme.colors.brand['300']};\n background-clip: content-box;\n }\n ::-moz-selection {\n background: transparent;\n }\n ::selection {\n background: transparent;\n }\n`;\n\nexport const DateInputDivider = styled.div`\n padding: 1px;\n text-align: center;\n`;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AACvB,SAAS,YAAY;AAGd,MAAM,0BAA0B,OAAO,IAAI;AAAA;AAAA;AAAA;AAAA;AAM3C,MAAM,mBAAmB,OAAO,IAAI;AAAA;AAAA;AAAA,IAGvC,CAAC,EAAE,UAAU,MAAM,MACnB,WACI;AAAA,kBACU,MAAM,OAAO,QAAQ;AAAA,aAC1B,MAAM,OAAO,QAAQ;AAAA,QAE1B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUD,MAAM,iBAAiB,OAAO;AAAA;AAAA;AAAA;AAAA,WAI1B,CAAC,UAAW,MAAM,SAAS,MAAM,SAAS;AAAA,YACzC,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA,IACrC,CAAC,EAAE,UAAU,MAAM,MACnB,WACI;AAAA,gBACQ,MAAM,OAAO,QAAQ;AAAA,WAC1B,MAAM,OAAO,QAAQ;AAAA,MAExB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAiBU,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAW7C,MAAM,mBAAmB,OAAO;AAAA;AAAA;AAAA;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\n\nexport const DateInputFluidContainer = styled(Grid)`\n width: 100%;\n height: 100%;\n align-items: center;\n`;\n\nexport const DateInputWrapper = styled(Grid)`\n align-items: center;\n align-content: center;\n ${({ disabled, theme }) =>\n disabled\n ? `\n background: ${theme.colors.neutral[100]};\n color: ${theme.colors.neutral[500]};\n `\n : ''}\n width: 102px;\n\n &:focus {\n outline-style: none;\n box-shadow: none;\n border-color: transparent;\n }\n`;\n\nexport const DateInputInput = styled.input`\n outline: none;\n border: none;\n border-radius: 0;\n width: ${(props) => (props.size === 'l' ? '38px' : '25px')};\n height: ${(props) => props.theme.space.xs};\n ${({ disabled, theme }) =>\n disabled\n ? `\n background: ${theme.colors.neutral[100]};\n color: ${theme.colors.neutral[500]};\n `\n : ''}\n padding-left: 4px;\n padding-right: 0px;\n &::placeholder {\n font-size: 95%;\n font-style: italic;\n }\n :-moz-placeholder {\n font-size: 95%;\n font-style: italic;\n }\n\n ::-moz-placeholder {\n font-size: 95%;\n font-style: italic;\n }\n &:focus {\n background: ${({ theme }) => theme.colors.brand['300']};\n background-clip: content-box;\n }\n ::-moz-selection {\n background: transparent;\n }\n ::selection {\n background: transparent;\n }\n`;\n\nexport const DateInputDivider = styled.div`\n padding: 1px;\n text-align: center;\n`;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AACvB,SAAS,YAAY;AAEd,MAAM,0BAA0B,OAAO,IAAI;AAAA;AAAA;AAAA;AAAA;AAM3C,MAAM,mBAAmB,OAAO,IAAI;AAAA;AAAA;AAAA,IAGvC,CAAC,EAAE,UAAU,MAAM,MACnB,WACI;AAAA,kBACU,MAAM,OAAO,QAAQ;AAAA,aAC1B,MAAM,OAAO,QAAQ;AAAA,QAE1B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUD,MAAM,iBAAiB,OAAO;AAAA;AAAA;AAAA;AAAA,WAI1B,CAAC,UAAW,MAAM,SAAS,MAAM,SAAS;AAAA,YACzC,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA,IACrC,CAAC,EAAE,UAAU,MAAM,MACnB,WACI;AAAA,gBACQ,MAAM,OAAO,QAAQ;AAAA,WAC1B,MAAM,OAAO,QAAQ;AAAA,MAExB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAiBU,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAW7C,MAAM,mBAAmB,OAAO;AAAA;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -31,10 +31,7 @@ const setNativeValue = (element, value) => {
31
31
  return;
32
32
  const valueSetter = Object.getOwnPropertyDescriptor(element, "value").set;
33
33
  const prototype = Object.getPrototypeOf(element);
34
- const prototypeValueSetter = Object.getOwnPropertyDescriptor(
35
- prototype,
36
- "value"
37
- ).set;
34
+ const prototypeValueSetter = Object.getOwnPropertyDescriptor(prototype, "value").set;
38
35
  if (valueSetter && valueSetter !== prototypeValueSetter) {
39
36
  prototypeValueSetter.call(element, value);
40
37
  } else {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/DateInputV2/components/utils.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\n/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport { addLeadingZeros } from '@elliemae/ds-utilities';\nimport { parseInt, isNaN } from '@elliemae/ds-utilities';\nimport moment from 'moment';\n\nconst currentYear = new Date().getFullYear();\n\nconst getNextSibling = (elem, selector) => {\n // Get the next sibling element\n let sibling = elem.nextElementSibling;\n // If there's no selector, return the first sibling\n if (!selector) return sibling;\n\n // If the sibling matches our selector, use it\n // If not, jump to the next sibling and continue the loop\n while (sibling) {\n if (sibling.matches(selector)) return sibling;\n sibling = sibling.nextElementSibling;\n }\n return sibling;\n};\n\nconst getPreviousSibling = (elem, selector) => {\n let sibling = elem.previousElementSibling;\n if (!selector) return sibling;\n while (sibling) {\n if (sibling.matches(selector)) return sibling;\n sibling = sibling.previousElementSibling;\n }\n return sibling;\n};\n\nexport const isArrowIncrementDecrement = (key) =>\n key === 'ArrowDown' || key === 'ArrowUp';\n\n// TODO remove and keep `true` behavior ( PUI-4141 )\nexport const setNativeValue = (element, value) => {\n if (!Object.getOwnPropertyDescriptor(element, 'value')) return;\n const valueSetter = Object.getOwnPropertyDescriptor(element, 'value').set;\n const prototype = Object.getPrototypeOf(element);\n const prototypeValueSetter = Object.getOwnPropertyDescriptor(\n prototype,\n 'value',\n ).set;\n\n if (valueSetter && valueSetter !== prototypeValueSetter) {\n prototypeValueSetter.call(element, value);\n } else {\n valueSetter.call(element, value);\n }\n element.dispatchEvent(new Event('input', { bubbles: true }));\n};\n\nconst formatTimeNumber = (value, shouldAddLeadingZeros, leadingZeros) => {\n if (value === null || value === undefined) return '';\n return shouldAddLeadingZeros\n ? addLeadingZeros(leadingZeros)(value)\n : String(value);\n};\n\nexport const getFormattedDay = (value) => {\n const v = value.length > 2 ? value.slice(-2) : value;\n const parsedValue = parseInt(v, 10);\n\n if (parsedValue > 31) return '31';\n return formatTimeNumber(parseTimeNumberFromText(v), true, 2);\n};\n\nexport const getShouldShortcircuitDay = (value) => {\n const v = value.length > 2 ? value.slice(-2) : value;\n const parsedValue = parseInt(v, 10);\n if (parsedValue > 31) return true;\n // if the first input is in range 4-9 then there is no other option\n // so we auto advance\n if (parsedValue > 3 && parsedValue < 10) return true;\n return false;\n};\n\nexport const getFormattedYear = (value) => {\n const v = value.length > 4 ? value.slice(-4) : value;\n if (parseInt(v) > 9999) return '9999';\n return formatTimeNumber(parseTimeNumberFromText(v), true, 4);\n};\n\nexport const getFormattedMonth = (value) => {\n const v = value.length > 2 ? value.slice(-2) : value;\n const parsedValue = parseInt(v, 10);\n if (parsedValue > 12) return '12';\n return formatTimeNumber(parseTimeNumberFromText(v), true, 2);\n};\n\nexport const getShouldShortcircuitMonth = (value) => {\n const v = value.length > 2 ? value.slice(-2) : value;\n const parsedValue = parseInt(v, 10);\n if (parsedValue > 12) return true;\n // if the first input is in range 2-9 then there is no other option\n // so we auto advance\n if (parsedValue > 1 && parsedValue < 10) return true;\n return false;\n};\n\nexport const parseTimeNumberFromText = (stringValue) => {\n const parsedInt = parseInt(stringValue);\n\n if (isNaN(parsedInt)) return null;\n\n return parsedInt;\n};\n\n// trigger onBlur for entire DateInput control if focus is not in day, month, year\nexport const triggerOnBlur = (blurEvent, onBlur = () => {}) => {\n const { target: currentEl = {}, relatedTarget } = blurEvent || {};\n const nextElement = currentEl.nextElementSibling;\n const { nextElementSibling } = nextElement || {};\n // relatedTarget points to the element that is currently having focus\n if (!nextElementSibling || nextElementSibling !== relatedTarget) {\n onBlur(blurEvent);\n }\n};\n\nexport const focusNextInput = (currentEl) => {\n getNextSibling(currentEl, 'input')?.focus();\n};\n\nexport const focusPreviousInput = (currentEl) => {\n getPreviousSibling(currentEl, 'input')?.focus();\n};\n\nexport const getValidTimeNumber = (\n { min, max },\n number,\n valueString = '',\n onError = () => null,\n) => {\n if (valueString === '0' || number === 0) return null;\n if (number === undefined || number === null) return null;\n if (number > max) {\n onError();\n return max;\n }\n if (number < min) {\n onError();\n return min;\n }\n return number;\n};\n\nexport const shouldFocusNextInput = (max, number = 0, stringValue) => {\n if (stringValue.length > 1) return true;\n return number * 10 > max;\n};\n\nexport const getDateValuesFromTime = (time, format) => {\n if (!time || !time.format) return {};\n const month = time.format('MM');\n const day = time.format('DD');\n const year = time.format('YYYY');\n return {\n month: getFormattedMonth(format, month),\n day: getFormattedDay(format, day),\n year: getFormattedYear(format, year),\n };\n};\n\nexport const resetTimeValues = () => ({\n month: '',\n day: '',\n year: '',\n});\n\nexport const onInputFocus = (e) => {\n e.preventDefault();\n e.stopPropagation();\n // we select the whole value to be able to override the value on first key\n // we don't use selection color to be consistent with the highlight of the input\n e.target.select();\n};\n\nexport const getNextTimeValue = (\n value,\n target,\n yearMinRange,\n yearMaxRange,\n step = 1,\n incrementing = true,\n) => {\n const parsedValue = parseTimeNumberFromText(value);\n let result = incrementing ? parsedValue + step : parsedValue - step;\n if (target === 'year') {\n if (result < yearMinRange) result = currentYear;\n if (result > yearMaxRange) result = currentYear;\n }\n return result;\n};\n\nexport const focusNextInputIfNeeded = (\n currentEl,\n max,\n number,\n stringValue,\n currentKey,\n) => {\n if (\n shouldFocusNextInput(max, number, stringValue) &&\n !isArrowIncrementDecrement(currentKey)\n ) {\n focusNextInput(currentEl);\n }\n};\n\nexport const commonInputProps = (digits = 2, onKeyDown, placeholder) => {\n const props = {\n pattern: '[0-9]*',\n placeholder,\n type: 'text',\n onKeyDown,\n onFocus: onInputFocus,\n };\n if (digits === 4) props.placeholder = 'YYYY';\n return props;\n};\n\nexport const handleCompletedDate = (\n time,\n date,\n show,\n INTERNAL_V2_NO_MUTATION,\n) => {\n // clone time to avoid mutation when INTERNAL_V2_NO_MUTATION is true\n const newDate = INTERNAL_V2_NO_MUTATION\n ? (time && moment(time)) || moment()\n : time || moment();\n\n const { year, month, day } = date;\n const { showYear, showMonth, showDay } = show;\n\n if (time && !year && !month && !day) return '';\n\n newDate.value = `${year}-${month}-${day}`;\n\n if (showMonth && month) newDate.month(parseInt(month - 1, 10));\n if (showDay && day) newDate.date(parseInt(day, 10));\n if (showYear && year) newDate.year(parseInt(year, 10));\n\n return newDate;\n};\n\nexport const isTimeCompletelySet = (date, show, range) => {\n let neededValues = [];\n const { year, month, day } = date;\n const { showYear, showMonth, showDay } = show;\n const { yearMinRange, yearMaxRange } = range;\n\n if (showMonth) neededValues = [...neededValues, month || null];\n if (showDay) neededValues = [...neededValues, day || null];\n if (showYear) neededValues = [...neededValues, year || null];\n\n const isValidYear = year < yearMaxRange && year > yearMinRange;\n\n return !neededValues.some((value) => !value) && isValidYear;\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,uBAAuB;AAChC,SAAS,UAAU,aAAa;AAChC,OAAO,YAAY;AAEnB,MAAM,cAAc,IAAI,KAAK,EAAE,YAAY;AAE3C,MAAM,iBAAiB,CAAC,MAAM,aAAa;AAEzC,MAAI,UAAU,KAAK;AAEnB,MAAI,CAAC;AAAU,WAAO;AAItB,SAAO,SAAS;AACd,QAAI,QAAQ,QAAQ,QAAQ;AAAG,aAAO;AACtC,cAAU,QAAQ;AAAA,EACpB;AACA,SAAO;AACT;AAEA,MAAM,qBAAqB,CAAC,MAAM,aAAa;AAC7C,MAAI,UAAU,KAAK;AACnB,MAAI,CAAC;AAAU,WAAO;AACtB,SAAO,SAAS;AACd,QAAI,QAAQ,QAAQ,QAAQ;AAAG,aAAO;AACtC,cAAU,QAAQ;AAAA,EACpB;AACA,SAAO;AACT;AAEO,MAAM,4BAA4B,CAAC,QACxC,QAAQ,eAAe,QAAQ;AAG1B,MAAM,iBAAiB,CAAC,SAAS,UAAU;AAChD,MAAI,CAAC,OAAO,yBAAyB,SAAS,OAAO;AAAG;AACxD,QAAM,cAAc,OAAO,yBAAyB,SAAS,OAAO,EAAE;AACtE,QAAM,YAAY,OAAO,eAAe,OAAO;AAC/C,QAAM,uBAAuB,OAAO;AAAA,IAClC;AAAA,IACA;AAAA,EACF,EAAE;AAEF,MAAI,eAAe,gBAAgB,sBAAsB;AACvD,yBAAqB,KAAK,SAAS,KAAK;AAAA,EAC1C,OAAO;AACL,gBAAY,KAAK,SAAS,KAAK;AAAA,EACjC;AACA,UAAQ,cAAc,IAAI,MAAM,SAAS,EAAE,SAAS,KAAK,CAAC,CA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;AAEpC,MAAI,aAAa;AAAO,YAAQ,MAAM,SAAS,QAAQ,GAAG,EAAE,CAAC;AAC7D,MAAI,WAAW;AAAK,YAAQ,KAAK,SAAS,KAAK,EAAE,CAAC;AAClD,MAAI,YAAY;AAAM,YAAQ,KAAK,SAAS,MAAM,EAAE,CAAC;AAErD,SAAO;AACT;AAEO,MAAM,sBAAsB,CAAC,MAAM,MAAM,UAAU;AACxD,MAAI,eAAe,CAAC;AACpB,QAAM,EAAE,MAAM,OAAO,IAAI,IAAI;AAC7B,QAAM,EAAE,UAAU,WAAW,QAAQ,IAAI;AACzC,QAAM,EAAE,cAAc,aAAa,IAAI;AAEvC,MAAI;AAAW,mBAAe,CAAC,GAAG,cAAc,SAAS,IAAI;AAC7D,MAAI;AAAS,mBAAe,CAAC,GAAG,cAAc,OAAO,IAAI;AACzD,MAAI;AAAU,mBAAe,CAAC,GAAG,cAAc,QAAQ,IAAI;AAE3D,QAAM,cAAc,OAAO,gBAAgB,OAAO;AAElD,SAAO,CAAC,aAAa,KAAK,CAAC,UAAU,CAAC,KAAK,KAAK;AAClD;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\n/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport { addLeadingZeros } from '@elliemae/ds-utilities';\nimport { parseInt, isNaN } from '@elliemae/ds-utilities';\nimport moment from 'moment';\n\nconst currentYear = new Date().getFullYear();\n\nconst getNextSibling = (elem, selector) => {\n // Get the next sibling element\n let sibling = elem.nextElementSibling;\n // If there's no selector, return the first sibling\n if (!selector) return sibling;\n\n // If the sibling matches our selector, use it\n // If not, jump to the next sibling and continue the loop\n while (sibling) {\n if (sibling.matches(selector)) return sibling;\n sibling = sibling.nextElementSibling;\n }\n return sibling;\n};\n\nconst getPreviousSibling = (elem, selector) => {\n let sibling = elem.previousElementSibling;\n if (!selector) return sibling;\n while (sibling) {\n if (sibling.matches(selector)) return sibling;\n sibling = sibling.previousElementSibling;\n }\n return sibling;\n};\n\nexport const isArrowIncrementDecrement = (key) => key === 'ArrowDown' || key === 'ArrowUp';\n\n// TODO remove and keep `true` behavior ( PUI-4141 )\nexport const setNativeValue = (element, value) => {\n if (!Object.getOwnPropertyDescriptor(element, 'value')) return;\n const valueSetter = Object.getOwnPropertyDescriptor(element, 'value').set;\n const prototype = Object.getPrototypeOf(element);\n const prototypeValueSetter = Object.getOwnPropertyDescriptor(prototype, 'value').set;\n\n if (valueSetter && valueSetter !== prototypeValueSetter) {\n prototypeValueSetter.call(element, value);\n } else {\n valueSetter.call(element, value);\n }\n element.dispatchEvent(new Event('input', { bubbles: true }));\n};\n\nconst formatTimeNumber = (value, shouldAddLeadingZeros, leadingZeros) => {\n if (value === null || value === undefined) return '';\n return shouldAddLeadingZeros ? addLeadingZeros(leadingZeros)(value) : String(value);\n};\n\nexport const getFormattedDay = (value) => {\n const v = value.length > 2 ? value.slice(-2) : value;\n const parsedValue = parseInt(v, 10);\n\n if (parsedValue > 31) return '31';\n return formatTimeNumber(parseTimeNumberFromText(v), true, 2);\n};\n\nexport const getShouldShortcircuitDay = (value) => {\n const v = value.length > 2 ? value.slice(-2) : value;\n const parsedValue = parseInt(v, 10);\n if (parsedValue > 31) return true;\n // if the first input is in range 4-9 then there is no other option\n // so we auto advance\n if (parsedValue > 3 && parsedValue < 10) return true;\n return false;\n};\n\nexport const getFormattedYear = (value) => {\n const v = value.length > 4 ? value.slice(-4) : value;\n if (parseInt(v) > 9999) return '9999';\n return formatTimeNumber(parseTimeNumberFromText(v), true, 4);\n};\n\nexport const getFormattedMonth = (value) => {\n const v = value.length > 2 ? value.slice(-2) : value;\n const parsedValue = parseInt(v, 10);\n if (parsedValue > 12) return '12';\n return formatTimeNumber(parseTimeNumberFromText(v), true, 2);\n};\n\nexport const getShouldShortcircuitMonth = (value) => {\n const v = value.length > 2 ? value.slice(-2) : value;\n const parsedValue = parseInt(v, 10);\n if (parsedValue > 12) return true;\n // if the first input is in range 2-9 then there is no other option\n // so we auto advance\n if (parsedValue > 1 && parsedValue < 10) return true;\n return false;\n};\n\nexport const parseTimeNumberFromText = (stringValue) => {\n const parsedInt = parseInt(stringValue);\n\n if (isNaN(parsedInt)) return null;\n\n return parsedInt;\n};\n\n// trigger onBlur for entire DateInput control if focus is not in day, month, year\nexport const triggerOnBlur = (blurEvent, onBlur = () => {}) => {\n const { target: currentEl = {}, relatedTarget } = blurEvent || {};\n const nextElement = currentEl.nextElementSibling;\n const { nextElementSibling } = nextElement || {};\n // relatedTarget points to the element that is currently having focus\n if (!nextElementSibling || nextElementSibling !== relatedTarget) {\n onBlur(blurEvent);\n }\n};\n\nexport const focusNextInput = (currentEl) => {\n getNextSibling(currentEl, 'input')?.focus();\n};\n\nexport const focusPreviousInput = (currentEl) => {\n getPreviousSibling(currentEl, 'input')?.focus();\n};\n\nexport const getValidTimeNumber = ({ min, max }, number, valueString = '', onError = () => null) => {\n if (valueString === '0' || number === 0) return null;\n if (number === undefined || number === null) return null;\n if (number > max) {\n onError();\n return max;\n }\n if (number < min) {\n onError();\n return min;\n }\n return number;\n};\n\nexport const shouldFocusNextInput = (max, number = 0, stringValue) => {\n if (stringValue.length > 1) return true;\n return number * 10 > max;\n};\n\nexport const getDateValuesFromTime = (time, format) => {\n if (!time || !time.format) return {};\n const month = time.format('MM');\n const day = time.format('DD');\n const year = time.format('YYYY');\n return {\n month: getFormattedMonth(format, month),\n day: getFormattedDay(format, day),\n year: getFormattedYear(format, year),\n };\n};\n\nexport const resetTimeValues = () => ({\n month: '',\n day: '',\n year: '',\n});\n\nexport const onInputFocus = (e) => {\n e.preventDefault();\n e.stopPropagation();\n // we select the whole value to be able to override the value on first key\n // we don't use selection color to be consistent with the highlight of the input\n e.target.select();\n};\n\nexport const getNextTimeValue = (value, target, yearMinRange, yearMaxRange, step = 1, incrementing = true) => {\n const parsedValue = parseTimeNumberFromText(value);\n let result = incrementing ? parsedValue + step : parsedValue - step;\n if (target === 'year') {\n if (result < yearMinRange) result = currentYear;\n if (result > yearMaxRange) result = currentYear;\n }\n return result;\n};\n\nexport const focusNextInputIfNeeded = (currentEl, max, number, stringValue, currentKey) => {\n if (shouldFocusNextInput(max, number, stringValue) && !isArrowIncrementDecrement(currentKey)) {\n focusNextInput(currentEl);\n }\n};\n\nexport const commonInputProps = (digits = 2, onKeyDown, placeholder) => {\n const props = {\n pattern: '[0-9]*',\n placeholder,\n type: 'text',\n onKeyDown,\n onFocus: onInputFocus,\n };\n if (digits === 4) props.placeholder = 'YYYY';\n return props;\n};\n\nexport const handleCompletedDate = (time, date, show, INTERNAL_V2_NO_MUTATION) => {\n // clone time to avoid mutation when INTERNAL_V2_NO_MUTATION is true\n const newDate = INTERNAL_V2_NO_MUTATION ? (time && moment(time)) || moment() : time || moment();\n\n const { year, month, day } = date;\n const { showYear, showMonth, showDay } = show;\n\n if (time && !year && !month && !day) return '';\n\n newDate.value = `${year}-${month}-${day}`;\n\n if (showMonth && month) newDate.month(parseInt(month - 1, 10));\n if (showDay && day) newDate.date(parseInt(day, 10));\n if (showYear && year) newDate.year(parseInt(year, 10));\n\n return newDate;\n};\n\nexport const isTimeCompletelySet = (date, show, range) => {\n let neededValues = [];\n const { year, month, day } = date;\n const { showYear, showMonth, showDay } = show;\n const { yearMinRange, yearMaxRange } = range;\n\n if (showMonth) neededValues = [...neededValues, month || null];\n if (showDay) neededValues = [...neededValues, day || null];\n if (showYear) neededValues = [...neededValues, year || null];\n\n const isValidYear = year < yearMaxRange && year > yearMinRange;\n\n return !neededValues.some((value) => !value) && isValidYear;\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,uBAAuB;AAChC,SAAS,UAAU,aAAa;AAChC,OAAO,YAAY;AAEnB,MAAM,cAAc,IAAI,KAAK,EAAE,YAAY;AAE3C,MAAM,iBAAiB,CAAC,MAAM,aAAa;AAEzC,MAAI,UAAU,KAAK;AAEnB,MAAI,CAAC;AAAU,WAAO;AAItB,SAAO,SAAS;AACd,QAAI,QAAQ,QAAQ,QAAQ;A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AAI;AAC7D,MAAI;AAAS,mBAAe,CAAC,GAAG,cAAc,OAAO,IAAI;AACzD,MAAI;AAAU,mBAAe,CAAC,GAAG,cAAc,QAAQ,IAAI;AAE3D,QAAM,cAAc,OAAO,gBAAgB,OAAO;AAElD,SAAO,CAAC,aAAa,KAAK,CAAC,UAAU,CAAC,KAAK,KAAK;AAClD;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/FloatingLabelInput/getSvgPath.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable prefer-template,max-statements,no-nested-ternary */\nfunction getSvgPath({\n labelWidth = 50,\n width = 200,\n height = 35,\n radiusStyle,\n hasRightRadius = true,\n hasLeftRadius = true,\n}) {\n const notchWidth = labelWidth;\n const isRtl = false;\n\n const radius = parseFloat(radiusStyle);\n const cornerWidth = radius + 1.3;\n const leadingStrokeLength = 4;\n const paddedNotchWidth = notchWidth + 8;\n\n let extraSizeForH = 0;\n let extraSizeForLeftV = 0;\n let extraSizeForRightV = 0;\n let extraSizeForTopH = radius;\n\n if (!hasRightRadius) {\n extraSizeForH += radius;\n extraSizeForRightV = radius * 2;\n }\n if (!hasLeftRadius) {\n extraSizeForH += radius;\n extraSizeForLeftV = radius * 2;\n }\n\n if ((!hasLeftRadius && hasRightRadius) || (hasRightRadius && hasLeftRadius)) {\n extraSizeForTopH = 0;\n }\n\n const pathMiddle =\n '' +\n (hasRightRadius\n ? 'a' + radius + ',' + radius + ' 0 0 1 ' + radius + ',' + radius\n : '') +\n 'v' +\n (height - (2 * cornerWidth - (extraSizeForRightV + 1.5))) + // right vertical line\n (hasRightRadius\n ? 'a' + radius + ',' + radius + ' 0 0 1 ' + -radius + ',' + radius\n : '') +\n 'h' +\n (-width + 2 * cornerWidth - extraSizeForH) +\n (hasLeftRadius\n ? 'a' + radius + ',' + radius + ' 0 0 1 ' + -radius + ',' + -radius\n : '') +\n 'v' +\n (-height + (2 * cornerWidth - (extraSizeForLeftV + 1.5))) + // left vertical line\n (hasLeftRadius\n ? 'a' + radius + ',' + radius + ' 0 0 1 ' + radius + ',' + -radius\n : '');\n\n let path;\n if (!isRtl) {\n path =\n '' +\n 'M' +\n (cornerWidth + leadingStrokeLength + paddedNotchWidth) +\n ',' +\n 0.5 +\n 'h' +\n (width -\n 2 * cornerWidth -\n paddedNotchWidth -\n leadingStrokeLength +\n extraSizeForTopH) +\n pathMiddle +\n 'h' +\n leadingStrokeLength;\n } else {\n path =\n '' +\n 'M' +\n (width - cornerWidth - leadingStrokeLength) +\n ',' +\n 0.5 +\n 'h' +\n leadingStrokeLength +\n pathMiddle +\n 'h' +\n (width - 2 * cornerWidth - paddedNotchWidth - leadingStrokeLength);\n }\n return path;\n}\n\nexport { getSvgPath };\nexport default getSvgPath;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,WAAW;AAAA,EAClB,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,SAAS;AAAA,EACT;AAAA,EACA,iBAAiB;AAAA,EACjB,gBAAgB;AAClB,GAAG;AACD,QAAM,aAAa;AACnB,QAAM,QAAQ;AAEd,QAAM,SAAS,WAAW,WAAW;AACrC,QAAM,cAAc,SAAS;AAC7B,QAAM,sBAAsB;AAC5B,QAAM,mBAAmB,aAAa;AAEtC,MAAI,gBAAgB;AACpB,MAAI,oBAAoB;AACxB,MAAI,qBAAqB;AACzB,MAAI,mBAAmB;AAEvB,MAAI,CAAC,gBAAgB;AACnB,qBAAiB;AACjB,yBAAqB,SAAS;AAAA,EAChC;AACA,MAAI,CAAC,eAAe;AAClB,qBAAiB;AACjB,wBAAoB,SAAS;AAAA,EAC/B;AAEA,MAAK,CAAC,iBAAiB,kBAAoB,kBAAkB,eAAgB;AAC3E,uBAAmB;AAAA,EACrB;AAEA,QAAM,cAEH,iBACG,MAAM,SAAS,MAAM,SAAS,YAAY,SAAS,MAAM,SACzD,MACJ,OACC,UAAU,IAAI,eAAe,qBAAqB,UAClD,iBACG,MAAM,SAAS,MAAM,SAAS,YAAY,CAAC,SAAS,MAAM,SAC1D,MACJ,OACC,CAAC,QAAQ,IAAI,cAAc,kBAC3B,gBACG,MAAM,SAAS,MAAM,SAAS,YAAY,CAAC,SAAS,MAAM,CAAC,SAC3D,MACJ,OACC,CAAC,UAAU,IAAI,eAAe,oBAAoB,UAClD,gBACG,MAAM,SAAS,MAAM,SAAS,YAAY,SAAS,MAAM,CAAC,SAC1D;AAEN,MAAI;AACJ,MAAI,CAAC,OAAO;AACV,WACE,OAEC,cAAc,sBAAsB,oBACrC,MACA,MACA,OACC,QACC,IAAI,cACJ,mBACA,sBACA,oBACF,aACA,MACA;AAAA,EACJ,OAAO;AACL,WACE,OAEC,QAAQ,cAAc,uBACvB,MACA,MACA,MACA,sBACA,aACA,OACC,QAAQ,IAAI,cAAc,mBAAmB;AAAA,EAClD;AACA,SAAO;AACT;AAGA,IAAO,qBAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable prefer-template,max-statements,no-nested-ternary */\nfunction getSvgPath({\n labelWidth = 50,\n width = 200,\n height = 35,\n radiusStyle,\n hasRightRadius = true,\n hasLeftRadius = true,\n}) {\n const notchWidth = labelWidth;\n const isRtl = false;\n\n const radius = parseFloat(radiusStyle);\n const cornerWidth = radius + 1.3;\n const leadingStrokeLength = 4;\n const paddedNotchWidth = notchWidth + 8;\n\n let extraSizeForH = 0;\n let extraSizeForLeftV = 0;\n let extraSizeForRightV = 0;\n let extraSizeForTopH = radius;\n\n if (!hasRightRadius) {\n extraSizeForH += radius;\n extraSizeForRightV = radius * 2;\n }\n if (!hasLeftRadius) {\n extraSizeForH += radius;\n extraSizeForLeftV = radius * 2;\n }\n\n if ((!hasLeftRadius && hasRightRadius) || (hasRightRadius && hasLeftRadius)) {\n extraSizeForTopH = 0;\n }\n\n const pathMiddle =\n '' +\n (hasRightRadius ? 'a' + radius + ',' + radius + ' 0 0 1 ' + radius + ',' + radius : '') +\n 'v' +\n (height - (2 * cornerWidth - (extraSizeForRightV + 1.5))) + // right vertical line\n (hasRightRadius ? 'a' + radius + ',' + radius + ' 0 0 1 ' + -radius + ',' + radius : '') +\n 'h' +\n (-width + 2 * cornerWidth - extraSizeForH) +\n (hasLeftRadius ? 'a' + radius + ',' + radius + ' 0 0 1 ' + -radius + ',' + -radius : '') +\n 'v' +\n (-height + (2 * cornerWidth - (extraSizeForLeftV + 1.5))) + // left vertical line\n (hasLeftRadius ? 'a' + radius + ',' + radius + ' 0 0 1 ' + radius + ',' + -radius : '');\n\n let path;\n if (!isRtl) {\n path =\n '' +\n 'M' +\n (cornerWidth + leadingStrokeLength + paddedNotchWidth) +\n ',' +\n 0.5 +\n 'h' +\n (width - 2 * cornerWidth - paddedNotchWidth - leadingStrokeLength + extraSizeForTopH) +\n pathMiddle +\n 'h' +\n leadingStrokeLength;\n } else {\n path =\n '' +\n 'M' +\n (width - cornerWidth - leadingStrokeLength) +\n ',' +\n 0.5 +\n 'h' +\n leadingStrokeLength +\n pathMiddle +\n 'h' +\n (width - 2 * cornerWidth - paddedNotchWidth - leadingStrokeLength);\n }\n return path;\n}\n\nexport { getSvgPath };\nexport default getSvgPath;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,WAAW;AAAA,EAClB,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,SAAS;AAAA,EACT;AAAA,EACA,iBAAiB;AAAA,EACjB,gBAAgB;AAClB,GAAG;AACD,QAAM,aAAa;AACnB,QAAM,QAAQ;AAEd,QAAM,SAAS,WAAW,WAAW;AACrC,QAAM,cAAc,SAAS;AAC7B,QAAM,sBAAsB;AAC5B,QAAM,mBAAmB,aAAa;AAEtC,MAAI,gBAAgB;AACpB,MAAI,oBAAoB;AACxB,MAAI,qBAAqB;AACzB,MAAI,mBAAmB;AAEvB,MAAI,CAAC,gBAAgB;AACnB,qBAAiB;AACjB,yBAAqB,SAAS;AAAA,EAChC;AACA,MAAI,CAAC,eAAe;AAClB,qBAAiB;AACjB,wBAAoB,SAAS;AAAA,EAC/B;AAEA,MAAK,CAAC,iBAAiB,kBAAoB,kBAAkB,eAAgB;AAC3E,uBAAmB;AAAA,EACrB;AAEA,QAAM,cAEH,iBAAiB,MAAM,SAAS,MAAM,SAAS,YAAY,SAAS,MAAM,SAAS,MACpF,OACC,UAAU,IAAI,eAAe,qBAAqB,UAClD,iBAAiB,MAAM,SAAS,MAAM,SAAS,YAAY,CAAC,SAAS,MAAM,SAAS,MACrF,OACC,CAAC,QAAQ,IAAI,cAAc,kBAC3B,gBAAgB,MAAM,SAAS,MAAM,SAAS,YAAY,CAAC,SAAS,MAAM,CAAC,SAAS,MACrF,OACC,CAAC,UAAU,IAAI,eAAe,oBAAoB,UAClD,gBAAgB,MAAM,SAAS,MAAM,SAAS,YAAY,SAAS,MAAM,CAAC,SAAS;AAEtF,MAAI;AACJ,MAAI,CAAC,OAAO;AACV,WACE,OAEC,cAAc,sBAAsB,oBACrC,MACA,MACA,OACC,QAAQ,IAAI,cAAc,mBAAmB,sBAAsB,oBACpE,aACA,MACA;AAAA,EACJ,OAAO;AACL,WACE,OAEC,QAAQ,cAAc,uBACvB,MACA,MACA,MACA,sBACA,aACA,OACC,QAAQ,IAAI,cAAc,mBAAmB;AAAA,EAClD;AACA,SAAO;AACT;AAGA,IAAO,qBAAQ;",
6
6
  "names": []
7
7
  }
@@ -6,15 +6,7 @@ import { DSTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
6
6
  import { RequiredMark } from "../../RequiredMark";
7
7
  const blockName = "em-ds-label";
8
8
  const Text = aggregatedClasses("span")(blockName, "text");
9
- const DSLabel = ({
10
- children,
11
- label,
12
- htmlFor,
13
- required,
14
- optional,
15
- truncateText = true,
16
- isGroup = false
17
- }) => {
9
+ const DSLabel = ({ children, label, htmlFor, required, optional, truncateText = true, isGroup = false }) => {
18
10
  const Tag = isGroup ? "legend" : "label";
19
11
  return /* @__PURE__ */ jsxs(Tag, {
20
12
  className: `${blockName}${isGroup ? ` ${blockName}--group` : ""}`,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/FormItem/Label/DSLabel.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable jsx-a11y/label-has-associated-control */\n/* eslint-disable react/no-unknown-property, jsx-a11y/label-has-for */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { DSTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { RequiredMark } from '../../RequiredMark';\n\nconst blockName = 'em-ds-label';\n\nconst Text = aggregatedClasses('span')(blockName, 'text');\n\nconst DSLabel = ({\n children,\n label,\n htmlFor,\n required,\n optional,\n truncateText = true,\n isGroup = false,\n}) => {\n const Tag = isGroup ? 'legend' : 'label';\n\n return (\n <Tag\n className={`${blockName}${isGroup ? ` ${blockName}--group` : ''}`}\n htmlFor={htmlFor}\n >\n {truncateText ? (\n <DSTruncatedTooltipText value={children || label} />\n ) : (\n <Text>{label}</Text>\n )}\n <RequiredMark optional={optional} required={required} />\n </Tag>\n );\n};\n\nDSLabel.propTypes = {\n children: PropTypes.string,\n label: PropTypes.string,\n htmlFor: PropTypes.string,\n required: PropTypes.bool,\n optional: PropTypes.bool,\n truncateText: PropTypes.bool,\n isGroup: PropTypes.bool,\n};\n\nexport { DSLabel };\nexport default DSLabel;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACwBnB,SAKI,KALJ;AArBJ,OAAO,eAAe;AACtB,SAAS,yBAAyB;AAClC,SAAS,8BAA8B;AACvC,SAAS,oBAAoB;AAE7B,MAAM,YAAY;AAElB,MAAM,OAAO,kBAAkB,MAAM,EAAE,WAAW,MAAM;AAExD,MAAM,UAAU,CAAC;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf,UAAU;AACZ,MAAM;AACJ,QAAM,MAAM,UAAU,WAAW;AAEjC,SACE,qBAAC;AAAA,IACC,WAAW,GAAG,YAAY,UAAU,IAAI,qBAAqB;AAAA,IAC7D;AAAA,IAEC;AAAA,qBACC,oBAAC;AAAA,QAAuB,OAAO,YAAY;AAAA,OAAO,IAElD,oBAAC;AAAA,QAAM;AAAA,OAAM;AAAA,MAEf,oBAAC;AAAA,QAAa;AAAA,QAAoB;AAAA,OAAoB;AAAA;AAAA,GACxD;AAEJ;AAEA,QAAQ,YAAY;AAAA,EAClB,UAAU,UAAU;AAAA,EACpB,OAAO,UAAU;AAAA,EACjB,SAAS,UAAU;AAAA,EACnB,UAAU,UAAU;AAAA,EACpB,UAAU,UAAU;AAAA,EACpB,cAAc,UAAU;AAAA,EACxB,SAAS,UAAU;AACrB;AAGA,IAAO,kBAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable jsx-a11y/label-has-associated-control */\n/* eslint-disable react/no-unknown-property, jsx-a11y/label-has-for */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { DSTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { RequiredMark } from '../../RequiredMark';\n\nconst blockName = 'em-ds-label';\n\nconst Text = aggregatedClasses('span')(blockName, 'text');\n\nconst DSLabel = ({ children, label, htmlFor, required, optional, truncateText = true, isGroup = false }) => {\n const Tag = isGroup ? 'legend' : 'label';\n\n return (\n <Tag className={`${blockName}${isGroup ? ` ${blockName}--group` : ''}`} htmlFor={htmlFor}>\n {truncateText ? <DSTruncatedTooltipText value={children || label} /> : <Text>{label}</Text>}\n <RequiredMark optional={optional} required={required} />\n </Tag>\n );\n};\n\nDSLabel.propTypes = {\n children: PropTypes.string,\n label: PropTypes.string,\n htmlFor: PropTypes.string,\n required: PropTypes.bool,\n optional: PropTypes.bool,\n truncateText: PropTypes.bool,\n isGroup: PropTypes.bool,\n};\n\nexport { DSLabel };\nexport default DSLabel;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACgBnB,SACkB,KADlB;AAbJ,OAAO,eAAe;AACtB,SAAS,yBAAyB;AAClC,SAAS,8BAA8B;AACvC,SAAS,oBAAoB;AAE7B,MAAM,YAAY;AAElB,MAAM,OAAO,kBAAkB,MAAM,EAAE,WAAW,MAAM;AAExD,MAAM,UAAU,CAAC,EAAE,UAAU,OAAO,SAAS,UAAU,UAAU,eAAe,MAAM,UAAU,MAAM,MAAM;AAC1G,QAAM,MAAM,UAAU,WAAW;AAEjC,SACE,qBAAC;AAAA,IAAI,WAAW,GAAG,YAAY,UAAU,IAAI,qBAAqB;AAAA,IAAM;AAAA,IACrE;AAAA,qBAAe,oBAAC;AAAA,QAAuB,OAAO,YAAY;AAAA,OAAO,IAAK,oBAAC;AAAA,QAAM;AAAA,OAAM;AAAA,MACpF,oBAAC;AAAA,QAAa;AAAA,QAAoB;AAAA,OAAoB;AAAA;AAAA,GACxD;AAEJ;AAEA,QAAQ,YAAY;AAAA,EAClB,UAAU,UAAU;AAAA,EACpB,OAAO,UAAU;AAAA,EACjB,SAAS,UAAU;AAAA,EACnB,UAAU,UAAU;AAAA,EACpB,UAAU,UAAU;AAAA,EACpB,cAAc,UAAU;AAAA,EACxB,SAAS,UAAU;AACrB;AAGA,IAAO,kBAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/FormItem/Suffix/Suffix.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable consistent-return */\nimport { styled } from '@elliemae/ds-system';\n\nexport const Suffix = styled.div`\n height: 2.16rem;\n align-items: center;\n display: flex;\n ${props => {\n if (props.label && !props.withFeedback) {\n return `\n padding-top: 1.2rem;\n `;\n }\n if (!props.label && !props.withFeedback) {\n return `\n padding-top: 1rem;\n `;\n }\n }}\n`;\n\nexport const SuffixInputWrapper = styled.div`\n padding-right: 0.32rem;\n flex: 1;\n`;\nexport const SuffixWrapper = styled.div`\n display: flex;\n align-items: center;\n`;\n\nexport default Suffix;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,cAAc;AAEhB,MAAM,SAAS,OAAO;AAAA;AAAA;AAAA;AAAA,IAIzB,WAAS;AACT,MAAI,MAAM,SAAS,CAAC,MAAM,cAAc;AACtC,WAAO;AAAA;AAAA;AAAA,EAGT;AACA,MAAI,CAAC,MAAM,SAAS,CAAC,MAAM,cAAc;AACvC,WAAO;AAAA;AAAA;AAAA,EAGT;AACF;AAAA;AAGK,MAAM,qBAAqB,OAAO;AAAA;AAAA;AAAA;AAIlC,MAAM,gBAAgB,OAAO;AAAA;AAAA;AAAA;AAKpC,IAAO,iBAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable consistent-return */\nimport { styled } from '@elliemae/ds-system';\n\nexport const Suffix = styled.div`\n height: 2.16rem;\n align-items: center;\n display: flex;\n ${(props) => {\n if (props.label && !props.withFeedback) {\n return `\n padding-top: 1.2rem;\n `;\n }\n if (!props.label && !props.withFeedback) {\n return `\n padding-top: 1rem;\n `;\n }\n }}\n`;\n\nexport const SuffixInputWrapper = styled.div`\n padding-right: 0.32rem;\n flex: 1;\n`;\nexport const SuffixWrapper = styled.div`\n display: flex;\n align-items: center;\n`;\n\nexport default Suffix;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,cAAc;AAEhB,MAAM,SAAS,OAAO;AAAA;AAAA;AAAA;AAAA,IAIzB,CAAC,UAAU;AACX,MAAI,MAAM,SAAS,CAAC,MAAM,cAAc;AACtC,WAAO;AAAA;AAAA;AAAA,EAGT;AACA,MAAI,CAAC,MAAM,SAAS,CAAC,MAAM,cAAc;AACvC,WAAO;AAAA;AAAA;AAAA,EAGT;AACF;AAAA;AAGK,MAAM,qBAAqB,OAAO;AAAA;AAAA;AAAA;AAIlC,MAAM,gBAAgB,OAAO;AAAA;AAAA;AAAA;AAKpC,IAAO,iBAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/FormItem/ValidationFieldWrapper.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { Component } from 'react';\n\nexport default class ValidationFieldWrapper extends Component {\n static defaultProps = {\n validateOnBlur: false,\n validateOnChange: false,\n name: '', // name in context of the form\n value: '',\n validate: () => null,\n onChange: () => null,\n onBlur: () => null,\n };\n\n constructor(props) {\n super(props);\n this.state = {\n value: props.value,\n };\n }\n\n componentDidMount() {\n const { value } = this.state;\n this.executeValidations(value);\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n const { value } = nextProps;\n if (value === prevState.value) return null;\n return {\n ...prevState,\n value,\n };\n }\n\n handleChange = (e) => {\n const { onChange } = this.props;\n this.setState({ value: e.target.value });\n if (onChange) onChange(e);\n }\n\n handleBlur = (e) => {\n const { onBlur, validateOnBlur } = this.props;\n const { value } = this.state;\n if (validateOnBlur) this.executeValidations(value);\n onBlur(e);\n }\n\n executeValidations = (value) => {\n const { validations } = this.props;\n if (validations && Array.isArray(validations)) {\n if (\n !validations.some(validation => {\n const { error, payload } = validation({ value });\n if (error)\n this.setState({ validationMessage: payload, state: error });\n return error;\n })\n ) {\n this.setState({ hasError: false });\n }\n }\n }\n\n render() {\n const { children } = this.props;\n const { value, validationMessage, validationState, hasError } = this.state;\n return children({\n value,\n validationMessage,\n validationState,\n hasError,\n onChange: this.handleChange,\n onBlur: this.handleBlur,\n });\n }\n}\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAE1B,MAAO,+BAA6C,UAAU;AAAA,EAW5D,YAAY,OAAO;AACjB,UAAM,KAAK;AAoB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A,UAAU,KAAK;AAAA,MACf,QAAQ,KAAK;AAAA,IACf,CAAC;AAAA,EACH;AACF;AAzEqB,uBACZ,eAAe;AAAA,EACpB,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU,MAAM;AAAA,EAChB,UAAU,MAAM;AAAA,EAChB,QAAQ,MAAM;AAChB;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { Component } from 'react';\n\nexport default class ValidationFieldWrapper extends Component {\n static defaultProps = {\n validateOnBlur: false,\n validateOnChange: false,\n name: '', // name in context of the form\n value: '',\n validate: () => null,\n onChange: () => null,\n onBlur: () => null,\n };\n\n constructor(props) {\n super(props);\n this.state = {\n value: props.value,\n };\n }\n\n componentDidMount() {\n const { value } = this.state;\n this.executeValidations(value);\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n const { value } = nextProps;\n if (value === prevState.value) return null;\n return {\n ...prevState,\n value,\n };\n }\n\n handleChange = (e) => {\n const { onChange } = this.props;\n this.setState({ value: e.target.value });\n if (onChange) onChange(e);\n };\n\n handleBlur = (e) => {\n const { onBlur, validateOnBlur } = this.props;\n const { value } = this.state;\n if (validateOnBlur) this.executeValidations(value);\n onBlur(e);\n };\n\n executeValidations = (value) => {\n const { validations } = this.props;\n if (validations && Array.isArray(validations)) {\n if (\n !validations.some((validation) => {\n const { error, payload } = validation({ value });\n if (error) this.setState({ validationMessage: payload, state: error });\n return error;\n })\n ) {\n this.setState({ hasError: false });\n }\n }\n };\n\n render() {\n const { children } = this.props;\n const { value, validationMessage, validationState, hasError } = this.state;\n return children({\n value,\n validationMessage,\n validationState,\n hasError,\n onChange: this.handleChange,\n onBlur: this.handleBlur,\n });\n }\n}\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAE1B,MAAO,+BAA6C,UAAU;AAAA,EAW5D,YAAY,OAAO;AACjB,UAAM,KAAK;AAoBb,wBAAe,CA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KAAK;AAAA,MACf,QAAQ,KAAK;AAAA,IACf,CAAC;AAAA,EACH;AACF;AAxEqB,uBACZ,eAAe;AAAA,EACpB,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU,MAAM;AAAA,EAChB,UAAU,MAAM;AAAA,EAChB,QAAQ,MAAM;AAChB;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/Input/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DSInput, InputAddonWrapper, DSInput as default } from '@elliemae/ds-common/Input';"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DSInput, InputAddonWrapper, DSInput as default } from '@elliemae/ds-common/Input';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,SAAS,mBAA8B,WAAXA,gBAA0B;",
6
6
  "names": ["DSInput"]
7
7
  }
@@ -11,13 +11,7 @@ class AddonWrapper extends Component {
11
11
  this.state = {};
12
12
  }
13
13
  render() {
14
- const {
15
- leftAddon,
16
- rightAddon,
17
- children: inputComponent,
18
- className,
19
- containerProps
20
- } = this.props;
14
+ const { leftAddon, rightAddon, children: inputComponent, className, containerProps } = this.props;
21
15
  const childType = inputComponent && inputComponent.type && inputComponent.type.name ? inputComponent.type.name.toLowerCase() : "default";
22
16
  return /* @__PURE__ */ jsxs(Container, {
23
17
  className: `${className} ${blockName}--${childType}`,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/InputGroup/AddonWrapper.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { Component } from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\n\nconst blockName = 'input-addon-group';\n\nconst Container = aggregatedClasses('div')(blockName);\nconst InputAddon = aggregatedClasses('span')(blockName, 'addon');\n\nclass AddonWrapper extends Component {\n static defaultProps = {};\n\n state = {};\n\n render() {\n const {\n leftAddon,\n rightAddon,\n children: inputComponent,\n className,\n containerProps,\n } = this.props;\n const childType =\n inputComponent && inputComponent.type && inputComponent.type.name\n ? inputComponent.type.name.toLowerCase()\n : 'default';\n return (\n <Container\n className={`${className} ${blockName}--${childType}`}\n {...containerProps}\n >\n {leftAddon && <InputAddon>{leftAddon}</InputAddon>}\n {inputComponent}\n {rightAddon && <InputAddon>{rightAddon}</InputAddon>}\n </Container>\n );\n }\n}\n\nexport { AddonWrapper };\nexport default AddonWrapper;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC0BjB,SAIgB,KAJhB;AA1BN,SAAgB,iBAAiB;AACjC,SAAS,yBAAyB;AAElC,MAAM,YAAY;AAElB,MAAM,YAAY,kBAAkB,KAAK,EAAE,SAAS;AACpD,MAAM,aAAa,kBAAkB,MAAM,EAAE,WAAW,OAAO;AAE/D,MAAM,qBAAqB,UAAU;AAAA,EAArC;AAAA;AAGE,iBAAQ,CAAC;AAAA;AAAA,EAET,SAAS;AACP,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACA;AAAA,IACF,IAAI,KAAK;AACT,UAAM,YACJ,kBAAkB,eAAe,QAAQ,eAAe,KAAK,OACzD,eAAe,KAAK,KAAK,YAAY,IACrC;AACN,WACE,qBAAC;AAAA,MACC,WAAW,GAAG,aAAa,cAAc;AAAA,MACxC,GAAG;AAAA,MAEH;AAAA,qBAAa,oBAAC;AAAA,UAAY;AAAA,SAAU;AAAA,QACpC;AAAA,QACA,cAAc,oBAAC;AAAA,UAAY;AAAA,SAAW;AAAA;AAAA,KACzC;AAAA,EAEJ;AACF;AA5BM,aACG,eAAe,CAAC;AA8BzB,IAAO,uBAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { Component } from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\n\nconst blockName = 'input-addon-group';\n\nconst Container = aggregatedClasses('div')(blockName);\nconst InputAddon = aggregatedClasses('span')(blockName, 'addon');\n\nclass AddonWrapper extends Component {\n static defaultProps = {};\n\n state = {};\n\n render() {\n const { leftAddon, rightAddon, children: inputComponent, className, containerProps } = this.props;\n const childType =\n inputComponent && inputComponent.type && inputComponent.type.name\n ? inputComponent.type.name.toLowerCase()\n : 'default';\n return (\n <Container className={`${className} ${blockName}--${childType}`} {...containerProps}>\n {leftAddon && <InputAddon>{leftAddon}</InputAddon>}\n {inputComponent}\n {rightAddon && <InputAddon>{rightAddon}</InputAddon>}\n </Container>\n );\n }\n}\n\nexport { AddonWrapper };\nexport default AddonWrapper;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACoBjB,SACgB,KADhB;AApBN,SAAgB,iBAAiB;AACjC,SAAS,yBAAyB;AAElC,MAAM,YAAY;AAElB,MAAM,YAAY,kBAAkB,KAAK,EAAE,SAAS;AACpD,MAAM,aAAa,kBAAkB,MAAM,EAAE,WAAW,OAAO;AAE/D,MAAM,qBAAqB,UAAU;AAAA,EAArC;AAAA;AAGE,iBAAQ,CAAC;AAAA;AAAA,EAET,SAAS;AACP,UAAM,EAAE,WAAW,YAAY,UAAU,gBAAgB,WAAW,eAAe,IAAI,KAAK;AAC5F,UAAM,YACJ,kBAAkB,eAAe,QAAQ,eAAe,KAAK,OACzD,eAAe,KAAK,KAAK,YAAY,IACrC;AACN,WACE,qBAAC;AAAA,MAAU,WAAW,GAAG,aAAa,cAAc;AAAA,MAAc,GAAG;AAAA,MAClE;AAAA,qBAAa,oBAAC;AAAA,UAAY;AAAA,SAAU;AAAA,QACpC;AAAA,QACA,cAAc,oBAAC;AAAA,UAAY;AAAA,SAAW;AAAA;AAAA,KACzC;AAAA,EAEJ;AACF;AAnBM,aACG,eAAe,CAAC;AAqBzB,IAAO,uBAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,21 +1,14 @@
1
1
  import * as React from "react";
2
2
  import { PropTypes } from "@elliemae/ds-utilities";
3
3
  const props = {
4
- containerProps: PropTypes.shape({}).description(
5
- "props injected to wrapper of page header"
4
+ containerProps: PropTypes.shape({}).description("props injected to wrapper of page header"),
5
+ innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]).description(
6
+ "inner ref for input group wrapper"
6
7
  ),
7
- innerRef: PropTypes.oneOfType([
8
- PropTypes.func,
9
- PropTypes.shape({ current: PropTypes.any })
10
- ]).description("inner ref for input group wrapper"),
11
8
  className: PropTypes.string.description("class for input group wrapper"),
12
9
  style: PropTypes.object.description("Set style for the input group"),
13
- leftAddon: PropTypes.element.description(
14
- "Component to be added at the left side of the input"
15
- ),
16
- rightAddon: PropTypes.element.description(
17
- "Component to be added at the right side of the input"
18
- ),
10
+ leftAddon: PropTypes.element.description("Component to be added at the left side of the input"),
11
+ rightAddon: PropTypes.element.description("Component to be added at the right side of the input"),
19
12
  children: PropTypes.element.description("Input components to show")
20
13
  };
21
14
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/InputGroup/props.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from '@elliemae/ds-utilities';\n\nexport const props = {\n /** props injected to wrapper of page header */\n containerProps: PropTypes.shape({}).description(\n 'props injected to wrapper of page header',\n ),\n /** inner ref for input group wrapper */\n innerRef: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({ current: PropTypes.any }),\n ]).description('inner ref for input group wrapper'),\n /** class for input group wrapper */\n className: PropTypes.string.description('class for input group wrapper'),\n /**\n * Set style for the input group\n */\n style: PropTypes.object.description('Set style for the input group'),\n /**\n * Component to be added at the left side of the input\n */\n leftAddon: PropTypes.element.description(\n 'Component to be added at the left side of the input',\n ),\n /**\n * Component to be added at the right side of the input\n */\n rightAddon: PropTypes.element.description(\n 'Component to be added at the right side of the input',\n ),\n /**\n * Input components to show\n */\n children: PropTypes.element.description('Input components to show'),\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAEnB,MAAM,QAAQ;AAAA,EAEnB,gBAAgB,UAAU,MAAM,CAAC,CAAC,EAAE;AAAA,IAClC;AAAA,EACF;AAAA,EAEA,UAAU,UAAU,UAAU;AAAA,IAC5B,UAAU;AAAA,IACV,UAAU,MAAM,EAAE,SAAS,UAAU,IAAI,CAAC;AAAA,EAC5C,CAAC,EAAE,YAAY,mCAAmC;AAAA,EAElD,WAAW,UAAU,OAAO,YAAY,+BAA+B;AAAA,EAIvE,OAAO,UAAU,OAAO,YAAY,+BAA+B;AAAA,EAInE,WAAW,UAAU,QAAQ;AAAA,IAC3B;AAAA,EACF;AAAA,EAIA,YAAY,UAAU,QAAQ;AAAA,IAC5B;AAAA,EACF;AAAA,EAIA,UAAU,UAAU,QAAQ,YAAY,0BAA0B;AACpE;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from '@elliemae/ds-utilities';\n\nexport const props = {\n /** props injected to wrapper of page header */\n containerProps: PropTypes.shape({}).description('props injected to wrapper of page header'),\n /** inner ref for input group wrapper */\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]).description(\n 'inner ref for input group wrapper',\n ),\n /** class for input group wrapper */\n className: PropTypes.string.description('class for input group wrapper'),\n /**\n * Set style for the input group\n */\n style: PropTypes.object.description('Set style for the input group'),\n /**\n * Component to be added at the left side of the input\n */\n leftAddon: PropTypes.element.description('Component to be added at the left side of the input'),\n /**\n * Component to be added at the right side of the input\n */\n rightAddon: PropTypes.element.description('Component to be added at the right side of the input'),\n /**\n * Input components to show\n */\n children: PropTypes.element.description('Input components to show'),\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAEnB,MAAM,QAAQ;AAAA,EAEnB,gBAAgB,UAAU,MAAM,CAAC,CAAC,EAAE,YAAY,0CAA0C;AAAA,EAE1F,UAAU,UAAU,UAAU,CAAC,UAAU,MAAM,UAAU,MAAM,EAAE,SAAS,UAAU,IAAI,CAAC,CAAC,CAAC,EAAE;AAAA,IAC3F;AAAA,EACF;AAAA,EAEA,WAAW,UAAU,OAAO,YAAY,+BAA+B;AAAA,EAIvE,OAAO,UAAU,OAAO,YAAY,+BAA+B;AAAA,EAInE,WAAW,UAAU,QAAQ,YAAY,qDAAqD;AAAA,EAI9F,YAAY,UAAU,QAAQ,YAAY,sDAAsD;AAAA,EAIhG,UAAU,UAAU,QAAQ,YAAY,0BAA0B;AACpE;",
6
6
  "names": []
7
7
  }
@@ -30,9 +30,7 @@ const DSInputMask = ({
30
30
  value: valueOrEvent,
31
31
  ...rest
32
32
  }) => {
33
- const [rawValue, setRawValue] = useState(
34
- getValueFromEventOrString(valueOrEvent)
35
- );
33
+ const [rawValue, setRawValue] = useState(getValueFromEventOrString(valueOrEvent));
36
34
  useEffect(() => {
37
35
  setRawValue(getValueFromEventOrString(valueOrEvent));
38
36
  }, [valueOrEvent]);
@@ -102,9 +100,7 @@ const DSInputMask = ({
102
100
  DSInputMask.propTypes = inputProps;
103
101
  DSInputMask.defaultProps = defaultProps;
104
102
  DSInputMask.displayName = "DSInputMask";
105
- const DSInputMaskWithSchema = describe(DSInputMask).description(
106
- "Masking input for custom formats"
107
- );
103
+ const DSInputMaskWithSchema = describe(DSInputMask).description("Masking input for custom formats");
108
104
  DSInputMaskWithSchema.propTypes = inputProps;
109
105
  var DSInputMask_default = DSInputMask;
110
106
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/InputMask/DSInputMask.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useCallback, useEffect, useState } from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { MASK_TYPES } from './MaskTypes';\nimport { MASK_PIPES } from './MaskPipes';\nimport { DSInputMaskDeprecated } from './DSInputMaskDeprecated';\nimport { inputProps } from './props';\nimport { defaultProps } from './defaultProps';\nimport { OutOfTheBoxMaskTypes } from './mask_types';\n\nconst isStringMask = (mask: any) => typeof mask === 'string';\n\nconst isObjectMask = (mask: any) => typeof mask === 'object' && mask.type;\n\nconst getRawMask = (mask: any, rawValue: string) =>\n typeof mask === 'function' ? mask(rawValue) : mask;\n\nconst getValueFromEventOrString = (e: any): string => {\n let value = e;\n if (e && e.target) {\n const {\n target: { value: eValue },\n } = e;\n value = eValue;\n }\n return value;\n};\n\nconst DSInputMask = ({\n 'aria-label': ariaLabel = 'Input Mask',\n autoFocus,\n innerRef,\n mask,\n pipe,\n value: valueOrEvent,\n ...rest\n}) => {\n const [rawValue, setRawValue] = useState(\n getValueFromEventOrString(valueOrEvent),\n );\n\n useEffect(() => {\n setRawValue(getValueFromEventOrString(valueOrEvent));\n }, [valueOrEvent]);\n\n const [rawMask, setRawMask] = useState<any>(getRawMask(mask, rawValue));\n\n const [focus, setFocus] = useState(autoFocus);\n\n const [lastkey, setLastkey] = useState<{ code: number; key: string }>({\n code: null,\n key: null,\n });\n\n const [cursorPosition, setCursorPosition] = useState({ current: 0 });\n\n const handleSetMask = useCallback(\n (newValue) => {\n setRawMask(getRawMask(mask, newValue));\n },\n [mask],\n );\n\n if (!pipe && isStringMask(rawMask)) {\n return OutOfTheBoxMaskTypes[rawMask]({\n ...rest,\n 'aria-label': ariaLabel,\n innerRef,\n value: rawValue,\n focus,\n setFocus,\n setRawMask: handleSetMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n });\n }\n\n if (!pipe && isObjectMask(rawMask)) {\n // we should change rawMask.type to rawMask.maskType\n // to avoid override standard props\n return OutOfTheBoxMaskTypes[rawMask.type]({\n ...rawMask,\n ...rest,\n 'aria-label': ariaLabel,\n innerRef,\n value: rawValue,\n focus,\n setFocus,\n setRawMask: handleSetMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n });\n }\n\n const getDeprecatedMask = () => {\n if (mask === MASK_TYPES.DATE) return MASK_TYPES.DATE_DEPRECATED;\n if (mask === MASK_TYPES.DATE_TIME) return MASK_TYPES.DATE_TIME_DEPRECATED;\n return mask;\n };\n return (\n <DSInputMaskDeprecated\n {...rest}\n aria-label={ariaLabel}\n autoFocus={autoFocus}\n innerRef={innerRef}\n mask={getDeprecatedMask()}\n pipe={pipe}\n value={rawValue}\n />\n );\n};\n\nDSInputMask.propTypes = inputProps;\nDSInputMask.defaultProps = defaultProps;\nDSInputMask.displayName = 'DSInputMask';\nconst DSInputMaskWithSchema = describe(DSInputMask).description(\n 'Masking input for custom formats',\n);\nDSInputMaskWithSchema.propTypes = inputProps;\n\nexport { MASK_TYPES, MASK_PIPES, DSInputMaskWithSchema, DSInputMask };\nexport default DSInputMask;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC0GnB;AAzGJ,SAAgB,aAAa,WAAW,gBAAgB;AACxD,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,6BAA6B;AACtC,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB;AAC7B,SAAS,4BAA4B;AAErC,MAAM,eAAe,CAAC,SAAc,OAAO,SAAS;AAEpD,MAAM,eAAe,CAAC,SAAc,OAAO,SAAS,YAAY,KAAK;AAErE,MAAM,aAAa,CAAC,MAAW,aAC7B,OAAO,SAAS,aAAa,KAAK,QAAQ,IAAI;AAEhD,MAAM,4BAA4B,CAAC,MAAmB;AACpD,MAAI,QAAQ;AACZ,MAAI,KAAK,EAAE,QAAQ;AACjB,UAAM;AAAA,MACJ,QAAQ,EAAE,OAAO,OAAO;AAAA,IAC1B,IAAI;AACJ,YAAQ;AAAA,EACV;AACA,SAAO;AACT;AAEA,MAAM,cAAc,CAAC;AAAA,EACnB,cAAc,YAAY;AAAA,EAC1B;AA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AAAM,aAAO,WAAW;AAChD,QAAI,SAAS,WAAW;AAAW,aAAO,WAAW;AACrD,WAAO;AAAA,EACT;AACA,SACE,oBAAC;AAAA,IACE,GAAG;AAAA,IACJ,cAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA,MAAM,kBAAkB;AAAA,IACxB;AAAA,IACA,OAAO;AAAA,GACT;AAEJ;AAEA,YAAY,YAAY;AACxB,YAAY,eAAe;AAC3B,YAAY,cAAc;AAC1B,MAAM,wBAAwB,SAAS,WAAW,EAAE;AAAA,EAClD;AACF;AACA,sBAAsB,YAAY;AAGlC,IAAO,sBAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useCallback, useEffect, useState } from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { MASK_TYPES } from './MaskTypes';\nimport { MASK_PIPES } from './MaskPipes';\nimport { DSInputMaskDeprecated } from './DSInputMaskDeprecated';\nimport { inputProps } from './props';\nimport { defaultProps } from './defaultProps';\nimport { OutOfTheBoxMaskTypes } from './mask_types';\n\nconst isStringMask = (mask: any) => typeof mask === 'string';\n\nconst isObjectMask = (mask: any) => typeof mask === 'object' && mask.type;\n\nconst getRawMask = (mask: any, rawValue: string) => (typeof mask === 'function' ? mask(rawValue) : mask);\n\nconst getValueFromEventOrString = (e: any): string => {\n let value = e;\n if (e && e.target) {\n const {\n target: { value: eValue },\n } = e;\n value = eValue;\n }\n return value;\n};\n\nconst DSInputMask = ({\n 'aria-label': ariaLabel = 'Input Mask',\n autoFocus,\n innerRef,\n mask,\n pipe,\n value: valueOrEvent,\n ...rest\n}) => {\n const [rawValue, setRawValue] = useState(getValueFromEventOrString(valueOrEvent));\n\n useEffect(() => {\n setRawValue(getValueFromEventOrString(valueOrEvent));\n }, [valueOrEvent]);\n\n const [rawMask, setRawMask] = useState<any>(getRawMask(mask, rawValue));\n\n const [focus, setFocus] = useState(autoFocus);\n\n const [lastkey, setLastkey] = useState<{ code: number; key: string }>({\n code: null,\n key: null,\n });\n\n const [cursorPosition, setCursorPosition] = useState({ current: 0 });\n\n const handleSetMask = useCallback(\n (newValue) => {\n setRawMask(getRawMask(mask, newValue));\n },\n [mask],\n );\n\n if (!pipe && isStringMask(rawMask)) {\n return OutOfTheBoxMaskTypes[rawMask]({\n ...rest,\n 'aria-label': ariaLabel,\n innerRef,\n value: rawValue,\n focus,\n setFocus,\n setRawMask: handleSetMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n });\n }\n\n if (!pipe && isObjectMask(rawMask)) {\n // we should change rawMask.type to rawMask.maskType\n // to avoid override standard props\n return OutOfTheBoxMaskTypes[rawMask.type]({\n ...rawMask,\n ...rest,\n 'aria-label': ariaLabel,\n innerRef,\n value: rawValue,\n focus,\n setFocus,\n setRawMask: handleSetMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n });\n }\n\n const getDeprecatedMask = () => {\n if (mask === MASK_TYPES.DATE) return MASK_TYPES.DATE_DEPRECATED;\n if (mask === MASK_TYPES.DATE_TIME) return MASK_TYPES.DATE_TIME_DEPRECATED;\n return mask;\n };\n return (\n <DSInputMaskDeprecated\n {...rest}\n aria-label={ariaLabel}\n autoFocus={autoFocus}\n innerRef={innerRef}\n mask={getDeprecatedMask()}\n pipe={pipe}\n value={rawValue}\n />\n );\n};\n\nDSInputMask.propTypes = inputProps;\nDSInputMask.defaultProps = defaultProps;\nDSInputMask.displayName = 'DSInputMask';\nconst DSInputMaskWithSchema = describe(DSInputMask).description('Masking input for custom formats');\nDSInputMaskWithSchema.propTypes = inputProps;\n\nexport { MASK_TYPES, MASK_PIPES, DSInputMaskWithSchema, DSInputMask };\nexport default DSInputMask;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACuGnB;AAtGJ,SAAgB,aAAa,WAAW,gBAAgB;AACxD,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS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MACH,cAAc;AAAA,MACd;AAAA,MACA,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA,YAAY;AAAA,MACZ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AAEA,MAAI,CAAC,QAAQ,aAAa,OAAO,GAAG;AAGlC,WAAO,qBAAqB,QAAQ,MAAM;AAAA,MACxC,GAAG;AAAA,MACH,GAAG;AAAA,MACH,cAAc;AAAA,MACd;AAAA,MACA,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA,YAAY;AAAA,MACZ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AAEA,QAAM,oBAAoB,MAAM;AAC9B,QAAI,SAAS,WAAW;AAAM,aAAO,WAAW;AAChD,QAAI,SAAS,WAAW;AAAW,aAAO,WAAW;AACrD,WAAO;AAAA,EACT;AACA,SACE,oBAAC;AAAA,IACE,GAAG;AAAA,IACJ,cAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA,MAAM,kBAAkB;AAAA,IACxB;AAAA,IACA,OAAO;AAAA,GACT;AAEJ;AAEA,YAAY,YAAY;AACxB,YAAY,eAAe;AAC3B,YAAY,cAAc;AAC1B,MAAM,wBAAwB,SAAS,WAAW,EAAE,YAAY,kCAAkC;AAClG,sBAAsB,YAAY;AAGlC,IAAO,sBAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/InputMask/InputMaskContext.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { TLastkey } from './types';\n\nexport const InputMaskContext = React.createContext<{\n rawValue: string;\n setRawValue: React.Dispatch<string>;\n rawMask: any;\n setRawMask: React.Dispatch<any>;\n focus: boolean;\n setFocus: React.Dispatch<boolean>;\n lastkey: TLastkey;\n setLastkey: React.Dispatch<TLastkey>;\n cursorPosition: { current: number };\n setCursorPosition: React.Dispatch<{ current: number }>;\n}>({\n rawValue: '',\n setRawValue: () => null,\n rawMask: null,\n setRawMask: () => null,\n focus: false,\n setFocus: () => null,\n lastkey: { code: null, key: null },\n setLastkey: () => null,\n cursorPosition: { current: 0 },\n setCursorPosition: () => null,\n});\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport type { TLastkey } from './types';\n\nexport const InputMaskContext = React.createContext<{\n rawValue: string;\n setRawValue: React.Dispatch<string>;\n rawMask: any;\n setRawMask: React.Dispatch<any>;\n focus: boolean;\n setFocus: React.Dispatch<boolean>;\n lastkey: TLastkey;\n setLastkey: React.Dispatch<TLastkey>;\n cursorPosition: { current: number };\n setCursorPosition: React.Dispatch<{ current: number }>;\n}>({\n rawValue: '',\n setRawValue: () => null,\n rawMask: null,\n setRawMask: () => null,\n focus: false,\n setFocus: () => null,\n lastkey: { code: null, key: null },\n setLastkey: () => null,\n cursorPosition: { current: 0 },\n setCursorPosition: () => null,\n});\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAGX,MAAM,mBAAmBA,OAAM,cAWnC;AAAA,EACD,UAAU;AAAA,EACV,aAAa,MAAM;AAAA,EACnB,SAAS;AAAA,EACT,YAAY,MAAM;AAAA,EAClB,OAAO;AAAA,EACP,UAAU,MAAM;AAAA,EAChB,SAAS,EAAE,MAAM,MAAM,KAAK,KAAK;AAAA,EACjC,YAAY,MAAM;AAAA,EAClB,gBAAgB,EAAE,SAAS,EAAE;AAAA,EAC7B,mBAAmB,MAAM;AAC3B,CAAC;",
6
6
  "names": ["React"]
7
7
  }