@elliemae/ds-form 3.1.0-next.2 → 3.1.0-next.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/dist/cjs/CheckboxGroup/DSCheckboxGroup.js +2 -2
  2. package/dist/cjs/CheckboxGroup/DSCheckboxGroup.js.map +2 -2
  3. package/dist/cjs/CheckboxGroup/props.js +12 -12
  4. package/dist/cjs/CheckboxGroup/props.js.map +2 -2
  5. package/dist/cjs/ComboBoxFreeSolo/components/MultiValueLabel.js +3 -3
  6. package/dist/cjs/ComboBoxFreeSolo/components/MultiValueLabel.js.map +2 -2
  7. package/dist/cjs/ComboBoxFreeSolo/components/MultiValueRemove.js +2 -2
  8. package/dist/cjs/ComboBoxFreeSolo/components/MultiValueRemove.js.map +2 -2
  9. package/dist/cjs/ComboBoxFreeSolo/components/SingleValueRemove.js +2 -2
  10. package/dist/cjs/ComboBoxFreeSolo/components/SingleValueRemove.js.map +2 -2
  11. package/dist/cjs/DateInput/DSDateInput.js +1 -2
  12. package/dist/cjs/DateInput/DSDateInput.js.map +2 -2
  13. package/dist/cjs/DateInput/props.js +19 -19
  14. package/dist/cjs/DateInput/props.js.map +2 -2
  15. package/dist/cjs/DateInputV2/components/DSDateInput.js +2 -2
  16. package/dist/cjs/DateInputV2/components/DSDateInput.js.map +2 -2
  17. package/dist/cjs/DateInputV2/components/props.js +13 -13
  18. package/dist/cjs/DateInputV2/components/props.js.map +2 -2
  19. package/dist/cjs/DateInputV2/components/styled.js +5 -5
  20. package/dist/cjs/DateInputV2/components/styled.js.map +2 -2
  21. package/dist/cjs/FormItem/DSFormItemLayout.js +1 -2
  22. package/dist/cjs/FormItem/DSFormItemLayout.js.map +2 -2
  23. package/dist/cjs/FormItem/Error/DSError.js +4 -4
  24. package/dist/cjs/FormItem/Error/DSError.js.map +2 -2
  25. package/dist/cjs/FormItem/Suffix/Suffix.js +4 -4
  26. package/dist/cjs/FormItem/Suffix/Suffix.js.map +2 -2
  27. package/dist/cjs/FormItem/props.js +42 -42
  28. package/dist/cjs/FormItem/props.js.map +2 -2
  29. package/dist/cjs/InputGroup/DSInputGroup.js +2 -2
  30. package/dist/cjs/InputGroup/DSInputGroup.js.map +2 -2
  31. package/dist/cjs/InputGroup/props.js +10 -10
  32. package/dist/cjs/InputGroup/props.js.map +2 -2
  33. package/dist/cjs/InputMask/DSInputMask.js +2 -2
  34. package/dist/cjs/InputMask/DSInputMask.js.map +2 -2
  35. package/dist/cjs/InputMask/mask_types/DateInputMask.js +34 -34
  36. package/dist/cjs/InputMask/mask_types/DateInputMask.js.map +2 -2
  37. package/dist/cjs/InputMask/mask_types/DateTimeInputMask.js +34 -34
  38. package/dist/cjs/InputMask/mask_types/DateTimeInputMask.js.map +2 -2
  39. package/dist/cjs/InputMask/mask_types/DictionaryInputMask.js +37 -37
  40. package/dist/cjs/InputMask/mask_types/DictionaryInputMask.js.map +2 -2
  41. package/dist/cjs/InputMask/mask_types/NumberInputMask.js +46 -46
  42. package/dist/cjs/InputMask/mask_types/NumberInputMask.js.map +2 -2
  43. package/dist/cjs/InputMask/mask_types/PhoneInputMask.js +34 -34
  44. package/dist/cjs/InputMask/mask_types/PhoneInputMask.js.map +2 -2
  45. package/dist/cjs/InputMask/mask_types/PhoneInternationalInputMask.js +34 -34
  46. package/dist/cjs/InputMask/mask_types/PhoneInternationalInputMask.js.map +2 -2
  47. package/dist/cjs/InputMask/mask_types/SsnInputMask.js +34 -34
  48. package/dist/cjs/InputMask/mask_types/SsnInputMask.js.map +2 -2
  49. package/dist/cjs/InputMask/mask_types/UsZipCodeInputMask.js +34 -34
  50. package/dist/cjs/InputMask/mask_types/UsZipCodeInputMask.js.map +2 -2
  51. package/dist/cjs/InputMask/mask_types/ZipCodeSearchInputMask.js +34 -34
  52. package/dist/cjs/InputMask/mask_types/ZipCodeSearchInputMask.js.map +2 -2
  53. package/dist/cjs/InputMask/props.js +36 -36
  54. package/dist/cjs/InputMask/props.js.map +2 -2
  55. package/dist/cjs/InputProtected/DSInputProtected.js +2 -2
  56. package/dist/cjs/InputProtected/DSInputProtected.js.map +2 -2
  57. package/dist/cjs/InputProtected/props.js +11 -11
  58. package/dist/cjs/InputProtected/props.js.map +2 -2
  59. package/dist/cjs/LargeInputText/DSLargeInputText.js +2 -2
  60. package/dist/cjs/LargeInputText/DSLargeInputText.js.map +2 -2
  61. package/dist/cjs/LargeInputText/props.js +28 -28
  62. package/dist/cjs/LargeInputText/props.js.map +2 -2
  63. package/dist/cjs/Radio/DSRadio.js +16 -16
  64. package/dist/cjs/Radio/DSRadio.js.map +2 -2
  65. package/dist/cjs/RadioGroup/DSRadioGroup.js +2 -2
  66. package/dist/cjs/RadioGroup/DSRadioGroup.js.map +2 -2
  67. package/dist/cjs/RadioGroup/props.js +11 -11
  68. package/dist/cjs/RadioGroup/props.js.map +2 -2
  69. package/dist/cjs/TimeInput/DSTimeInput.js +15 -15
  70. package/dist/cjs/TimeInput/DSTimeInput.js.map +2 -2
  71. package/dist/cjs/Toggle/DSToggle.js +13 -13
  72. package/dist/cjs/Toggle/DSToggle.js.map +2 -2
  73. package/dist/esm/CheckboxGroup/DSCheckboxGroup.js +1 -1
  74. package/dist/esm/CheckboxGroup/DSCheckboxGroup.js.map +1 -1
  75. package/dist/esm/CheckboxGroup/props.js +4 -4
  76. package/dist/esm/CheckboxGroup/props.js.map +2 -2
  77. package/dist/esm/ComboBoxFreeSolo/components/MultiValueLabel.js +1 -1
  78. package/dist/esm/ComboBoxFreeSolo/components/MultiValueLabel.js.map +1 -1
  79. package/dist/esm/ComboBoxFreeSolo/components/MultiValueRemove.js +1 -1
  80. package/dist/esm/ComboBoxFreeSolo/components/MultiValueRemove.js.map +1 -1
  81. package/dist/esm/ComboBoxFreeSolo/components/SingleValueRemove.js +1 -1
  82. package/dist/esm/ComboBoxFreeSolo/components/SingleValueRemove.js.map +1 -1
  83. package/dist/esm/DateInput/DSDateInput.js +1 -2
  84. package/dist/esm/DateInput/DSDateInput.js.map +2 -2
  85. package/dist/esm/DateInput/props.js +1 -1
  86. package/dist/esm/DateInput/props.js.map +1 -1
  87. package/dist/esm/DateInputV2/components/DSDateInput.js +1 -1
  88. package/dist/esm/DateInputV2/components/DSDateInput.js.map +1 -1
  89. package/dist/esm/DateInputV2/components/props.js +1 -1
  90. package/dist/esm/DateInputV2/components/props.js.map +1 -1
  91. package/dist/esm/DateInputV2/components/styled.js +1 -1
  92. package/dist/esm/DateInputV2/components/styled.js.map +1 -1
  93. package/dist/esm/FormItem/DSFormItemLayout.js +1 -2
  94. package/dist/esm/FormItem/DSFormItemLayout.js.map +2 -2
  95. package/dist/esm/FormItem/Error/DSError.js +1 -1
  96. package/dist/esm/FormItem/Error/DSError.js.map +1 -1
  97. package/dist/esm/FormItem/Suffix/Suffix.js +1 -1
  98. package/dist/esm/FormItem/Suffix/Suffix.js.map +1 -1
  99. package/dist/esm/FormItem/props.js +1 -1
  100. package/dist/esm/FormItem/props.js.map +1 -1
  101. package/dist/esm/InputGroup/DSInputGroup.js +1 -1
  102. package/dist/esm/InputGroup/DSInputGroup.js.map +1 -1
  103. package/dist/esm/InputGroup/props.js +1 -1
  104. package/dist/esm/InputGroup/props.js.map +1 -1
  105. package/dist/esm/InputMask/DSInputMask.js +1 -1
  106. package/dist/esm/InputMask/DSInputMask.js.map +1 -1
  107. package/dist/esm/InputMask/mask_types/DateInputMask.js +1 -1
  108. package/dist/esm/InputMask/mask_types/DateInputMask.js.map +1 -1
  109. package/dist/esm/InputMask/mask_types/DateTimeInputMask.js +1 -1
  110. package/dist/esm/InputMask/mask_types/DateTimeInputMask.js.map +1 -1
  111. package/dist/esm/InputMask/mask_types/DictionaryInputMask.js +1 -1
  112. package/dist/esm/InputMask/mask_types/DictionaryInputMask.js.map +1 -1
  113. package/dist/esm/InputMask/mask_types/NumberInputMask.js +1 -1
  114. package/dist/esm/InputMask/mask_types/NumberInputMask.js.map +1 -1
  115. package/dist/esm/InputMask/mask_types/PhoneInputMask.js +1 -1
  116. package/dist/esm/InputMask/mask_types/PhoneInputMask.js.map +1 -1
  117. package/dist/esm/InputMask/mask_types/PhoneInternationalInputMask.js +1 -1
  118. package/dist/esm/InputMask/mask_types/PhoneInternationalInputMask.js.map +1 -1
  119. package/dist/esm/InputMask/mask_types/SsnInputMask.js +1 -1
  120. package/dist/esm/InputMask/mask_types/SsnInputMask.js.map +1 -1
  121. package/dist/esm/InputMask/mask_types/UsZipCodeInputMask.js +1 -1
  122. package/dist/esm/InputMask/mask_types/UsZipCodeInputMask.js.map +1 -1
  123. package/dist/esm/InputMask/mask_types/ZipCodeSearchInputMask.js +1 -1
  124. package/dist/esm/InputMask/mask_types/ZipCodeSearchInputMask.js.map +1 -1
  125. package/dist/esm/InputMask/props.js +1 -1
  126. package/dist/esm/InputMask/props.js.map +1 -1
  127. package/dist/esm/InputProtected/DSInputProtected.js +1 -1
  128. package/dist/esm/InputProtected/DSInputProtected.js.map +1 -1
  129. package/dist/esm/InputProtected/props.js +1 -1
  130. package/dist/esm/InputProtected/props.js.map +1 -1
  131. package/dist/esm/LargeInputText/DSLargeInputText.js +1 -1
  132. package/dist/esm/LargeInputText/DSLargeInputText.js.map +1 -1
  133. package/dist/esm/LargeInputText/props.js +1 -1
  134. package/dist/esm/LargeInputText/props.js.map +1 -1
  135. package/dist/esm/Radio/DSRadio.js +1 -1
  136. package/dist/esm/Radio/DSRadio.js.map +1 -1
  137. package/dist/esm/RadioGroup/DSRadioGroup.js +1 -1
  138. package/dist/esm/RadioGroup/DSRadioGroup.js.map +1 -1
  139. package/dist/esm/RadioGroup/props.js +1 -1
  140. package/dist/esm/RadioGroup/props.js.map +1 -1
  141. package/dist/esm/TimeInput/DSTimeInput.js +1 -1
  142. package/dist/esm/TimeInput/DSTimeInput.js.map +1 -1
  143. package/dist/esm/Toggle/DSToggle.js +1 -1
  144. package/dist/esm/Toggle/DSToggle.js.map +1 -1
  145. package/package.json +22 -21
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import React2 from "react";
3
- import { PropTypes, describe } from "react-desc";
3
+ import { PropTypes, describe } from "@elliemae/ds-utilities";
4
4
  const DSError = ({ hasError = false, errorText = "Error" }) => {
5
5
  if (!hasError)
6
6
  return null;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/FormItem/Error/DSError.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { PropTypes, describe } from 'react-desc';\n\nconst DSError = ({ hasError = false, errorText = 'Error' }) => {\n if (!hasError) return null;\n return <div className=\"em-ds-error\">{errorText}</div>;\n};\n\nconst props = {\n /** error state */\n hasError: PropTypes.bool.description('error state'),\n /** error label text */\n errorText: PropTypes.string.description('error label text'),\n};\n\nDSError.propTypes = props;\nDSError.displayName = 'DSError';\nconst DSErrorWithSchema = describe(DSError);\n\nDSErrorWithSchema.propTypes = props;\n\nexport default DSError;\nexport { DSErrorWithSchema, DSError };\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\n\nconst DSError = ({ hasError = false, errorText = 'Error' }) => {\n if (!hasError) return null;\n return <div className=\"em-ds-error\">{errorText}</div>;\n};\n\nconst props = {\n /** error state */\n hasError: PropTypes.bool.description('error state'),\n /** error label text */\n errorText: PropTypes.string.description('error label text'),\n};\n\nDSError.propTypes = props;\nDSError.displayName = 'DSError';\nconst DSErrorWithSchema = describe(DSError);\n\nDSErrorWithSchema.propTypes = props;\n\nexport default DSError;\nexport { DSErrorWithSchema, DSError };\n"],
5
5
  "mappings": "AAAA;ACAA;AACA;AAEA,MAAM,UAAU,CAAC,EAAE,WAAW,OAAO,YAAY,cAAc;AAC7D,MAAI,CAAC;AAAU,WAAO;AACtB,SAAO,qCAAC;AAAA,IAAI,WAAU;AAAA,KAAe,SAAU;AACjD;AAEA,MAAM,QAAQ;AAAA,EAEZ,UAAU,UAAU,KAAK,YAAY,aAAa;AAAA,EAElD,WAAW,UAAU,OAAO,YAAY,kBAAkB;AAC5D;AAEA,QAAQ,YAAY;AACpB,QAAQ,cAAc;AACtB,MAAM,oBAAoB,SAAS,OAAO;AAE1C,kBAAkB,YAAY;AAE9B,IAAO,kBAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import styled from "styled-components";
2
+ import { styled } from "@elliemae/ds-system";
3
3
  const Suffix = styled.div`
4
4
  height: 2.16rem;
5
5
  align-items: center;
@@ -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 'styled-components';\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"],
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
5
  "mappings": "AAAA;ACCA;AAEO,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;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { PropTypes } from "react-desc";
2
+ import { PropTypes } from "@elliemae/ds-utilities";
3
3
  import { FORMITEM_LAYOUT_VARIANTS } from "./variants";
4
4
  const props = {
5
5
  containerProps: PropTypes.object.description("props to inject to form item layout wrapper"),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/FormItem/props.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from 'react-desc';\nimport { FORMITEM_LAYOUT_VARIANTS } from './variants';\n\nexport const props = {\n /** props to inject to form item layout wrapper */\n containerProps: PropTypes.object.description('props to inject to form item layout wrapper'),\n /** disableTooltip */\n disableTooltip: PropTypes.bool\n .description('Whether to show a tooltip or not when text does not fit')\n .defaultValue(true),\n /** position label on the left */\n leftLabel: PropTypes.bool.description('position label on the left'),\n /** turn on floating label */\n floatingLabel: PropTypes.bool.description('turn on floating label'),\n /** id for form item layout */\n id: PropTypes.string.description('id for form item layout'),\n /** html name prop for form tags */\n name: PropTypes.string.description('html name prop for form tags'),\n /** form item layout element value */\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]).description(\n 'form item layout element value',\n ),\n /** Any input component */\n inputComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).description('Any input component'),\n /** isShowElipsisActive */\n /** isShowElipsisActive */\n isShowElipsisActive: PropTypes.bool\n .description('Wheter to enable the ellipsis and tooltip functionality or not')\n .defaultValue(true),\n /** Label component */\n labelComponent: PropTypes.func.description('Label component'),\n /** feedback component to embed on form item */\n feedbackComponent: PropTypes.func.description('feedback component to embed on form item'),\n /** label text */\n labelText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).description('label text'),\n /** error state */\n hasError: PropTypes.bool.description('error state'),\n /** add fit content to form container */\n fitContent: PropTypes.bool.description(\n 'Adds fit content css property to the main container, making the layout width adapt to the input component',\n ),\n /** validation state */\n validationState: PropTypes.oneOf(['success', 'error', 'warning']).description('validation state'),\n /** validation message */\n validationMessage: PropTypes.string.description('validation message'),\n /** feedback message */\n feedbackMessage: PropTypes.string.description('feedback message'),\n /** read only form item */\n readOnly: PropTypes.bool.description('read only form item'),\n /** focused state */\n focused: PropTypes.bool.description('focused state'),\n /** input type */\n type: PropTypes.string.description('input type'),\n /** auto focus input */\n autoFocus: PropTypes.bool.description('auto focus input'),\n /** disabled state */\n disabled: PropTypes.bool.description('disabled state'),\n /** on change handler */\n onChange: PropTypes.func.description('on change handler'),\n /** on blur handler */\n onBlur: PropTypes.func.description('on blur handler'),\n /** extra input props to inject */\n extraInputProps: PropTypes.object.description('extra input props to inject'),\n /** extra content */\n extraContent: PropTypes.element.description('extra content'),\n /** left addon for form item */\n leftAddon: PropTypes.element.description('left addon for form item'),\n /** right addon for form item */\n rightAddon: PropTypes.element.description('right addon for form item'),\n /** add required mark */\n required: PropTypes.bool.description('add required mark'),\n /** add optional mark */\n optional: PropTypes.bool.description('add optional mark'),\n /** on focus handler */\n onFocus: PropTypes.func.description('on focus handler'),\n /** on paste handler */\n onPaste: PropTypes.func.description('on paste handler'),\n /** add truncation and ellipsis */\n truncateText: PropTypes.bool.description('add truncation and ellipsis'),\n /** on key up event handler */\n onKeyUp: PropTypes.func.description('on key up event handler'),\n /** mask for input mask component */\n mask: PropTypes.oneOfType([\n // PropTypes.oneOf(maskTypes),\n PropTypes.string,\n PropTypes.func,\n ]).description('mask for input mask component'),\n /** add suffix to input */\n useSubfix: PropTypes.string.description('add suffix to input'),\n /** suffix for input */\n suffix: PropTypes.string.description('suffix for input'),\n /** form item layout type */\n variant: PropTypes.oneOf([\n FORMITEM_LAYOUT_VARIANTS.DEFAULT,\n FORMITEM_LAYOUT_VARIANTS.FOCUS,\n FORMITEM_LAYOUT_VARIANTS.ACTIVE,\n FORMITEM_LAYOUT_VARIANTS.DISABLED,\n FORMITEM_LAYOUT_VARIANTS.READ_ONLY,\n FORMITEM_LAYOUT_VARIANTS.OPTIONAL,\n ]).description('form item layout type'),\n withHighlight: PropTypes.bool.description('adds highlight style to the input component'),\n};\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from '@elliemae/ds-utilities';\nimport { FORMITEM_LAYOUT_VARIANTS } from './variants';\n\nexport const props = {\n /** props to inject to form item layout wrapper */\n containerProps: PropTypes.object.description('props to inject to form item layout wrapper'),\n /** disableTooltip */\n disableTooltip: PropTypes.bool\n .description('Whether to show a tooltip or not when text does not fit')\n .defaultValue(true),\n /** position label on the left */\n leftLabel: PropTypes.bool.description('position label on the left'),\n /** turn on floating label */\n floatingLabel: PropTypes.bool.description('turn on floating label'),\n /** id for form item layout */\n id: PropTypes.string.description('id for form item layout'),\n /** html name prop for form tags */\n name: PropTypes.string.description('html name prop for form tags'),\n /** form item layout element value */\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]).description(\n 'form item layout element value',\n ),\n /** Any input component */\n inputComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).description('Any input component'),\n /** isShowElipsisActive */\n /** isShowElipsisActive */\n isShowElipsisActive: PropTypes.bool\n .description('Wheter to enable the ellipsis and tooltip functionality or not')\n .defaultValue(true),\n /** Label component */\n labelComponent: PropTypes.func.description('Label component'),\n /** feedback component to embed on form item */\n feedbackComponent: PropTypes.func.description('feedback component to embed on form item'),\n /** label text */\n labelText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).description('label text'),\n /** error state */\n hasError: PropTypes.bool.description('error state'),\n /** add fit content to form container */\n fitContent: PropTypes.bool.description(\n 'Adds fit content css property to the main container, making the layout width adapt to the input component',\n ),\n /** validation state */\n validationState: PropTypes.oneOf(['success', 'error', 'warning']).description('validation state'),\n /** validation message */\n validationMessage: PropTypes.string.description('validation message'),\n /** feedback message */\n feedbackMessage: PropTypes.string.description('feedback message'),\n /** read only form item */\n readOnly: PropTypes.bool.description('read only form item'),\n /** focused state */\n focused: PropTypes.bool.description('focused state'),\n /** input type */\n type: PropTypes.string.description('input type'),\n /** auto focus input */\n autoFocus: PropTypes.bool.description('auto focus input'),\n /** disabled state */\n disabled: PropTypes.bool.description('disabled state'),\n /** on change handler */\n onChange: PropTypes.func.description('on change handler'),\n /** on blur handler */\n onBlur: PropTypes.func.description('on blur handler'),\n /** extra input props to inject */\n extraInputProps: PropTypes.object.description('extra input props to inject'),\n /** extra content */\n extraContent: PropTypes.element.description('extra content'),\n /** left addon for form item */\n leftAddon: PropTypes.element.description('left addon for form item'),\n /** right addon for form item */\n rightAddon: PropTypes.element.description('right addon for form item'),\n /** add required mark */\n required: PropTypes.bool.description('add required mark'),\n /** add optional mark */\n optional: PropTypes.bool.description('add optional mark'),\n /** on focus handler */\n onFocus: PropTypes.func.description('on focus handler'),\n /** on paste handler */\n onPaste: PropTypes.func.description('on paste handler'),\n /** add truncation and ellipsis */\n truncateText: PropTypes.bool.description('add truncation and ellipsis'),\n /** on key up event handler */\n onKeyUp: PropTypes.func.description('on key up event handler'),\n /** mask for input mask component */\n mask: PropTypes.oneOfType([\n // PropTypes.oneOf(maskTypes),\n PropTypes.string,\n PropTypes.func,\n ]).description('mask for input mask component'),\n /** add suffix to input */\n useSubfix: PropTypes.string.description('add suffix to input'),\n /** suffix for input */\n suffix: PropTypes.string.description('suffix for input'),\n /** form item layout type */\n variant: PropTypes.oneOf([\n FORMITEM_LAYOUT_VARIANTS.DEFAULT,\n FORMITEM_LAYOUT_VARIANTS.FOCUS,\n FORMITEM_LAYOUT_VARIANTS.ACTIVE,\n FORMITEM_LAYOUT_VARIANTS.DISABLED,\n FORMITEM_LAYOUT_VARIANTS.READ_ONLY,\n FORMITEM_LAYOUT_VARIANTS.OPTIONAL,\n ]).description('form item layout type'),\n withHighlight: PropTypes.bool.description('adds highlight style to the input component'),\n};\n"],
5
5
  "mappings": "AAAA;ACAA;AACA;AAEO,MAAM,QAAQ;AAAA,EAEnB,gBAAgB,UAAU,OAAO,YAAY,6CAA6C;AAAA,EAE1F,gBAAgB,UAAU,KACvB,YAAY,yDAAyD,EACrE,aAAa,IAAI;AAAA,EAEpB,WAAW,UAAU,KAAK,YAAY,4BAA4B;AAAA,EAElE,eAAe,UAAU,KAAK,YAAY,wBAAwB;AAAA,EAElE,IAAI,UAAU,OAAO,YAAY,yBAAyB;AAAA,EAE1D,MAAM,UAAU,OAAO,YAAY,8BAA8B;AAAA,EAEjE,OAAO,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE,YACjF,gCACF;AAAA,EAEA,gBAAgB,UAAU,UAAU,CAAC,UAAU,MAAM,UAAU,OAAO,CAAC,EAAE,YAAY,qBAAqB;AAAA,EAG1G,qBAAqB,UAAU,KAC5B,YAAY,gEAAgE,EAC5E,aAAa,IAAI;AAAA,EAEpB,gBAAgB,UAAU,KAAK,YAAY,iBAAiB;AAAA,EAE5D,mBAAmB,UAAU,KAAK,YAAY,0CAA0C;AAAA,EAExF,WAAW,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,OAAO,CAAC,EAAE,YAAY,YAAY;AAAA,EAE9F,UAAU,UAAU,KAAK,YAAY,aAAa;AAAA,EAElD,YAAY,UAAU,KAAK,YACzB,2GACF;AAAA,EAEA,iBAAiB,UAAU,MAAM,CAAC,WAAW,SAAS,SAAS,CAAC,EAAE,YAAY,kBA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3B,CAAC,EAAE,YAAY,uBAAuB;AAAA,EACtC,eAAe,UAAU,KAAK,YAAY,6CAA6C;AACzF;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import React2 from "react";
3
- import { describe } from "react-desc";
3
+ import { describe } from "@elliemae/ds-utilities";
4
4
  import { AddonWrapper } from "./AddonWrapper";
5
5
  import { props } from "./props";
6
6
  import { defaultProps } from "./defaultProps";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/InputGroup/DSInputGroup.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from 'react-desc';\nimport { AddonWrapper } from './AddonWrapper';\nimport { props } from './props';\nimport { defaultProps } from './defaultProps';\n\nconst DSInputGroup = ({\n containerProps,\n innerRef,\n className,\n style,\n leftAddon,\n rightAddon,\n children: InputComponents, // as InputComponents,\n}) => (\n <AddonWrapper\n ref={innerRef}\n className={className}\n containerProps={containerProps}\n leftAddon={leftAddon}\n rightAddon={rightAddon}\n style={style}\n >\n {InputComponents}\n </AddonWrapper>\n);\n\nDSInputGroup.propTypes = props;\nDSInputGroup.defaultProps = defaultProps;\nDSInputGroup.displayName = 'DSInputGroup';\nconst DSInputGroupWithSchema = describe(DSInputGroup);\n\nDSInputGroupWithSchema.propTypes = props;\n\nexport default DSInputGroup;\nexport { DSInputGroupWithSchema, DSInputGroup };\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { AddonWrapper } from './AddonWrapper';\nimport { props } from './props';\nimport { defaultProps } from './defaultProps';\n\nconst DSInputGroup = ({\n containerProps,\n innerRef,\n className,\n style,\n leftAddon,\n rightAddon,\n children: InputComponents, // as InputComponents,\n}) => (\n <AddonWrapper\n ref={innerRef}\n className={className}\n containerProps={containerProps}\n leftAddon={leftAddon}\n rightAddon={rightAddon}\n style={style}\n >\n {InputComponents}\n </AddonWrapper>\n);\n\nDSInputGroup.propTypes = props;\nDSInputGroup.defaultProps = defaultProps;\nDSInputGroup.displayName = 'DSInputGroup';\nconst DSInputGroupWithSchema = describe(DSInputGroup);\n\nDSInputGroupWithSchema.propTypes = props;\n\nexport default DSInputGroup;\nexport { DSInputGroupWithSchema, DSInputGroup };\n"],
5
5
  "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AAEA,MAAM,eAAe,CAAC;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,MAEV,qCAAC;AAAA,EACC,KAAK;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,GAEC,eACH;AAGF,aAAa,YAAY;AACzB,aAAa,eAAe;AAC5B,aAAa,cAAc;AAC3B,MAAM,yBAAyB,SAAS,YAAY;AAEpD,uBAAuB,YAAY;AAEnC,IAAO,uBAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { PropTypes } from "react-desc";
2
+ import { PropTypes } from "@elliemae/ds-utilities";
3
3
  const props = {
4
4
  containerProps: PropTypes.shape({}).description("props injected to wrapper of page header"),
5
5
  innerRef: PropTypes.oneOfType([
@@ -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 'react-desc';\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"],
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
5
  "mappings": "AAAA;ACAA;AAEO,MAAM,QAAQ;AAAA,EAEnB,gBAAgB,UAAU,MAAM,CAAC,CAAC,EAAE,YAClC,0CACF;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,YAC3B,qDACF;AAAA,EAIA,YAAY,UAAU,QAAQ,YAC5B,sDACF;AAAA,EAIA,UAAU,UAAU,QAAQ,YAAY,0BAA0B;AACpE;",
6
6
  "names": []
7
7
  }
@@ -31,7 +31,7 @@ var __objRest = (source, exclude) => {
31
31
  };
32
32
  import * as React from "react";
33
33
  import React2, { useCallback, useEffect, useState } from "react";
34
- import { describe } from "react-desc";
34
+ import { describe } from "@elliemae/ds-utilities";
35
35
  import { MASK_TYPES } from "./MaskTypes";
36
36
  import { MASK_PIPES } from "./MaskPipes";
37
37
  import { DSInputMaskDeprecated } from "./DSInputMaskDeprecated";
@@ -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 'react-desc';\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"],
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
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,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;AAAA,QACf;AACJ,YAAQ;AAAA,EACV;AACA,SAAO;AACT;AAEA,MAAM,cAAc,CAAC,OAQf;AARe,eACnB;AAAA,kBAAc,YAAY;AAAA,IAC1B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,MANY,IAOhB,iBAPgB,IAOhB;A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EACT;AACA,SACE,qCAAC,wDACK,OADL;AAAA,IAEC,cAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA,MAAM,kBAAkB;AAAA,IACxB;AAAA,IACA,OAAO;AAAA,IACT;AAEJ;AAEA,YAAY,YAAY;AACxB,YAAY,eAAe;AAC3B,YAAY,cAAc;AAC1B,MAAM,wBAAwB,SAAS,WAAW,EAAE,YAClD,kCACF;AACA,sBAAsB,YAAY;AAGlC,IAAO,sBAAQ;",
6
6
  "names": []
7
7
  }
@@ -31,7 +31,7 @@ var __objRest = (source, exclude) => {
31
31
  };
32
32
  import * as React from "react";
33
33
  import React2, { useCallback, useLayoutEffect, useRef, useState } from "react";
34
- import { PropTypes } from "react-desc";
34
+ import { PropTypes } from "@elliemae/ds-utilities";
35
35
  import { DSTextBox } from "../../TextBox";
36
36
  import { setCaretPosition } from "../utils/setCaretPosition";
37
37
  const conformValue = (rawValue, cursorPos, lastkeycode) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/mask_types/DateInputMask.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from 'react-desc';\nimport { DSTextBox } from '../../TextBox';\nimport { TCharsToAdd } from '../types';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst conformValue = (\n rawValue: string,\n cursorPos: number,\n lastkeycode: number,\n) => {\n const nextMaskedValue = rawValue\n .split('')\n .filter((char) => char >= '0' && char <= '9')\n .slice(0, 8);\n\n let maskedPos = 0;\n for (let i = 0; i < cursorPos; i += 1) {\n if (nextMaskedValue[maskedPos] === rawValue[i]) maskedPos += 1;\n }\n\n // list of [string to add, position to add]\n const charactersToAdd: TCharsToAdd = [\n ['/', 2],\n ['/', 5],\n ];\n\n charactersToAdd.forEach(([chars, pos]) => {\n if (nextMaskedValue.length > pos) {\n nextMaskedValue.splice(pos, 0, chars);\n if (maskedPos >= pos) maskedPos += chars.length;\n }\n });\n\n if (lastkeycode !== 8 && maskedPos < nextMaskedValue.length) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos) maskedPos += chars.length;\n });\n } else if (lastkeycode === 8 && maskedPos) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos + 1) maskedPos -= chars.length;\n });\n }\n\n return { nextMaskedValue: nextMaskedValue.join(''), maskedPos };\n};\n\nconst DateInputMask = ({\n focus,\n setFocus,\n setRawMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n style,\n disabled,\n className,\n name,\n maxLength,\n minLength,\n fluidWidth,\n placeholder,\n onKeyDown,\n onClick,\n onChange,\n onFocus,\n onBlur,\n onPaste,\n onKeyUp,\n hasError,\n readOnly,\n type,\n innerRef,\n clearable = false,\n leftComponent,\n rightComponent,\n value,\n ...rest\n}) => {\n const inputRef = useRef();\n const [maskedValue, setMaskedValue] = useState(value);\n\n const conform = useCallback(\n ({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true }) => {\n const { nextMaskedValue, maskedPos } = conformValue(\n rawValue,\n cursorPos,\n lastkeycode,\n );\n const event = {\n target: {\n value: nextMaskedValue,\n originalValue: rawValue,\n },\n };\n if (onChange && nextMaskedValue !== maskedValue) onChange(event);\n\n setMaskedValue(nextMaskedValue);\n setRawValue(nextMaskedValue);\n\n if (shouldUpdateCursorPos) setCursorPosition({ current: maskedPos });\n },\n [maskedValue, onChange],\n );\n\n const handleOnChange = useCallback(\n (e) => {\n const { value: rawValue, selectionEnd } = e.target;\n setRawMask(rawValue);\n setRawValue(rawValue);\n setCursorPosition({ current: selectionEnd });\n setFocus(true);\n },\n [setRawMask, setRawValue, setCursorPosition, setFocus, lastkey.code],\n );\n\n useLayoutEffect(() => {\n if (focus) setCaretPosition(inputRef.current, cursorPosition.current);\n }, [focus, cursorPosition]);\n\n useLayoutEffect(() => {\n // if the value changes, then re-conform the mask\n conform({\n rawValue: value,\n cursorPos: cursorPosition.current,\n lastkeycode: lastkey.code,\n shouldUpdateCursorPos: focus,\n });\n }, [focus, value, cursorPosition.current]);\n\n const handleKeyDown = useCallback(\n (e) => {\n e.stopPropagation();\n setLastkey({ key: e.key, code: e.keyCode });\n onKeyDown(e);\n },\n [onKeyDown],\n );\n\n const handleBlur = useCallback(\n (e) => {\n setFocus(false);\n onBlur(e);\n },\n [onBlur],\n );\n\n return (\n <DSTextBox\n {...rest}\n className={className}\n clearable={clearable}\n disabled={disabled}\n fluidWidth={fluidWidth}\n hasError={hasError}\n innerRef={(ref) => {\n inputRef.current = ref;\n if (innerRef) innerRef(ref);\n }}\n isActive={focus}\n leftComponent={leftComponent}\n maxLength={maxLength}\n minLength={minLength}\n name={name}\n onBlur={handleBlur}\n onChange={handleOnChange}\n onClick={onClick}\n onFocus={onFocus}\n onKeyDown={handleKeyDown}\n onKeyUp={onKeyUp}\n onPaste={onPaste}\n placeholder={placeholder}\n readOnly={readOnly}\n rightComponent={rightComponent}\n style={style}\n type={type}\n value={maskedValue}\n />\n );\n};\n\nDateInputMask.propTypes = {\n focus: PropTypes.bool,\n setFocus: PropTypes.func,\n setRawMask: PropTypes.func,\n cursorPosition: PropTypes.shape({ current: PropTypes.number }),\n setCursorPosition: PropTypes.func,\n lastkey: PropTypes.shape({ code: PropTypes.number, key: PropTypes.string }),\n setLastkey: PropTypes.func,\n setRawValue: PropTypes.func,\n style: PropTypes.object,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n name: PropTypes.string,\n maxLength: PropTypes.number,\n minLength: PropTypes.number,\n fluidWidth: PropTypes.bool,\n placeholder: PropTypes.string,\n value: PropTypes.string,\n onChange: PropTypes.func,\n onKeyDown: PropTypes.func,\n leftComponent: PropTypes.element,\n rightComponent: PropTypes.element,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n onPaste: PropTypes.func,\n onKeyUp: PropTypes.func,\n hasError: PropTypes.bool,\n readOnly: PropTypes.bool,\n onClick: PropTypes.func,\n clearable: PropTypes.bool,\n type: PropTypes.string,\n innerRef: PropTypes.any,\n mask: PropTypes.any,\n placeholderChar: PropTypes.string,\n};\n\nexport { DateInputMask };\nexport default DateInputMask;\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from '@elliemae/ds-utilities';\nimport { DSTextBox } from '../../TextBox';\nimport { TCharsToAdd } from '../types';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst conformValue = (\n rawValue: string,\n cursorPos: number,\n lastkeycode: number,\n) => {\n const nextMaskedValue = rawValue\n .split('')\n .filter((char) => char >= '0' && char <= '9')\n .slice(0, 8);\n\n let maskedPos = 0;\n for (let i = 0; i < cursorPos; i += 1) {\n if (nextMaskedValue[maskedPos] === rawValue[i]) maskedPos += 1;\n }\n\n // list of [string to add, position to add]\n const charactersToAdd: TCharsToAdd = [\n ['/', 2],\n ['/', 5],\n ];\n\n charactersToAdd.forEach(([chars, pos]) => {\n if (nextMaskedValue.length > pos) {\n nextMaskedValue.splice(pos, 0, chars);\n if (maskedPos >= pos) maskedPos += chars.length;\n }\n });\n\n if (lastkeycode !== 8 && maskedPos < nextMaskedValue.length) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos) maskedPos += chars.length;\n });\n } else if (lastkeycode === 8 && maskedPos) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos + 1) maskedPos -= chars.length;\n });\n }\n\n return { nextMaskedValue: nextMaskedValue.join(''), maskedPos };\n};\n\nconst DateInputMask = ({\n focus,\n setFocus,\n setRawMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n style,\n disabled,\n className,\n name,\n maxLength,\n minLength,\n fluidWidth,\n placeholder,\n onKeyDown,\n onClick,\n onChange,\n onFocus,\n onBlur,\n onPaste,\n onKeyUp,\n hasError,\n readOnly,\n type,\n innerRef,\n clearable = false,\n leftComponent,\n rightComponent,\n value,\n ...rest\n}) => {\n const inputRef = useRef();\n const [maskedValue, setMaskedValue] = useState(value);\n\n const conform = useCallback(\n ({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true }) => {\n const { nextMaskedValue, maskedPos } = conformValue(\n rawValue,\n cursorPos,\n lastkeycode,\n );\n const event = {\n target: {\n value: nextMaskedValue,\n originalValue: rawValue,\n },\n };\n if (onChange && nextMaskedValue !== maskedValue) onChange(event);\n\n setMaskedValue(nextMaskedValue);\n setRawValue(nextMaskedValue);\n\n if (shouldUpdateCursorPos) setCursorPosition({ current: maskedPos });\n },\n [maskedValue, onChange],\n );\n\n const handleOnChange = useCallback(\n (e) => {\n const { value: rawValue, selectionEnd } = e.target;\n setRawMask(rawValue);\n setRawValue(rawValue);\n setCursorPosition({ current: selectionEnd });\n setFocus(true);\n },\n [setRawMask, setRawValue, setCursorPosition, setFocus, lastkey.code],\n );\n\n useLayoutEffect(() => {\n if (focus) setCaretPosition(inputRef.current, cursorPosition.current);\n }, [focus, cursorPosition]);\n\n useLayoutEffect(() => {\n // if the value changes, then re-conform the mask\n conform({\n rawValue: value,\n cursorPos: cursorPosition.current,\n lastkeycode: lastkey.code,\n shouldUpdateCursorPos: focus,\n });\n }, [focus, value, cursorPosition.current]);\n\n const handleKeyDown = useCallback(\n (e) => {\n e.stopPropagation();\n setLastkey({ key: e.key, code: e.keyCode });\n onKeyDown(e);\n },\n [onKeyDown],\n );\n\n const handleBlur = useCallback(\n (e) => {\n setFocus(false);\n onBlur(e);\n },\n [onBlur],\n );\n\n return (\n <DSTextBox\n {...rest}\n className={className}\n clearable={clearable}\n disabled={disabled}\n fluidWidth={fluidWidth}\n hasError={hasError}\n innerRef={(ref) => {\n inputRef.current = ref;\n if (innerRef) innerRef(ref);\n }}\n isActive={focus}\n leftComponent={leftComponent}\n maxLength={maxLength}\n minLength={minLength}\n name={name}\n onBlur={handleBlur}\n onChange={handleOnChange}\n onClick={onClick}\n onFocus={onFocus}\n onKeyDown={handleKeyDown}\n onKeyUp={onKeyUp}\n onPaste={onPaste}\n placeholder={placeholder}\n readOnly={readOnly}\n rightComponent={rightComponent}\n style={style}\n type={type}\n value={maskedValue}\n />\n );\n};\n\nDateInputMask.propTypes = {\n focus: PropTypes.bool,\n setFocus: PropTypes.func,\n setRawMask: PropTypes.func,\n cursorPosition: PropTypes.shape({ current: PropTypes.number }),\n setCursorPosition: PropTypes.func,\n lastkey: PropTypes.shape({ code: PropTypes.number, key: PropTypes.string }),\n setLastkey: PropTypes.func,\n setRawValue: PropTypes.func,\n style: PropTypes.object,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n name: PropTypes.string,\n maxLength: PropTypes.number,\n minLength: PropTypes.number,\n fluidWidth: PropTypes.bool,\n placeholder: PropTypes.string,\n value: PropTypes.string,\n onChange: PropTypes.func,\n onKeyDown: PropTypes.func,\n leftComponent: PropTypes.element,\n rightComponent: PropTypes.element,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n onPaste: PropTypes.func,\n onKeyUp: PropTypes.func,\n hasError: PropTypes.bool,\n readOnly: PropTypes.bool,\n onClick: PropTypes.func,\n clearable: PropTypes.bool,\n type: PropTypes.string,\n innerRef: PropTypes.any,\n mask: PropTypes.any,\n placeholderChar: PropTypes.string,\n};\n\nexport { DateInputMask };\nexport default DateInputMask;\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACEA;AACA;AACA;AAEA;AAEA,MAAM,eAAe,CACnB,UACA,WACA,gBACG;AACH,QAAM,kBAAkB,SACrB,MAAM,EAAE,EACR,OAAO,CAAC,SAAS,QAAQ,OAAO,QAAQ,GAAG,EAC3C,MAAM,GAAG,CAAC;AAEb,MAAI,YAAY;AAChB,WAAS,IAAI,GAAG,IAAI,WAAW,KAAK,GAAG;A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EACvB,OAAO,UAAU;AAAA,EACjB,UAAU,UAAU;AAAA,EACpB,WAAW,UAAU;AAAA,EACrB,eAAe,UAAU;AAAA,EACzB,gBAAgB,UAAU;AAAA,EAC1B,SAAS,UAAU;AAAA,EACnB,QAAQ,UAAU;AAAA,EAClB,SAAS,UAAU;AAAA,EACnB,SAAS,UAAU;AAAA,EACnB,UAAU,UAAU;AAAA,EACpB,UAAU,UAAU;AAAA,EACpB,SAAS,UAAU;AAAA,EACnB,WAAW,UAAU;AAAA,EACrB,MAAM,UAAU;AAAA,EAChB,UAAU,UAAU;AAAA,EACpB,MAAM,UAAU;AAAA,EAChB,iBAAiB,UAAU;AAC7B;AAGA,IAAO,wBAAQ;",
6
6
  "names": []
7
7
  }
@@ -31,7 +31,7 @@ var __objRest = (source, exclude) => {
31
31
  };
32
32
  import * as React from "react";
33
33
  import React2, { useCallback, useLayoutEffect, useRef, useState } from "react";
34
- import { PropTypes } from "react-desc";
34
+ import { PropTypes } from "@elliemae/ds-utilities";
35
35
  import { DSTextBox } from "../../TextBox";
36
36
  import { setCaretPosition } from "../utils/setCaretPosition";
37
37
  const conformValue = (rawValue, cursorPos, lastkeycode) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/mask_types/DateTimeInputMask.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from 'react-desc';\nimport { DSTextBox } from '../../TextBox';\nimport { TCharsToAdd } from '../types';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst conformValue = (\n rawValue: string,\n cursorPos: number,\n lastkeycode: number,\n) => {\n const nextMaskedValue = rawValue\n .split('')\n .filter((char) => char >= '0' && char <= '9')\n .slice(0, 12);\n\n while (nextMaskedValue.length > 8 && !nextMaskedValue[8].match(/[0-2]/))\n nextMaskedValue.splice(8, 1);\n while (nextMaskedValue.length > 10 && !nextMaskedValue[10].match(/[0-5]/))\n nextMaskedValue.splice(10, 1);\n\n let maskedPos = 0;\n for (let i = 0; i < cursorPos; i += 1) {\n if (nextMaskedValue[maskedPos] === rawValue[i]) maskedPos += 1;\n }\n\n // list of [string to add, position to add]\n const charactersToAdd: TCharsToAdd = [\n ['/', 2],\n ['/', 5],\n [' ', 10],\n [':', 13],\n ];\n\n charactersToAdd.forEach(([chars, pos]) => {\n if (nextMaskedValue.length > pos) {\n nextMaskedValue.splice(pos, 0, chars);\n if (maskedPos >= pos) maskedPos += chars.length;\n }\n });\n\n if (lastkeycode !== 8 && maskedPos < nextMaskedValue.length) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos) maskedPos += chars.length;\n });\n } else if (lastkeycode === 8 && maskedPos) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos + 1) maskedPos -= chars.length;\n });\n }\n\n return { nextMaskedValue: nextMaskedValue.join(''), maskedPos };\n};\n\nconst DateTimeInputMask = ({\n focus,\n setFocus,\n setRawMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n style,\n disabled,\n className,\n name,\n maxLength,\n minLength,\n fluidWidth,\n placeholder,\n onKeyDown,\n onClick,\n onChange,\n onFocus,\n onBlur,\n onPaste,\n onKeyUp,\n hasError,\n readOnly,\n type,\n innerRef,\n clearable = false,\n leftComponent,\n rightComponent,\n value,\n ...rest\n}) => {\n const inputRef = useRef();\n const [maskedValue, setMaskedValue] = useState(value);\n\n const conform = useCallback(\n ({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true }) => {\n const { nextMaskedValue, maskedPos } = conformValue(\n rawValue,\n cursorPos,\n lastkeycode,\n );\n const event = {\n target: {\n value: nextMaskedValue,\n originalValue: rawValue,\n },\n };\n if (onChange && nextMaskedValue !== maskedValue) onChange(event);\n\n setMaskedValue(nextMaskedValue);\n setRawValue(nextMaskedValue);\n\n if (shouldUpdateCursorPos) setCursorPosition({ current: maskedPos });\n },\n [maskedValue, onChange],\n );\n\n const handleOnChange = useCallback(\n (e) => {\n const { value: rawValue, selectionEnd } = e.target;\n setRawMask(rawValue);\n setRawValue(rawValue);\n setCursorPosition({ current: selectionEnd });\n setFocus(true);\n },\n [setRawMask, setRawValue, setCursorPosition, setFocus, lastkey.code],\n );\n\n useLayoutEffect(() => {\n if (focus) setCaretPosition(inputRef.current, cursorPosition.current);\n }, [focus, cursorPosition]);\n\n useLayoutEffect(() => {\n // if the value changes, then re-conform the mask\n conform({\n rawValue: value,\n cursorPos: cursorPosition.current,\n lastkeycode: lastkey.code,\n shouldUpdateCursorPos: focus,\n });\n }, [focus, value, cursorPosition.current]);\n\n const handleKeyDown = useCallback(\n (e) => {\n e.stopPropagation();\n setLastkey({ key: e.key, code: e.keyCode });\n onKeyDown(e);\n },\n [onKeyDown],\n );\n\n const handleBlur = useCallback(\n (e) => {\n setFocus(false);\n onBlur(e);\n },\n [onBlur],\n );\n\n return (\n <DSTextBox\n {...rest}\n className={className}\n clearable={clearable}\n disabled={disabled}\n fluidWidth={fluidWidth}\n hasError={hasError}\n innerRef={(ref) => {\n inputRef.current = ref;\n if (innerRef) innerRef(ref);\n }}\n isActive={focus}\n leftComponent={leftComponent}\n maxLength={maxLength}\n minLength={minLength}\n name={name}\n onBlur={handleBlur}\n onChange={handleOnChange}\n onClick={onClick}\n onFocus={onFocus}\n onKeyDown={handleKeyDown}\n onKeyUp={onKeyUp}\n onPaste={onPaste}\n placeholder={placeholder}\n readOnly={readOnly}\n rightComponent={rightComponent}\n style={style}\n type={type}\n value={maskedValue}\n />\n );\n};\n\nDateTimeInputMask.propTypes = {\n focus: PropTypes.bool,\n setFocus: PropTypes.func,\n setRawMask: PropTypes.func,\n cursorPosition: PropTypes.shape({ current: PropTypes.number }),\n setCursorPosition: PropTypes.func,\n lastkey: PropTypes.shape({ code: PropTypes.number, key: PropTypes.string }),\n setLastkey: PropTypes.func,\n setRawValue: PropTypes.func,\n style: PropTypes.object,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n name: PropTypes.string,\n maxLength: PropTypes.number,\n minLength: PropTypes.number,\n fluidWidth: PropTypes.bool,\n placeholder: PropTypes.string,\n value: PropTypes.string,\n onChange: PropTypes.func,\n onKeyDown: PropTypes.func,\n leftComponent: PropTypes.element,\n rightComponent: PropTypes.element,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n onPaste: PropTypes.func,\n onKeyUp: PropTypes.func,\n hasError: PropTypes.bool,\n readOnly: PropTypes.bool,\n onClick: PropTypes.func,\n clearable: PropTypes.bool,\n type: PropTypes.string,\n innerRef: PropTypes.any,\n mask: PropTypes.any,\n placeholderChar: PropTypes.string,\n};\n\nexport { DateTimeInputMask };\nexport default DateTimeInputMask;\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from '@elliemae/ds-utilities';\nimport { DSTextBox } from '../../TextBox';\nimport { TCharsToAdd } from '../types';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst conformValue = (\n rawValue: string,\n cursorPos: number,\n lastkeycode: number,\n) => {\n const nextMaskedValue = rawValue\n .split('')\n .filter((char) => char >= '0' && char <= '9')\n .slice(0, 12);\n\n while (nextMaskedValue.length > 8 && !nextMaskedValue[8].match(/[0-2]/))\n nextMaskedValue.splice(8, 1);\n while (nextMaskedValue.length > 10 && !nextMaskedValue[10].match(/[0-5]/))\n nextMaskedValue.splice(10, 1);\n\n let maskedPos = 0;\n for (let i = 0; i < cursorPos; i += 1) {\n if (nextMaskedValue[maskedPos] === rawValue[i]) maskedPos += 1;\n }\n\n // list of [string to add, position to add]\n const charactersToAdd: TCharsToAdd = [\n ['/', 2],\n ['/', 5],\n [' ', 10],\n [':', 13],\n ];\n\n charactersToAdd.forEach(([chars, pos]) => {\n if (nextMaskedValue.length > pos) {\n nextMaskedValue.splice(pos, 0, chars);\n if (maskedPos >= pos) maskedPos += chars.length;\n }\n });\n\n if (lastkeycode !== 8 && maskedPos < nextMaskedValue.length) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos) maskedPos += chars.length;\n });\n } else if (lastkeycode === 8 && maskedPos) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos + 1) maskedPos -= chars.length;\n });\n }\n\n return { nextMaskedValue: nextMaskedValue.join(''), maskedPos };\n};\n\nconst DateTimeInputMask = ({\n focus,\n setFocus,\n setRawMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n style,\n disabled,\n className,\n name,\n maxLength,\n minLength,\n fluidWidth,\n placeholder,\n onKeyDown,\n onClick,\n onChange,\n onFocus,\n onBlur,\n onPaste,\n onKeyUp,\n hasError,\n readOnly,\n type,\n innerRef,\n clearable = false,\n leftComponent,\n rightComponent,\n value,\n ...rest\n}) => {\n const inputRef = useRef();\n const [maskedValue, setMaskedValue] = useState(value);\n\n const conform = useCallback(\n ({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true }) => {\n const { nextMaskedValue, maskedPos } = conformValue(\n rawValue,\n cursorPos,\n lastkeycode,\n );\n const event = {\n target: {\n value: nextMaskedValue,\n originalValue: rawValue,\n },\n };\n if (onChange && nextMaskedValue !== maskedValue) onChange(event);\n\n setMaskedValue(nextMaskedValue);\n setRawValue(nextMaskedValue);\n\n if (shouldUpdateCursorPos) setCursorPosition({ current: maskedPos });\n },\n [maskedValue, onChange],\n );\n\n const handleOnChange = useCallback(\n (e) => {\n const { value: rawValue, selectionEnd } = e.target;\n setRawMask(rawValue);\n setRawValue(rawValue);\n setCursorPosition({ current: selectionEnd });\n setFocus(true);\n },\n [setRawMask, setRawValue, setCursorPosition, setFocus, lastkey.code],\n );\n\n useLayoutEffect(() => {\n if (focus) setCaretPosition(inputRef.current, cursorPosition.current);\n }, [focus, cursorPosition]);\n\n useLayoutEffect(() => {\n // if the value changes, then re-conform the mask\n conform({\n rawValue: value,\n cursorPos: cursorPosition.current,\n lastkeycode: lastkey.code,\n shouldUpdateCursorPos: focus,\n });\n }, [focus, value, cursorPosition.current]);\n\n const handleKeyDown = useCallback(\n (e) => {\n e.stopPropagation();\n setLastkey({ key: e.key, code: e.keyCode });\n onKeyDown(e);\n },\n [onKeyDown],\n );\n\n const handleBlur = useCallback(\n (e) => {\n setFocus(false);\n onBlur(e);\n },\n [onBlur],\n );\n\n return (\n <DSTextBox\n {...rest}\n className={className}\n clearable={clearable}\n disabled={disabled}\n fluidWidth={fluidWidth}\n hasError={hasError}\n innerRef={(ref) => {\n inputRef.current = ref;\n if (innerRef) innerRef(ref);\n }}\n isActive={focus}\n leftComponent={leftComponent}\n maxLength={maxLength}\n minLength={minLength}\n name={name}\n onBlur={handleBlur}\n onChange={handleOnChange}\n onClick={onClick}\n onFocus={onFocus}\n onKeyDown={handleKeyDown}\n onKeyUp={onKeyUp}\n onPaste={onPaste}\n placeholder={placeholder}\n readOnly={readOnly}\n rightComponent={rightComponent}\n style={style}\n type={type}\n value={maskedValue}\n />\n );\n};\n\nDateTimeInputMask.propTypes = {\n focus: PropTypes.bool,\n setFocus: PropTypes.func,\n setRawMask: PropTypes.func,\n cursorPosition: PropTypes.shape({ current: PropTypes.number }),\n setCursorPosition: PropTypes.func,\n lastkey: PropTypes.shape({ code: PropTypes.number, key: PropTypes.string }),\n setLastkey: PropTypes.func,\n setRawValue: PropTypes.func,\n style: PropTypes.object,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n name: PropTypes.string,\n maxLength: PropTypes.number,\n minLength: PropTypes.number,\n fluidWidth: PropTypes.bool,\n placeholder: PropTypes.string,\n value: PropTypes.string,\n onChange: PropTypes.func,\n onKeyDown: PropTypes.func,\n leftComponent: PropTypes.element,\n rightComponent: PropTypes.element,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n onPaste: PropTypes.func,\n onKeyUp: PropTypes.func,\n hasError: PropTypes.bool,\n readOnly: PropTypes.bool,\n onClick: PropTypes.func,\n clearable: PropTypes.bool,\n type: PropTypes.string,\n innerRef: PropTypes.any,\n mask: PropTypes.any,\n placeholderChar: PropTypes.string,\n};\n\nexport { DateTimeInputMask };\nexport default DateTimeInputMask;\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACGA;AACA;AACA;AAEA;AAEA,MAAM,eAAe,CACnB,UACA,WACA,gBACG;AACH,QAAM,kBAAkB,SACrB,MAAM,EAAE,EACR,OAAO,CAAC,SAAS,QAAQ,OAAO,QAAQ,GAAG,EAC3C,MAAM,GAAG,EAAE;AAEd,SAAO,gBAAgB,SAAS,KAAK,CAAC,gBAAgB,GAAG,MAAM,OAAO;AACpE,oBAAgB,OAAO,GAAG,CAAC;AAC7B,SAAO,gBAAgB,SAAS,MAAM,CAAC,gBAAgB,IAAI,MAAM,OAAO;AACtE,oBAAgB,OAAO,IAAI,CAAC;AAE9B,MAAI,YAAY;AAChB,WAAS,IAAI,GAAG,IAAI,WAAW,KAAK,GAAG;AACrC,QAAI,gBAAgB,eAAe,SAAS;AAAI,mBAAa;AAAA,EAC/D;AAGA,QAAM,kBAA+B;AAAA,IACnC,CAAC,KAAK,CAAC;AAAA,IACP,CAAC,KAAK,CAAC;AAAA,IACP,CAAC,KAAK,EAAE;AAAA,IACR,CAAC,KAAK,EAAE;AAAA,EACV;AAEA,kBAAgB,QAAQ,CAAC,CAAC,OAAO,SAAS;AACxC,QAAI,gBAAgB,SAAS,KAAK;AAChC,sBAAgB,OAAO,KAAK,GAAG,KAAK;AACpC,UAAI,aAAa;AAAK,qBAAa,MAAM;AAAA,IAC3C;AAAA,EACF,CAAC;AAED,MAAI,gBAAgB,KAAK,YAAY,gBAAgB,QAAQ;AAC3D,oBAAgB,QAAQ,CAAC,CAAC,OAAO,SAAS;AACx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IAAO,4BAAQ;",
6
6
  "names": []
7
7
  }
@@ -31,7 +31,7 @@ var __objRest = (source, exclude) => {
31
31
  };
32
32
  import * as React from "react";
33
33
  import React2, { useCallback, useLayoutEffect, useRef, useState } from "react";
34
- import { PropTypes } from "react-desc";
34
+ import { PropTypes } from "@elliemae/ds-utilities";
35
35
  import { DSTextBox } from "../../TextBox";
36
36
  import { setCaretPosition } from "../utils/setCaretPosition";
37
37
  const startsWith = (a, b, ignoreCase) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/mask_types/DictionaryInputMask.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-loop-func */\n/* eslint-disable max-params */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from 'react-desc';\nimport { DSTextBox } from '../../TextBox';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst startsWith = (a: string, b: string, ignoreCase: boolean): boolean => {\n if (ignoreCase) {\n a = a.toLowerCase();\n b = b.toLowerCase();\n }\n return a.startsWith(b);\n};\n\nconst conformValue = (\n rawValue: string,\n cursorPos: number,\n lastkeycode: number,\n allowedWords: string[],\n ignoreCase: boolean,\n) => {\n let nextMaskedValue = '';\n let currentPosibleWords = allowedWords;\n for (let i = 0; i < rawValue.length; i += 1) {\n const matchingWords = currentPosibleWords.filter((word) =>\n startsWith(word, nextMaskedValue + rawValue[i], ignoreCase),\n );\n if (matchingWords.length) {\n nextMaskedValue += rawValue[i];\n currentPosibleWords = matchingWords;\n }\n }\n\n return { nextMaskedValue, maskedPos: cursorPos };\n};\n\nconst DictionaryInputMask = ({\n focus,\n setFocus,\n setRawMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n allowedWords,\n ignoreCase = true,\n autoFocus,\n style,\n disabled,\n className,\n name,\n maxLength,\n minLength,\n fluidWidth,\n placeholder,\n onKeyDown,\n onClick,\n onChange,\n onFocus,\n onBlur,\n onPaste,\n onKeyUp,\n hasError,\n readOnly,\n type,\n innerRef,\n clearable = false,\n leftComponent,\n rightComponent,\n value,\n ...rest\n}) => {\n const inputRef = useRef();\n const [maskedValue, setMaskedValue] = useState(value);\n\n const conform = useCallback(\n ({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true }) => {\n const { nextMaskedValue, maskedPos } = conformValue(\n rawValue,\n cursorPos,\n lastkeycode,\n allowedWords,\n ignoreCase,\n );\n const event = {\n target: {\n value: nextMaskedValue,\n originalValue: rawValue,\n },\n };\n if (onChange && nextMaskedValue !== maskedValue) onChange(event);\n\n setMaskedValue(nextMaskedValue);\n setRawValue(nextMaskedValue);\n\n if (shouldUpdateCursorPos) setCursorPosition({ current: maskedPos });\n },\n [maskedValue, onChange],\n );\n\n const handleOnChange = useCallback(\n (e) => {\n const { value: rawValue, selectionEnd } = e.target;\n setRawMask(rawValue);\n setRawValue(rawValue);\n setCursorPosition({ current: selectionEnd });\n setFocus(true);\n },\n [setRawMask, setRawValue, setCursorPosition, setFocus, lastkey.code],\n );\n\n useLayoutEffect(() => {\n if (focus) setCaretPosition(inputRef.current, cursorPosition.current);\n }, [focus, cursorPosition]);\n\n useLayoutEffect(() => {\n // if the value changes, then re-conform the mask\n conform({\n rawValue: value,\n cursorPos: cursorPosition.current,\n lastkeycode: lastkey.code,\n shouldUpdateCursorPos: focus,\n });\n }, [focus, value, cursorPosition.current]);\n\n const handleKeyDown = useCallback(\n (e) => {\n e.stopPropagation();\n setLastkey({ key: e.key, code: e.keyCode });\n onKeyDown(e);\n },\n [onKeyDown],\n );\n\n const handleBlur = useCallback(\n (e) => {\n setFocus(false);\n onBlur(e);\n },\n [onBlur],\n );\n\n return (\n <DSTextBox\n {...rest}\n className={className}\n clearable={clearable}\n disabled={disabled}\n fluidWidth={fluidWidth}\n hasError={hasError}\n innerRef={(ref) => {\n inputRef.current = ref;\n if (innerRef) innerRef(ref);\n }}\n isActive={focus}\n leftComponent={leftComponent}\n maxLength={maxLength}\n minLength={minLength}\n name={name}\n onBlur={handleBlur}\n onChange={handleOnChange}\n onClick={onClick}\n onFocus={onFocus}\n onKeyDown={handleKeyDown}\n onKeyUp={onKeyUp}\n onPaste={onPaste}\n placeholder={placeholder}\n readOnly={readOnly}\n rightComponent={rightComponent}\n style={style}\n type={type}\n value={maskedValue}\n />\n );\n};\n\nDictionaryInputMask.propTypes = {\n focus: PropTypes.bool,\n setFocus: PropTypes.func,\n setRawMask: PropTypes.func,\n cursorPosition: PropTypes.shape({ current: PropTypes.number }),\n setCursorPosition: PropTypes.func,\n lastkey: PropTypes.shape({ code: PropTypes.number, key: PropTypes.string }),\n setLastkey: PropTypes.func,\n setRawValue: PropTypes.func,\n allowedWords: PropTypes.arrayOf(PropTypes.string),\n ignoreCase: PropTypes.bool,\n autoFocus: PropTypes.bool,\n style: PropTypes.object,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n name: PropTypes.string,\n maxLength: PropTypes.number,\n minLength: PropTypes.number,\n fluidWidth: PropTypes.bool,\n placeholder: PropTypes.string,\n value: PropTypes.string,\n onChange: PropTypes.func,\n onKeyDown: PropTypes.func,\n leftComponent: PropTypes.element,\n rightComponent: PropTypes.element,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n onPaste: PropTypes.func,\n onKeyUp: PropTypes.func,\n hasError: PropTypes.bool,\n readOnly: PropTypes.bool,\n onClick: PropTypes.func,\n clearable: PropTypes.bool,\n type: PropTypes.string,\n innerRef: PropTypes.any,\n mask: PropTypes.any,\n placeholderChar: PropTypes.string,\n};\n\nexport { DictionaryInputMask };\nexport default DictionaryInputMask;\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-loop-func */\n/* eslint-disable max-params */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from '@elliemae/ds-utilities';\nimport { DSTextBox } from '../../TextBox';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst startsWith = (a: string, b: string, ignoreCase: boolean): boolean => {\n if (ignoreCase) {\n a = a.toLowerCase();\n b = b.toLowerCase();\n }\n return a.startsWith(b);\n};\n\nconst conformValue = (\n rawValue: string,\n cursorPos: number,\n lastkeycode: number,\n allowedWords: string[],\n ignoreCase: boolean,\n) => {\n let nextMaskedValue = '';\n let currentPosibleWords = allowedWords;\n for (let i = 0; i < rawValue.length; i += 1) {\n const matchingWords = currentPosibleWords.filter((word) =>\n startsWith(word, nextMaskedValue + rawValue[i], ignoreCase),\n );\n if (matchingWords.length) {\n nextMaskedValue += rawValue[i];\n currentPosibleWords = matchingWords;\n }\n }\n\n return { nextMaskedValue, maskedPos: cursorPos };\n};\n\nconst DictionaryInputMask = ({\n focus,\n setFocus,\n setRawMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n allowedWords,\n ignoreCase = true,\n autoFocus,\n style,\n disabled,\n className,\n name,\n maxLength,\n minLength,\n fluidWidth,\n placeholder,\n onKeyDown,\n onClick,\n onChange,\n onFocus,\n onBlur,\n onPaste,\n onKeyUp,\n hasError,\n readOnly,\n type,\n innerRef,\n clearable = false,\n leftComponent,\n rightComponent,\n value,\n ...rest\n}) => {\n const inputRef = useRef();\n const [maskedValue, setMaskedValue] = useState(value);\n\n const conform = useCallback(\n ({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true }) => {\n const { nextMaskedValue, maskedPos } = conformValue(\n rawValue,\n cursorPos,\n lastkeycode,\n allowedWords,\n ignoreCase,\n );\n const event = {\n target: {\n value: nextMaskedValue,\n originalValue: rawValue,\n },\n };\n if (onChange && nextMaskedValue !== maskedValue) onChange(event);\n\n setMaskedValue(nextMaskedValue);\n setRawValue(nextMaskedValue);\n\n if (shouldUpdateCursorPos) setCursorPosition({ current: maskedPos });\n },\n [maskedValue, onChange],\n );\n\n const handleOnChange = useCallback(\n (e) => {\n const { value: rawValue, selectionEnd } = e.target;\n setRawMask(rawValue);\n setRawValue(rawValue);\n setCursorPosition({ current: selectionEnd });\n setFocus(true);\n },\n [setRawMask, setRawValue, setCursorPosition, setFocus, lastkey.code],\n );\n\n useLayoutEffect(() => {\n if (focus) setCaretPosition(inputRef.current, cursorPosition.current);\n }, [focus, cursorPosition]);\n\n useLayoutEffect(() => {\n // if the value changes, then re-conform the mask\n conform({\n rawValue: value,\n cursorPos: cursorPosition.current,\n lastkeycode: lastkey.code,\n shouldUpdateCursorPos: focus,\n });\n }, [focus, value, cursorPosition.current]);\n\n const handleKeyDown = useCallback(\n (e) => {\n e.stopPropagation();\n setLastkey({ key: e.key, code: e.keyCode });\n onKeyDown(e);\n },\n [onKeyDown],\n );\n\n const handleBlur = useCallback(\n (e) => {\n setFocus(false);\n onBlur(e);\n },\n [onBlur],\n );\n\n return (\n <DSTextBox\n {...rest}\n className={className}\n clearable={clearable}\n disabled={disabled}\n fluidWidth={fluidWidth}\n hasError={hasError}\n innerRef={(ref) => {\n inputRef.current = ref;\n if (innerRef) innerRef(ref);\n }}\n isActive={focus}\n leftComponent={leftComponent}\n maxLength={maxLength}\n minLength={minLength}\n name={name}\n onBlur={handleBlur}\n onChange={handleOnChange}\n onClick={onClick}\n onFocus={onFocus}\n onKeyDown={handleKeyDown}\n onKeyUp={onKeyUp}\n onPaste={onPaste}\n placeholder={placeholder}\n readOnly={readOnly}\n rightComponent={rightComponent}\n style={style}\n type={type}\n value={maskedValue}\n />\n );\n};\n\nDictionaryInputMask.propTypes = {\n focus: PropTypes.bool,\n setFocus: PropTypes.func,\n setRawMask: PropTypes.func,\n cursorPosition: PropTypes.shape({ current: PropTypes.number }),\n setCursorPosition: PropTypes.func,\n lastkey: PropTypes.shape({ code: PropTypes.number, key: PropTypes.string }),\n setLastkey: PropTypes.func,\n setRawValue: PropTypes.func,\n allowedWords: PropTypes.arrayOf(PropTypes.string),\n ignoreCase: PropTypes.bool,\n autoFocus: PropTypes.bool,\n style: PropTypes.object,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n name: PropTypes.string,\n maxLength: PropTypes.number,\n minLength: PropTypes.number,\n fluidWidth: PropTypes.bool,\n placeholder: PropTypes.string,\n value: PropTypes.string,\n onChange: PropTypes.func,\n onKeyDown: PropTypes.func,\n leftComponent: PropTypes.element,\n rightComponent: PropTypes.element,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n onPaste: PropTypes.func,\n onKeyUp: PropTypes.func,\n hasError: PropTypes.bool,\n readOnly: PropTypes.bool,\n onClick: PropTypes.func,\n clearable: PropTypes.bool,\n type: PropTypes.string,\n innerRef: PropTypes.any,\n mask: PropTypes.any,\n placeholderChar: PropTypes.string,\n};\n\nexport { DictionaryInputMask };\nexport default DictionaryInputMask;\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACIA;AACA;AACA;AACA;AAEA,MAAM,aAAa,CAAC,GAAW,GAAW,eAAiC;AACzE,MAAI,YAAY;AACd,QAAI,EAAE,YAAY;AAClB,QAAI,EAAE,YAAY;AAAA,EACpB;AACA,SAAO,EAAE,WAAW,CAAC;AACvB;AAEA,MAAM,eAAe,CACnB,UACA,WACA,aACA,cACA,eACG;AACH,MAAI,kBAAkB;AACtB,MAAI,sBAAsB;AAC1B,WAAS,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK,GAAG;AAC3C,UAAM,gBAAgB,oBAAoB,OAAO,CAAC,SAChD,WAAW,MAAM,kBAAkB,SAAS,IAAI,UAAU,CAC5D;AACA,QAAI,cAAc,QAAQ;AACxB,yBAAmB,SAAS;AAC5B,4BAAsB;AAAA,IACxB;AAAA,EACF;AAEA,SAAO,EAAE,iBAAiB,WAAW,UAAU;AACjD;AAEA,MAAM,sBAAsB,CAAC,OAoCvB;AApCuB,eAC3B;AAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AA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;AAEA,oBAAoB,YAAY;AAAA,EAC9B,OAAO,UAAU;AAAA,EACjB,UAAU,UAAU;AAAA,EACpB,YAAY,UAAU;AAAA,EACtB,gBAAgB,UAAU,MAAM,EAAE,SAAS,UAAU,OAAO,CAAC;AAAA,EAC7D,mBAAmB,UAAU;AAAA,EAC7B,SAAS,UAAU,MAAM,EAAE,MAAM,UAAU,QAAQ,KAAK,UAAU,OAAO,CAAC;AAAA,EAC1E,YAAY,UAAU;AAAA,EACtB,aAAa,UAAU;AAAA,EACvB,cAAc,UAAU,QAAQ,UAAU,MAAM;AAAA,EAChD,YAAY,UAAU;AAAA,EACtB,WAAW,UAAU;AAAA,EACrB,OAAO,UAAU;AAAA,EACjB,UAAU,UAAU;AAAA,EACpB,WAAW,UAAU;AAAA,EACrB,MAAM,UAAU;AAAA,EAChB,WAAW,UAAU;AAAA,EACrB,WAAW,UAAU;AAAA,EACrB,YAAY,UAAU;AAAA,EACtB,aAAa,UAAU;AAAA,EACvB,OAAO,UAAU;AAAA,EACjB,UAAU,UAAU;AAAA,EACpB,WAAW,UAAU;AAAA,EACrB,eAAe,UAAU;AAAA,EACzB,gBAAgB,UAAU;AAAA,EAC1B,SAAS,UAAU;AAAA,EACnB,QAAQ,UAAU;AAAA,EAClB,SAAS,UAAU;AAAA,EACnB,SAAS,UAAU;AAAA,EACnB,UAAU,UAAU;AAAA,EACpB,UAAU,UAAU;AAAA,EACpB,SAAS,UAAU;AAAA,EACnB,WAAW,UAAU;AAAA,EACrB,MAAM,UAAU;AAAA,EAChB,UAAU,UAAU;AAAA,EACpB,MAAM,UAAU;AAAA,EAChB,iBAAiB,UAAU;AAC7B;AAGA,IAAO,8BAAQ;",
6
6
  "names": []
7
7
  }
@@ -31,7 +31,7 @@ var __objRest = (source, exclude) => {
31
31
  };
32
32
  import * as React from "react";
33
33
  import React2, { useCallback, useLayoutEffect, useRef, useState } from "react";
34
- import { PropTypes } from "react-desc";
34
+ import { PropTypes } from "@elliemae/ds-utilities";
35
35
  import { DSTextBox } from "../../TextBox";
36
36
  import { setCaretPosition } from "../utils/setCaretPosition";
37
37
  const addThousandsSeparator = (n, thousandsSeparatorSymbol) => n.replace(/\B(?=(\d{3})+(?!\d))/g, thousandsSeparatorSymbol);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/mask_types/NumberInputMask.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\n/* eslint-disable max-statements */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\n\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from 'react-desc';\nimport { DSTextBox } from '../../TextBox';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\n// http://stackoverflow.com/a/10899795/604296\nconst addThousandsSeparator = (n, thousandsSeparatorSymbol) =>\n n.replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousandsSeparatorSymbol);\n\nconst conformValue = (\n prevRawValue,\n prevCursorPos,\n lastkeycode,\n {\n prefix,\n suffix,\n includeThousandsSeparator,\n thousandsSeparatorSymbol,\n allowDecimal,\n decimalSymbol,\n decimalLimit,\n requireDecimal,\n allowNegative,\n allowLeadingZeroes,\n integerLimit,\n shouldCompleteDecimals,\n },\n) => {\n const prefixIndex = prevRawValue.indexOf(prefix);\n const suffixIndex = prevRawValue.lastIndexOf(suffix);\n const negativeIndex = prevRawValue.indexOf('-');\n\n const cursorPos = prevCursorPos - (prefixIndex === -1 ? 0 : prefixIndex + prefix.length);\n\n const rawValue = prevRawValue.substring(\n prefixIndex === -1 ? 0 : prefixIndex + prefix.length,\n suffixIndex === -1 ? prevRawValue.length : suffixIndex,\n );\n\n const filteredRawValue = rawValue\n .split('')\n .filter((char) => (char >= '0' && char <= '9') || char === decimalSymbol || char === '-');\n\n let isNegative = allowNegative && negativeIndex !== -1 && (prefixIndex === -1 || negativeIndex < prefixIndex);\n\n let integer = '';\n let decimal = '';\n let foundDecimalSymbol = false;\n\n const integerFits = () => integerLimit === null || integer.length < integerLimit;\n const decimalFits = () => decimalLimit === null || decimal.length < decimalLimit;\n\n filteredRawValue.forEach((char) => {\n if (allowDecimal && !foundDecimalSymbol && char === decimalSymbol) {\n foundDecimalSymbol = true;\n } else if (allowNegative && !integer.length && !foundDecimalSymbol && char === '-') {\n isNegative = true;\n } else if (char >= '0' && char <= '9') {\n if (!foundDecimalSymbol && integerFits()) {\n integer += char;\n } else if (foundDecimalSymbol && decimalFits()) {\n decimal += char;\n }\n }\n });\n\n if (requireDecimal) foundDecimalSymbol = true;\n if (!requireDecimal && !decimal?.length && lastkeycode === 8) {\n foundDecimalSymbol = false;\n }\n if (!integer && !decimal) foundDecimalSymbol = false;\n\n if (foundDecimalSymbol && !integer && decimal) {\n integer = '0';\n }\n\n if (!allowLeadingZeroes) {\n while (integer.length > 1 && integer[0] === '0') integer = integer.substring(1);\n }\n\n let nextMaskedValue = includeThousandsSeparator ? addThousandsSeparator(integer, thousandsSeparatorSymbol) : integer;\n nextMaskedValue += foundDecimalSymbol ? decimalSymbol : '';\n\n if (shouldCompleteDecimals) while (decimal.length !== decimalLimit) decimal += '0';\n\n nextMaskedValue += decimal;\n\n let maskedPos = 0;\n for (let i = 0; i < cursorPos; i += 1) {\n if (nextMaskedValue[maskedPos] === thousandsSeparatorSymbol) maskedPos += 1;\n if (nextMaskedValue[maskedPos] === rawValue[i]) maskedPos += 1;\n }\n if (nextMaskedValue.length || isNegative) {\n nextMaskedValue = prefix + nextMaskedValue;\n maskedPos += prefix.length;\n\n if (isNegative) {\n if (lastkeycode !== 8 || nextMaskedValue !== prefix) nextMaskedValue = `-${nextMaskedValue}`;\n maskedPos += 1;\n }\n\n nextMaskedValue += suffix;\n }\n\n if (lastkeycode !== 8 && maskedPos < nextMaskedValue.length) {\n if (nextMaskedValue[maskedPos] === decimalSymbol && integer.length === integerLimit) {\n maskedPos += 1;\n } else if (nextMaskedValue[maskedPos] === thousandsSeparatorSymbol) {\n maskedPos += 1;\n }\n }\n\n return {\n nextMaskedValue,\n maskedPos: Math.min(maskedPos, nextMaskedValue.length - suffix.length),\n };\n};\n\nconst NumberInputMask = ({\n focus,\n setFocus,\n setRawMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n allowDecimal,\n allowLeadingZeroes,\n allowNegative,\n autoFocus,\n className,\n clearable = false,\n decimalLimit,\n decimalSymbol,\n disabled,\n fluidWidth,\n hasError,\n includeThousandsSeparator,\n innerRef,\n integerLimit,\n leftComponent,\n maxLength,\n minLength,\n name,\n onBlur,\n onChange,\n onClick,\n onFocus,\n onKeyDown,\n onKeyUp,\n onPaste,\n placeholder,\n prefix,\n readOnly,\n requireDecimal,\n rightComponent,\n style,\n suffix,\n thousandsSeparatorSymbol,\n type,\n value,\n ...rest\n}) => {\n const inputRef = useRef();\n const [maskedValue, setMaskedValue] = useState(value);\n\n const conform = useCallback(\n ({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true, shouldCompleteDecimals = false }) => {\n const { nextMaskedValue, maskedPos } = conformValue(rawValue, cursorPos, lastkeycode, {\n prefix,\n suffix,\n includeThousandsSeparator,\n thousandsSeparatorSymbol,\n allowDecimal,\n decimalSymbol,\n decimalLimit,\n requireDecimal,\n allowNegative,\n allowLeadingZeroes,\n integerLimit,\n shouldCompleteDecimals,\n });\n const event = {\n target: {\n value: nextMaskedValue,\n originalValue: rawValue,\n },\n };\n if (onChange && nextMaskedValue !== maskedValue) onChange(event);\n\n setMaskedValue(nextMaskedValue);\n setRawValue(nextMaskedValue);\n\n if (shouldUpdateCursorPos) setCursorPosition({ current: maskedPos });\n },\n [maskedValue, onChange],\n );\n\n const handleOnChange = useCallback(\n (e) => {\n const { value: rawValue, selectionEnd } = e.target;\n setRawMask(rawValue);\n setRawValue(rawValue);\n setCursorPosition({ current: selectionEnd });\n setFocus(true);\n },\n [setRawMask, setRawValue, setCursorPosition, setFocus, lastkey.code],\n );\n\n useLayoutEffect(() => {\n if (focus) setCaretPosition(inputRef.current, cursorPosition.current);\n }, [focus, cursorPosition]);\n\n useLayoutEffect(() => {\n // if the value changes, then re-conform the mask\n conform({\n rawValue: value,\n cursorPos: cursorPosition.current,\n lastkeycode: lastkey.code,\n shouldUpdateCursorPos: focus,\n });\n }, [focus, value, cursorPosition.current]);\n\n const handleKeyDown = useCallback(\n (e) => {\n e.stopPropagation();\n setLastkey({ key: e.key, code: e.keyCode });\n onKeyDown(e);\n },\n [onKeyDown],\n );\n\n const handleBlur = useCallback(\n (e) => {\n setFocus(false);\n onBlur(e);\n if (requireDecimal && maskedValue !== '') {\n conform({\n rawValue: maskedValue,\n cursorPos: 0,\n lastkey: 0,\n shouldUpdateCursorPos: 0,\n shouldCompleteDecimals: true,\n });\n }\n },\n [maskedValue, requireDecimal, suffix, decimalLimit, onBlur],\n );\n\n return (\n <DSTextBox\n {...rest}\n className={className}\n clearable={clearable}\n disabled={disabled}\n fluidWidth={fluidWidth}\n hasError={hasError}\n innerRef={(ref) => {\n inputRef.current = ref;\n if (innerRef) innerRef(ref);\n }}\n isActive={focus}\n leftComponent={leftComponent}\n maxLength={maxLength}\n minLength={minLength}\n name={name}\n onBlur={handleBlur}\n onChange={handleOnChange}\n onClick={onClick}\n onFocus={onFocus}\n onKeyDown={handleKeyDown}\n onKeyUp={onKeyUp}\n onPaste={onPaste}\n placeholder={placeholder}\n readOnly={readOnly}\n rightComponent={rightComponent}\n style={style}\n type={type}\n value={maskedValue}\n />\n );\n};\n\nNumberInputMask.propTypes = {\n focus: PropTypes.bool,\n setFocus: PropTypes.func,\n setRawMask: PropTypes.func,\n cursorPosition: PropTypes.shape({ current: PropTypes.number }),\n setCursorPosition: PropTypes.func,\n lastkey: PropTypes.shape({ code: PropTypes.number, key: PropTypes.string }),\n setLastkey: PropTypes.func,\n setRawValue: PropTypes.func,\n allowDecimal: PropTypes.bool,\n allowLeadingZeroes: PropTypes.bool,\n allowNegative: PropTypes.bool,\n autoFocus: PropTypes.bool,\n className: PropTypes.string,\n clearable: PropTypes.bool,\n decimalLimit: PropTypes.number,\n decimalSymbol: PropTypes.string,\n disabled: PropTypes.bool,\n fluidWidth: PropTypes.bool,\n hasError: PropTypes.bool,\n includeThousandsSeparator: PropTypes.bool,\n innerRef: PropTypes.any,\n integerLimit: PropTypes.number,\n leftComponent: PropTypes.element,\n mask: PropTypes.any,\n maxLength: PropTypes.number,\n minLength: PropTypes.number,\n name: PropTypes.string,\n onBlur: PropTypes.func,\n onChange: PropTypes.func,\n onClick: PropTypes.func,\n onFocus: PropTypes.func,\n onKeyDown: PropTypes.func,\n onKeyUp: PropTypes.func,\n onPaste: PropTypes.func,\n placeholder: PropTypes.string,\n placeholderChar: PropTypes.string,\n prefix: PropTypes.string,\n readOnly: PropTypes.bool,\n requireDecimal: PropTypes.bool,\n rightComponent: PropTypes.element,\n style: PropTypes.object,\n suffix: PropTypes.string,\n thousandsSeparatorSymbol: PropTypes.string,\n type: PropTypes.string,\n value: PropTypes.string,\n};\n\nexport { NumberInputMask };\nexport default NumberInputMask;\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\n/* eslint-disable max-statements */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\n\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from '@elliemae/ds-utilities';\nimport { DSTextBox } from '../../TextBox';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\n// http://stackoverflow.com/a/10899795/604296\nconst addThousandsSeparator = (n, thousandsSeparatorSymbol) =>\n n.replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousandsSeparatorSymbol);\n\nconst conformValue = (\n prevRawValue,\n prevCursorPos,\n lastkeycode,\n {\n prefix,\n suffix,\n includeThousandsSeparator,\n thousandsSeparatorSymbol,\n allowDecimal,\n decimalSymbol,\n decimalLimit,\n requireDecimal,\n allowNegative,\n allowLeadingZeroes,\n integerLimit,\n shouldCompleteDecimals,\n },\n) => {\n const prefixIndex = prevRawValue.indexOf(prefix);\n const suffixIndex = prevRawValue.lastIndexOf(suffix);\n const negativeIndex = prevRawValue.indexOf('-');\n\n const cursorPos = prevCursorPos - (prefixIndex === -1 ? 0 : prefixIndex + prefix.length);\n\n const rawValue = prevRawValue.substring(\n prefixIndex === -1 ? 0 : prefixIndex + prefix.length,\n suffixIndex === -1 ? prevRawValue.length : suffixIndex,\n );\n\n const filteredRawValue = rawValue\n .split('')\n .filter((char) => (char >= '0' && char <= '9') || char === decimalSymbol || char === '-');\n\n let isNegative = allowNegative && negativeIndex !== -1 && (prefixIndex === -1 || negativeIndex < prefixIndex);\n\n let integer = '';\n let decimal = '';\n let foundDecimalSymbol = false;\n\n const integerFits = () => integerLimit === null || integer.length < integerLimit;\n const decimalFits = () => decimalLimit === null || decimal.length < decimalLimit;\n\n filteredRawValue.forEach((char) => {\n if (allowDecimal && !foundDecimalSymbol && char === decimalSymbol) {\n foundDecimalSymbol = true;\n } else if (allowNegative && !integer.length && !foundDecimalSymbol && char === '-') {\n isNegative = true;\n } else if (char >= '0' && char <= '9') {\n if (!foundDecimalSymbol && integerFits()) {\n integer += char;\n } else if (foundDecimalSymbol && decimalFits()) {\n decimal += char;\n }\n }\n });\n\n if (requireDecimal) foundDecimalSymbol = true;\n if (!requireDecimal && !decimal?.length && lastkeycode === 8) {\n foundDecimalSymbol = false;\n }\n if (!integer && !decimal) foundDecimalSymbol = false;\n\n if (foundDecimalSymbol && !integer && decimal) {\n integer = '0';\n }\n\n if (!allowLeadingZeroes) {\n while (integer.length > 1 && integer[0] === '0') integer = integer.substring(1);\n }\n\n let nextMaskedValue = includeThousandsSeparator ? addThousandsSeparator(integer, thousandsSeparatorSymbol) : integer;\n nextMaskedValue += foundDecimalSymbol ? decimalSymbol : '';\n\n if (shouldCompleteDecimals) while (decimal.length !== decimalLimit) decimal += '0';\n\n nextMaskedValue += decimal;\n\n let maskedPos = 0;\n for (let i = 0; i < cursorPos; i += 1) {\n if (nextMaskedValue[maskedPos] === thousandsSeparatorSymbol) maskedPos += 1;\n if (nextMaskedValue[maskedPos] === rawValue[i]) maskedPos += 1;\n }\n if (nextMaskedValue.length || isNegative) {\n nextMaskedValue = prefix + nextMaskedValue;\n maskedPos += prefix.length;\n\n if (isNegative) {\n if (lastkeycode !== 8 || nextMaskedValue !== prefix) nextMaskedValue = `-${nextMaskedValue}`;\n maskedPos += 1;\n }\n\n nextMaskedValue += suffix;\n }\n\n if (lastkeycode !== 8 && maskedPos < nextMaskedValue.length) {\n if (nextMaskedValue[maskedPos] === decimalSymbol && integer.length === integerLimit) {\n maskedPos += 1;\n } else if (nextMaskedValue[maskedPos] === thousandsSeparatorSymbol) {\n maskedPos += 1;\n }\n }\n\n return {\n nextMaskedValue,\n maskedPos: Math.min(maskedPos, nextMaskedValue.length - suffix.length),\n };\n};\n\nconst NumberInputMask = ({\n focus,\n setFocus,\n setRawMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n allowDecimal,\n allowLeadingZeroes,\n allowNegative,\n autoFocus,\n className,\n clearable = false,\n decimalLimit,\n decimalSymbol,\n disabled,\n fluidWidth,\n hasError,\n includeThousandsSeparator,\n innerRef,\n integerLimit,\n leftComponent,\n maxLength,\n minLength,\n name,\n onBlur,\n onChange,\n onClick,\n onFocus,\n onKeyDown,\n onKeyUp,\n onPaste,\n placeholder,\n prefix,\n readOnly,\n requireDecimal,\n rightComponent,\n style,\n suffix,\n thousandsSeparatorSymbol,\n type,\n value,\n ...rest\n}) => {\n const inputRef = useRef();\n const [maskedValue, setMaskedValue] = useState(value);\n\n const conform = useCallback(\n ({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true, shouldCompleteDecimals = false }) => {\n const { nextMaskedValue, maskedPos } = conformValue(rawValue, cursorPos, lastkeycode, {\n prefix,\n suffix,\n includeThousandsSeparator,\n thousandsSeparatorSymbol,\n allowDecimal,\n decimalSymbol,\n decimalLimit,\n requireDecimal,\n allowNegative,\n allowLeadingZeroes,\n integerLimit,\n shouldCompleteDecimals,\n });\n const event = {\n target: {\n value: nextMaskedValue,\n originalValue: rawValue,\n },\n };\n if (onChange && nextMaskedValue !== maskedValue) onChange(event);\n\n setMaskedValue(nextMaskedValue);\n setRawValue(nextMaskedValue);\n\n if (shouldUpdateCursorPos) setCursorPosition({ current: maskedPos });\n },\n [maskedValue, onChange],\n );\n\n const handleOnChange = useCallback(\n (e) => {\n const { value: rawValue, selectionEnd } = e.target;\n setRawMask(rawValue);\n setRawValue(rawValue);\n setCursorPosition({ current: selectionEnd });\n setFocus(true);\n },\n [setRawMask, setRawValue, setCursorPosition, setFocus, lastkey.code],\n );\n\n useLayoutEffect(() => {\n if (focus) setCaretPosition(inputRef.current, cursorPosition.current);\n }, [focus, cursorPosition]);\n\n useLayoutEffect(() => {\n // if the value changes, then re-conform the mask\n conform({\n rawValue: value,\n cursorPos: cursorPosition.current,\n lastkeycode: lastkey.code,\n shouldUpdateCursorPos: focus,\n });\n }, [focus, value, cursorPosition.current]);\n\n const handleKeyDown = useCallback(\n (e) => {\n e.stopPropagation();\n setLastkey({ key: e.key, code: e.keyCode });\n onKeyDown(e);\n },\n [onKeyDown],\n );\n\n const handleBlur = useCallback(\n (e) => {\n setFocus(false);\n onBlur(e);\n if (requireDecimal && maskedValue !== '') {\n conform({\n rawValue: maskedValue,\n cursorPos: 0,\n lastkey: 0,\n shouldUpdateCursorPos: 0,\n shouldCompleteDecimals: true,\n });\n }\n },\n [maskedValue, requireDecimal, suffix, decimalLimit, onBlur],\n );\n\n return (\n <DSTextBox\n {...rest}\n className={className}\n clearable={clearable}\n disabled={disabled}\n fluidWidth={fluidWidth}\n hasError={hasError}\n innerRef={(ref) => {\n inputRef.current = ref;\n if (innerRef) innerRef(ref);\n }}\n isActive={focus}\n leftComponent={leftComponent}\n maxLength={maxLength}\n minLength={minLength}\n name={name}\n onBlur={handleBlur}\n onChange={handleOnChange}\n onClick={onClick}\n onFocus={onFocus}\n onKeyDown={handleKeyDown}\n onKeyUp={onKeyUp}\n onPaste={onPaste}\n placeholder={placeholder}\n readOnly={readOnly}\n rightComponent={rightComponent}\n style={style}\n type={type}\n value={maskedValue}\n />\n );\n};\n\nNumberInputMask.propTypes = {\n focus: PropTypes.bool,\n setFocus: PropTypes.func,\n setRawMask: PropTypes.func,\n cursorPosition: PropTypes.shape({ current: PropTypes.number }),\n setCursorPosition: PropTypes.func,\n lastkey: PropTypes.shape({ code: PropTypes.number, key: PropTypes.string }),\n setLastkey: PropTypes.func,\n setRawValue: PropTypes.func,\n allowDecimal: PropTypes.bool,\n allowLeadingZeroes: PropTypes.bool,\n allowNegative: PropTypes.bool,\n autoFocus: PropTypes.bool,\n className: PropTypes.string,\n clearable: PropTypes.bool,\n decimalLimit: PropTypes.number,\n decimalSymbol: PropTypes.string,\n disabled: PropTypes.bool,\n fluidWidth: PropTypes.bool,\n hasError: PropTypes.bool,\n includeThousandsSeparator: PropTypes.bool,\n innerRef: PropTypes.any,\n integerLimit: PropTypes.number,\n leftComponent: PropTypes.element,\n mask: PropTypes.any,\n maxLength: PropTypes.number,\n minLength: PropTypes.number,\n name: PropTypes.string,\n onBlur: PropTypes.func,\n onChange: PropTypes.func,\n onClick: PropTypes.func,\n onFocus: PropTypes.func,\n onKeyDown: PropTypes.func,\n onKeyUp: PropTypes.func,\n onPaste: PropTypes.func,\n placeholder: PropTypes.string,\n placeholderChar: PropTypes.string,\n prefix: PropTypes.string,\n readOnly: PropTypes.bool,\n requireDecimal: PropTypes.bool,\n rightComponent: PropTypes.element,\n style: PropTypes.object,\n suffix: PropTypes.string,\n thousandsSeparatorSymbol: PropTypes.string,\n type: PropTypes.string,\n value: PropTypes.string,\n};\n\nexport { NumberInputMask };\nexport default NumberInputMask;\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACKA;AACA;AACA;AACA;AAGA,MAAM,wBAAwB,CAAC,GAAG,6BAChC,EAAE,Q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U;AAAA,EAChB,WAAW,UAAU;AAAA,EACrB,WAAW,UAAU;AAAA,EACrB,MAAM,UAAU;AAAA,EAChB,QAAQ,UAAU;AAAA,EAClB,UAAU,UAAU;AAAA,EACpB,SAAS,UAAU;AAAA,EACnB,SAAS,UAAU;AAAA,EACnB,WAAW,UAAU;AAAA,EACrB,SAAS,UAAU;AAAA,EACnB,SAAS,UAAU;AAAA,EACnB,aAAa,UAAU;AAAA,EACvB,iBAAiB,UAAU;AAAA,EAC3B,QAAQ,UAAU;AAAA,EAClB,UAAU,UAAU;AAAA,EACpB,gBAAgB,UAAU;AAAA,EAC1B,gBAAgB,UAAU;AAAA,EAC1B,OAAO,UAAU;AAAA,EACjB,QAAQ,UAAU;AAAA,EAClB,0BAA0B,UAAU;AAAA,EACpC,MAAM,UAAU;AAAA,EAChB,OAAO,UAAU;AACnB;AAGA,IAAO,0BAAQ;",
6
6
  "names": []
7
7
  }
@@ -31,7 +31,7 @@ var __objRest = (source, exclude) => {
31
31
  };
32
32
  import * as React from "react";
33
33
  import React2, { useCallback, useLayoutEffect, useRef, useState } from "react";
34
- import { PropTypes } from "react-desc";
34
+ import { PropTypes } from "@elliemae/ds-utilities";
35
35
  import { DSTextBox } from "../../TextBox";
36
36
  import { setCaretPosition } from "../utils/setCaretPosition";
37
37
  const conformValue = (rawValue, cursorPos, lastkeycode) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/mask_types/PhoneInputMask.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from 'react-desc';\nimport { DSTextBox } from '../../TextBox';\nimport { TCharsToAdd } from '../types';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst conformValue = (rawValue, cursorPos, lastkeycode) => {\n let nextMaskedValue = rawValue\n .split('')\n .filter((char) => char >= '0' && char <= '9');\n\n while (nextMaskedValue.length && nextMaskedValue[0] === '0')\n nextMaskedValue.splice(0, 1);\n\n nextMaskedValue = nextMaskedValue.slice(0, 10);\n\n let maskedPos = 0;\n for (let i = 0; i < cursorPos; i += 1) {\n if (nextMaskedValue[maskedPos] === rawValue[i]) maskedPos += 1;\n }\n\n // list of [string to add, position to add]\nconst charactersToAdd: TCharsToAdd = [\n ['(', 0],\n [') ', 4],\n ['-', 9],\n ];\n\n charactersToAdd.forEach(([chars, pos]) => {\n if (nextMaskedValue.length > pos) {\n nextMaskedValue.splice(pos, 0, ...chars);\n if (maskedPos >= pos) maskedPos += chars.length;\n }\n });\n\n if (lastkeycode !== 8 && maskedPos < nextMaskedValue.length) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos) maskedPos += chars.length;\n });\n } else if (lastkeycode === 8 && maskedPos) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos + 1) maskedPos -= chars.length;\n });\n }\n return { nextMaskedValue: nextMaskedValue.join(''), maskedPos };\n};\n\nconst PhoneInputMask = ({\n focus,\n setFocus,\n setRawMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n style,\n disabled,\n className,\n name,\n maxLength,\n minLength,\n fluidWidth,\n placeholder,\n onKeyDown,\n onClick,\n onChange,\n onFocus,\n onBlur,\n onPaste,\n onKeyUp,\n hasError,\n readOnly,\n type,\n innerRef,\n clearable = false,\n leftComponent,\n rightComponent,\n value,\n ...rest\n}) => {\n const inputRef = useRef();\n const [maskedValue, setMaskedValue] = useState(value);\n\n const conform = useCallback(\n ({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true }) => {\n const { nextMaskedValue, maskedPos } = conformValue(\n rawValue,\n cursorPos,\n lastkeycode,\n );\n const event = {\n target: {\n value: nextMaskedValue,\n originalValue: rawValue,\n },\n };\n if (onChange && nextMaskedValue !== maskedValue) onChange(event);\n\n setMaskedValue(nextMaskedValue);\n setRawValue(nextMaskedValue);\n\n if (shouldUpdateCursorPos) setCursorPosition({ current: maskedPos });\n },\n [maskedValue, onChange],\n );\n\n const handleOnChange = useCallback(\n (e) => {\n const { value: rawValue, selectionEnd } = e.target;\n setRawMask(rawValue);\n setRawValue(rawValue);\n setCursorPosition({ current: selectionEnd });\n setFocus(true);\n },\n [setRawMask, setRawValue, setCursorPosition, setFocus, lastkey.code],\n );\n\n useLayoutEffect(() => {\n if (focus) setCaretPosition(inputRef.current, cursorPosition.current);\n }, [focus, cursorPosition]);\n\n useLayoutEffect(() => {\n // if the value changes, then re-conform the mask\n conform({\n rawValue: value,\n cursorPos: cursorPosition.current,\n lastkeycode: lastkey.code,\n shouldUpdateCursorPos: focus,\n });\n }, [focus, value, cursorPosition.current]);\n\n const handleKeyDown = useCallback(\n (e) => {\n e.stopPropagation();\n setLastkey({ key: e.key, code: e.keyCode });\n onKeyDown(e);\n },\n [onKeyDown],\n );\n\n const handleBlur = useCallback(\n (e) => {\n setFocus(false);\n onBlur(e);\n },\n [onBlur],\n );\n\n return (\n <DSTextBox\n {...rest}\n className={className}\n clearable={clearable}\n disabled={disabled}\n fluidWidth={fluidWidth}\n hasError={hasError}\n innerRef={(ref) => {\n inputRef.current = ref;\n if (innerRef) innerRef(ref);\n }}\n isActive={focus}\n leftComponent={leftComponent}\n maxLength={maxLength}\n minLength={minLength}\n name={name}\n onBlur={handleBlur}\n onChange={handleOnChange}\n onClick={onClick}\n onFocus={onFocus}\n onKeyDown={handleKeyDown}\n onKeyUp={onKeyUp}\n onPaste={onPaste}\n placeholder={placeholder}\n readOnly={readOnly}\n rightComponent={rightComponent}\n style={style}\n type={type}\n value={maskedValue}\n />\n );\n};\n\nPhoneInputMask.propTypes = {\n focus: PropTypes.bool,\n setFocus: PropTypes.func,\n setRawMask: PropTypes.func,\n cursorPosition: PropTypes.shape({ current: PropTypes.number }),\n setCursorPosition: PropTypes.func,\n lastkey: PropTypes.shape({ code: PropTypes.number, key: PropTypes.string }),\n setLastkey: PropTypes.func,\n setRawValue: PropTypes.func,\n style: PropTypes.object,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n name: PropTypes.string,\n maxLength: PropTypes.number,\n minLength: PropTypes.number,\n fluidWidth: PropTypes.bool,\n placeholder: PropTypes.string,\n value: PropTypes.string,\n onChange: PropTypes.func,\n onKeyDown: PropTypes.func,\n leftComponent: PropTypes.element,\n rightComponent: PropTypes.element,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n onPaste: PropTypes.func,\n onKeyUp: PropTypes.func,\n hasError: PropTypes.bool,\n readOnly: PropTypes.bool,\n onClick: PropTypes.func,\n clearable: PropTypes.bool,\n type: PropTypes.string,\n innerRef: PropTypes.any,\n mask: PropTypes.any,\n placeholderChar: PropTypes.string,\n};\n\nexport { PhoneInputMask };\nexport default PhoneInputMask;\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from '@elliemae/ds-utilities';\nimport { DSTextBox } from '../../TextBox';\nimport { TCharsToAdd } from '../types';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst conformValue = (rawValue, cursorPos, lastkeycode) => {\n let nextMaskedValue = rawValue\n .split('')\n .filter((char) => char >= '0' && char <= '9');\n\n while (nextMaskedValue.length && nextMaskedValue[0] === '0')\n nextMaskedValue.splice(0, 1);\n\n nextMaskedValue = nextMaskedValue.slice(0, 10);\n\n let maskedPos = 0;\n for (let i = 0; i < cursorPos; i += 1) {\n if (nextMaskedValue[maskedPos] === rawValue[i]) maskedPos += 1;\n }\n\n // list of [string to add, position to add]\nconst charactersToAdd: TCharsToAdd = [\n ['(', 0],\n [') ', 4],\n ['-', 9],\n ];\n\n charactersToAdd.forEach(([chars, pos]) => {\n if (nextMaskedValue.length > pos) {\n nextMaskedValue.splice(pos, 0, ...chars);\n if (maskedPos >= pos) maskedPos += chars.length;\n }\n });\n\n if (lastkeycode !== 8 && maskedPos < nextMaskedValue.length) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos) maskedPos += chars.length;\n });\n } else if (lastkeycode === 8 && maskedPos) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos + 1) maskedPos -= chars.length;\n });\n }\n return { nextMaskedValue: nextMaskedValue.join(''), maskedPos };\n};\n\nconst PhoneInputMask = ({\n focus,\n setFocus,\n setRawMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n style,\n disabled,\n className,\n name,\n maxLength,\n minLength,\n fluidWidth,\n placeholder,\n onKeyDown,\n onClick,\n onChange,\n onFocus,\n onBlur,\n onPaste,\n onKeyUp,\n hasError,\n readOnly,\n type,\n innerRef,\n clearable = false,\n leftComponent,\n rightComponent,\n value,\n ...rest\n}) => {\n const inputRef = useRef();\n const [maskedValue, setMaskedValue] = useState(value);\n\n const conform = useCallback(\n ({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true }) => {\n const { nextMaskedValue, maskedPos } = conformValue(\n rawValue,\n cursorPos,\n lastkeycode,\n );\n const event = {\n target: {\n value: nextMaskedValue,\n originalValue: rawValue,\n },\n };\n if (onChange && nextMaskedValue !== maskedValue) onChange(event);\n\n setMaskedValue(nextMaskedValue);\n setRawValue(nextMaskedValue);\n\n if (shouldUpdateCursorPos) setCursorPosition({ current: maskedPos });\n },\n [maskedValue, onChange],\n );\n\n const handleOnChange = useCallback(\n (e) => {\n const { value: rawValue, selectionEnd } = e.target;\n setRawMask(rawValue);\n setRawValue(rawValue);\n setCursorPosition({ current: selectionEnd });\n setFocus(true);\n },\n [setRawMask, setRawValue, setCursorPosition, setFocus, lastkey.code],\n );\n\n useLayoutEffect(() => {\n if (focus) setCaretPosition(inputRef.current, cursorPosition.current);\n }, [focus, cursorPosition]);\n\n useLayoutEffect(() => {\n // if the value changes, then re-conform the mask\n conform({\n rawValue: value,\n cursorPos: cursorPosition.current,\n lastkeycode: lastkey.code,\n shouldUpdateCursorPos: focus,\n });\n }, [focus, value, cursorPosition.current]);\n\n const handleKeyDown = useCallback(\n (e) => {\n e.stopPropagation();\n setLastkey({ key: e.key, code: e.keyCode });\n onKeyDown(e);\n },\n [onKeyDown],\n );\n\n const handleBlur = useCallback(\n (e) => {\n setFocus(false);\n onBlur(e);\n },\n [onBlur],\n );\n\n return (\n <DSTextBox\n {...rest}\n className={className}\n clearable={clearable}\n disabled={disabled}\n fluidWidth={fluidWidth}\n hasError={hasError}\n innerRef={(ref) => {\n inputRef.current = ref;\n if (innerRef) innerRef(ref);\n }}\n isActive={focus}\n leftComponent={leftComponent}\n maxLength={maxLength}\n minLength={minLength}\n name={name}\n onBlur={handleBlur}\n onChange={handleOnChange}\n onClick={onClick}\n onFocus={onFocus}\n onKeyDown={handleKeyDown}\n onKeyUp={onKeyUp}\n onPaste={onPaste}\n placeholder={placeholder}\n readOnly={readOnly}\n rightComponent={rightComponent}\n style={style}\n type={type}\n value={maskedValue}\n />\n );\n};\n\nPhoneInputMask.propTypes = {\n focus: PropTypes.bool,\n setFocus: PropTypes.func,\n setRawMask: PropTypes.func,\n cursorPosition: PropTypes.shape({ current: PropTypes.number }),\n setCursorPosition: PropTypes.func,\n lastkey: PropTypes.shape({ code: PropTypes.number, key: PropTypes.string }),\n setLastkey: PropTypes.func,\n setRawValue: PropTypes.func,\n style: PropTypes.object,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n name: PropTypes.string,\n maxLength: PropTypes.number,\n minLength: PropTypes.number,\n fluidWidth: PropTypes.bool,\n placeholder: PropTypes.string,\n value: PropTypes.string,\n onChange: PropTypes.func,\n onKeyDown: PropTypes.func,\n leftComponent: PropTypes.element,\n rightComponent: PropTypes.element,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n onPaste: PropTypes.func,\n onKeyUp: PropTypes.func,\n hasError: PropTypes.bool,\n readOnly: PropTypes.bool,\n onClick: PropTypes.func,\n clearable: PropTypes.bool,\n type: PropTypes.string,\n innerRef: PropTypes.any,\n mask: PropTypes.any,\n placeholderChar: PropTypes.string,\n};\n\nexport { PhoneInputMask };\nexport default PhoneInputMask;\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACEA;AACA;AACA;AAEA;AAEA,MAAM,eAAe,CAAC,UAAU,WAAW,gBAAgB;AACzD,MAAI,kBAAkB,SACnB,MAAM,EAAE,EACR,OAAO,CAAC,SAAS,QAAQ,OAAO,QAAQ,GAAG;AAE9C,SAAO,gBAAgB,UAAU,gBAAgB,OAAO;AACtD,oBAAgB,OAAO,GAAG,CAAC;AAE7B,oBAAkB,gBAAgB,MAAM,GAAG,EAAE;AAE7C,MAAI,YAAY;AAChB,WAAS,IAAI,GAAG,IAAI,WAAW,KAAK,GAAG;AACrC,QAAI,gBAAgB,eAAe,SAAS;AAAI,mBAAa;AAAA,EAC/D;AAGF,QAAM,kBAA+B;AAAA,IACjC,CAAC,KAAK,CAAC;AAAA,IACP,CAAC,MAAM,CAAC;AAAA,IACR,CAAC,KAAK,CAAC;AAAA,EACT;AAEA,kBAAgB,QAAQ,CAAC,CAAC,OAAO,SAAS;AACxC,QAAI,gBAAgB,SAAS,KAAK;AAChC,sBAAgB,OAAO,KAAK,GAAG,GAAG,KAAK;AACvC,UAAI,aAAa;AAAK,qBAAa,MAAM;AAAA,IAC3C;AAAA,EACF,CAAC;AAED,MAAI,gBAAgB,KAAK,YAAY,gBAAgB,QAAQ;AAC3D,oBAAgB,QAAQ,CAAC,CAAC,OAAO,SAAS;AACxC,UAAI,cAAc;AAAK,qBAAa,MAAM;AAAA,IAC5C,CAAC;AAAA,EACH,WAAW,gBAAgB,KAAK,WAAW;AACzC,oBAAgB,QAAQ,CAAC,CAAC,OAAO,SAAS;AACxC,UAAI,cAAc,MAAM;AAAG,qBAAa,MAAM;AAAA,IAChD,CAAC;AAAA,EACH;AACA,SAAO,EAAE,iBAAiB,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ACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACT;AAEJ;AAEA,eAAe,YAAY;AAAA,EACzB,OAAO,UAAU;AAAA,EACjB,UAAU,UAAU;AAAA,EACpB,YAAY,UAAU;AAAA,EACtB,gBAAgB,UAAU,MAAM,EAAE,SAAS,UAAU,OAAO,CAAC;AAAA,EAC7D,mBAAmB,UAAU;AAAA,EAC7B,SAAS,UAAU,MAAM,EAAE,MAAM,UAAU,QAAQ,KAAK,UAAU,OAAO,CAAC;AAAA,EAC1E,YAAY,UAAU;AAAA,EACtB,aAAa,UAAU;AAAA,EACvB,OAAO,UAAU;AAAA,EACjB,UAAU,UAAU;AAAA,EACpB,WAAW,UAAU;AAAA,EACrB,MAAM,UAAU;AAAA,EAChB,WAAW,UAAU;AAAA,EACrB,WAAW,UAAU;AAAA,EACrB,YAAY,UAAU;AAAA,EACtB,aAAa,UAAU;AAAA,EACvB,OAAO,UAAU;AAAA,EACjB,UAAU,UAAU;AAAA,EACpB,WAAW,UAAU;AAAA,EACrB,eAAe,UAAU;AAAA,EACzB,gBAAgB,UAAU;AAAA,EAC1B,SAAS,UAAU;AAAA,EACnB,QAAQ,UAAU;AAAA,EAClB,SAAS,UAAU;AAAA,EACnB,SAAS,UAAU;AAAA,EACnB,UAAU,UAAU;AAAA,EACpB,UAAU,UAAU;AAAA,EACpB,SAAS,UAAU;AAAA,EACnB,WAAW,UAAU;AAAA,EACrB,MAAM,UAAU;AAAA,EAChB,UAAU,UAAU;AAAA,EACpB,MAAM,UAAU;AAAA,EAChB,iBAAiB,UAAU;AAC7B;AAGA,IAAO,yBAAQ;",
6
6
  "names": []
7
7
  }
@@ -31,7 +31,7 @@ var __objRest = (source, exclude) => {
31
31
  };
32
32
  import * as React from "react";
33
33
  import React2, { useCallback, useLayoutEffect, useRef, useState } from "react";
34
- import { PropTypes } from "react-desc";
34
+ import { PropTypes } from "@elliemae/ds-utilities";
35
35
  import { DSTextBox } from "../../TextBox";
36
36
  import { setCaretPosition } from "../utils/setCaretPosition";
37
37
  const conformValue = (rawValue, cursorPos, lastkeycode) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/mask_types/PhoneInternationalInputMask.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from 'react-desc';\nimport { DSTextBox } from '../../TextBox';\nimport { TCharsToAdd } from '../types';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst conformValue = (rawValue, cursorPos, lastkeycode) => {\n let nextMaskedValue = rawValue\n .split('+1')\n .slice(-1)[0]\n .split('')\n .filter((char) => char >= '0' && char <= '9');\n\n while (nextMaskedValue.length && nextMaskedValue[0] === '0')\n nextMaskedValue.splice(0, 1);\n\n nextMaskedValue = nextMaskedValue.slice(0, 10);\n\n let maskedPos = 0;\n for (let i = 0; i < cursorPos; i += 1) {\n if (nextMaskedValue[maskedPos] === rawValue[i]) maskedPos += 1;\n }\n\n // list of [string to add, position to add]\nconst charactersToAdd: TCharsToAdd = [\n ['+1 (', 0],\n [') ', 7],\n ['-', 12],\n ];\n\n charactersToAdd.forEach(([chars, pos]) => {\n if (nextMaskedValue.length > pos) {\n nextMaskedValue.splice(pos, 0, ...chars);\n if (maskedPos >= pos) maskedPos += chars.length;\n }\n });\n\n if (lastkeycode !== 8 && maskedPos < nextMaskedValue.length) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos) maskedPos += chars.length;\n });\n } else if (lastkeycode === 8 && maskedPos) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos + 1) maskedPos -= chars.length;\n });\n }\n return { nextMaskedValue: nextMaskedValue.join(''), maskedPos };\n};\n\nconst PhoneInternationalInputMask = ({\n focus,\n setFocus,\n setRawMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n style,\n disabled,\n className,\n name,\n maxLength,\n minLength,\n fluidWidth,\n placeholder,\n onKeyDown,\n onClick,\n onChange,\n onFocus,\n onBlur,\n onPaste,\n onKeyUp,\n hasError,\n readOnly,\n type,\n innerRef,\n clearable = false,\n leftComponent,\n rightComponent,\n value,\n ...rest\n}) => {\n const inputRef = useRef();\n const [maskedValue, setMaskedValue] = useState(value);\n\n const conform = useCallback(\n ({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true }) => {\n const { nextMaskedValue, maskedPos } = conformValue(\n rawValue,\n cursorPos,\n lastkeycode,\n );\n const event = {\n target: {\n value: nextMaskedValue,\n originalValue: rawValue,\n },\n };\n if (onChange && nextMaskedValue !== maskedValue) onChange(event);\n\n setMaskedValue(nextMaskedValue);\n setRawValue(nextMaskedValue);\n\n if (shouldUpdateCursorPos) setCursorPosition({ current: maskedPos });\n },\n [maskedValue, onChange],\n );\n\n const handleOnChange = useCallback(\n (e) => {\n const { value: rawValue, selectionEnd } = e.target;\n setRawMask(rawValue);\n setRawValue(rawValue);\n setCursorPosition({ current: selectionEnd });\n setFocus(true);\n },\n [setRawMask, setRawValue, setCursorPosition, setFocus, lastkey.code],\n );\n\n useLayoutEffect(() => {\n if (focus) setCaretPosition(inputRef.current, cursorPosition.current);\n }, [focus, cursorPosition]);\n\n useLayoutEffect(() => {\n // if the value changes, then re-conform the mask\n conform({\n rawValue: value,\n cursorPos: cursorPosition.current,\n lastkeycode: lastkey.code,\n shouldUpdateCursorPos: focus,\n });\n }, [focus, value, cursorPosition.current]);\n\n const handleKeyDown = useCallback(\n (e) => {\n e.stopPropagation();\n setLastkey({ key: e.key, code: e.keyCode });\n onKeyDown(e);\n },\n [onKeyDown],\n );\n\n const handleBlur = useCallback(\n (e) => {\n setFocus(false);\n onBlur(e);\n },\n [onBlur],\n );\n\n return (\n <DSTextBox\n {...rest}\n className={className}\n clearable={clearable}\n disabled={disabled}\n fluidWidth={fluidWidth}\n hasError={hasError}\n innerRef={(ref) => {\n inputRef.current = ref;\n if (innerRef) innerRef(ref);\n }}\n isActive={focus}\n leftComponent={leftComponent}\n maxLength={maxLength}\n minLength={minLength}\n name={name}\n onBlur={handleBlur}\n onChange={handleOnChange}\n onClick={onClick}\n onFocus={onFocus}\n onKeyDown={handleKeyDown}\n onKeyUp={onKeyUp}\n onPaste={onPaste}\n placeholder={placeholder}\n readOnly={readOnly}\n rightComponent={rightComponent}\n style={style}\n type={type}\n value={maskedValue}\n />\n );\n};\n\nPhoneInternationalInputMask.propTypes = {\n focus: PropTypes.bool,\n setFocus: PropTypes.func,\n setRawMask: PropTypes.func,\n cursorPosition: PropTypes.shape({ current: PropTypes.number }),\n setCursorPosition: PropTypes.func,\n lastkey: PropTypes.shape({ code: PropTypes.number, key: PropTypes.string }),\n setLastkey: PropTypes.func,\n setRawValue: PropTypes.func,\n style: PropTypes.object,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n name: PropTypes.string,\n maxLength: PropTypes.number,\n minLength: PropTypes.number,\n fluidWidth: PropTypes.bool,\n placeholder: PropTypes.string,\n value: PropTypes.string,\n onChange: PropTypes.func,\n onKeyDown: PropTypes.func,\n leftComponent: PropTypes.element,\n rightComponent: PropTypes.element,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n onPaste: PropTypes.func,\n onKeyUp: PropTypes.func,\n hasError: PropTypes.bool,\n readOnly: PropTypes.bool,\n onClick: PropTypes.func,\n clearable: PropTypes.bool,\n type: PropTypes.string,\n innerRef: PropTypes.any,\n mask: PropTypes.any,\n placeholderChar: PropTypes.string,\n};\n\nexport { PhoneInternationalInputMask };\nexport default PhoneInternationalInputMask;\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from '@elliemae/ds-utilities';\nimport { DSTextBox } from '../../TextBox';\nimport { TCharsToAdd } from '../types';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst conformValue = (rawValue, cursorPos, lastkeycode) => {\n let nextMaskedValue = rawValue\n .split('+1')\n .slice(-1)[0]\n .split('')\n .filter((char) => char >= '0' && char <= '9');\n\n while (nextMaskedValue.length && nextMaskedValue[0] === '0')\n nextMaskedValue.splice(0, 1);\n\n nextMaskedValue = nextMaskedValue.slice(0, 10);\n\n let maskedPos = 0;\n for (let i = 0; i < cursorPos; i += 1) {\n if (nextMaskedValue[maskedPos] === rawValue[i]) maskedPos += 1;\n }\n\n // list of [string to add, position to add]\nconst charactersToAdd: TCharsToAdd = [\n ['+1 (', 0],\n [') ', 7],\n ['-', 12],\n ];\n\n charactersToAdd.forEach(([chars, pos]) => {\n if (nextMaskedValue.length > pos) {\n nextMaskedValue.splice(pos, 0, ...chars);\n if (maskedPos >= pos) maskedPos += chars.length;\n }\n });\n\n if (lastkeycode !== 8 && maskedPos < nextMaskedValue.length) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos) maskedPos += chars.length;\n });\n } else if (lastkeycode === 8 && maskedPos) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos + 1) maskedPos -= chars.length;\n });\n }\n return { nextMaskedValue: nextMaskedValue.join(''), maskedPos };\n};\n\nconst PhoneInternationalInputMask = ({\n focus,\n setFocus,\n setRawMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n style,\n disabled,\n className,\n name,\n maxLength,\n minLength,\n fluidWidth,\n placeholder,\n onKeyDown,\n onClick,\n onChange,\n onFocus,\n onBlur,\n onPaste,\n onKeyUp,\n hasError,\n readOnly,\n type,\n innerRef,\n clearable = false,\n leftComponent,\n rightComponent,\n value,\n ...rest\n}) => {\n const inputRef = useRef();\n const [maskedValue, setMaskedValue] = useState(value);\n\n const conform = useCallback(\n ({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true }) => {\n const { nextMaskedValue, maskedPos } = conformValue(\n rawValue,\n cursorPos,\n lastkeycode,\n );\n const event = {\n target: {\n value: nextMaskedValue,\n originalValue: rawValue,\n },\n };\n if (onChange && nextMaskedValue !== maskedValue) onChange(event);\n\n setMaskedValue(nextMaskedValue);\n setRawValue(nextMaskedValue);\n\n if (shouldUpdateCursorPos) setCursorPosition({ current: maskedPos });\n },\n [maskedValue, onChange],\n );\n\n const handleOnChange = useCallback(\n (e) => {\n const { value: rawValue, selectionEnd } = e.target;\n setRawMask(rawValue);\n setRawValue(rawValue);\n setCursorPosition({ current: selectionEnd });\n setFocus(true);\n },\n [setRawMask, setRawValue, setCursorPosition, setFocus, lastkey.code],\n );\n\n useLayoutEffect(() => {\n if (focus) setCaretPosition(inputRef.current, cursorPosition.current);\n }, [focus, cursorPosition]);\n\n useLayoutEffect(() => {\n // if the value changes, then re-conform the mask\n conform({\n rawValue: value,\n cursorPos: cursorPosition.current,\n lastkeycode: lastkey.code,\n shouldUpdateCursorPos: focus,\n });\n }, [focus, value, cursorPosition.current]);\n\n const handleKeyDown = useCallback(\n (e) => {\n e.stopPropagation();\n setLastkey({ key: e.key, code: e.keyCode });\n onKeyDown(e);\n },\n [onKeyDown],\n );\n\n const handleBlur = useCallback(\n (e) => {\n setFocus(false);\n onBlur(e);\n },\n [onBlur],\n );\n\n return (\n <DSTextBox\n {...rest}\n className={className}\n clearable={clearable}\n disabled={disabled}\n fluidWidth={fluidWidth}\n hasError={hasError}\n innerRef={(ref) => {\n inputRef.current = ref;\n if (innerRef) innerRef(ref);\n }}\n isActive={focus}\n leftComponent={leftComponent}\n maxLength={maxLength}\n minLength={minLength}\n name={name}\n onBlur={handleBlur}\n onChange={handleOnChange}\n onClick={onClick}\n onFocus={onFocus}\n onKeyDown={handleKeyDown}\n onKeyUp={onKeyUp}\n onPaste={onPaste}\n placeholder={placeholder}\n readOnly={readOnly}\n rightComponent={rightComponent}\n style={style}\n type={type}\n value={maskedValue}\n />\n );\n};\n\nPhoneInternationalInputMask.propTypes = {\n focus: PropTypes.bool,\n setFocus: PropTypes.func,\n setRawMask: PropTypes.func,\n cursorPosition: PropTypes.shape({ current: PropTypes.number }),\n setCursorPosition: PropTypes.func,\n lastkey: PropTypes.shape({ code: PropTypes.number, key: PropTypes.string }),\n setLastkey: PropTypes.func,\n setRawValue: PropTypes.func,\n style: PropTypes.object,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n name: PropTypes.string,\n maxLength: PropTypes.number,\n minLength: PropTypes.number,\n fluidWidth: PropTypes.bool,\n placeholder: PropTypes.string,\n value: PropTypes.string,\n onChange: PropTypes.func,\n onKeyDown: PropTypes.func,\n leftComponent: PropTypes.element,\n rightComponent: PropTypes.element,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n onPaste: PropTypes.func,\n onKeyUp: PropTypes.func,\n hasError: PropTypes.bool,\n readOnly: PropTypes.bool,\n onClick: PropTypes.func,\n clearable: PropTypes.bool,\n type: PropTypes.string,\n innerRef: PropTypes.any,\n mask: PropTypes.any,\n placeholderChar: PropTypes.string,\n};\n\nexport { PhoneInternationalInputMask };\nexport default PhoneInternationalInputMask;\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACEA;AACA;AACA;AAEA;AAEA,MAAM,eAAe,CAAC,UAAU,WAAW,gBAAgB;AACzD,MAAI,kBAAkB,SACnB,MAAM,IAAI,EACV,MAAM,EAAE,EAAE,GACV,MAAM,EAAE,EACR,OAAO,CAAC,SAAS,QAAQ,OAAO,QAAQ,GAAG;AAE9C,SAAO,gBAAgB,UAAU,gBAAgB,OAAO;AACtD,oBAAgB,OAAO,GAAG,CAAC;AAE7B,oBAAkB,gBAAgB,MAAM,GAAG,EAAE;AAE7C,MAAI,YAAY;AAChB,WAAS,IAAI,GAAG,IAAI,WAAW,KAAK,GAAG;AACrC,QAAI,gBAAgB,eAAe,SAAS;AAAI,mBAAa;AAAA,EAC/D;AAGF,QAAM,kBAA+B;AAAA,IACjC,CAAC,QAAQ,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AAAA,EACrB,eAAe,UAAU;AAAA,EACzB,gBAAgB,UAAU;AAAA,EAC1B,SAAS,UAAU;AAAA,EACnB,QAAQ,UAAU;AAAA,EAClB,SAAS,UAAU;AAAA,EACnB,SAAS,UAAU;AAAA,EACnB,UAAU,UAAU;AAAA,EACpB,UAAU,UAAU;AAAA,EACpB,SAAS,UAAU;AAAA,EACnB,WAAW,UAAU;AAAA,EACrB,MAAM,UAAU;AAAA,EAChB,UAAU,UAAU;AAAA,EACpB,MAAM,UAAU;AAAA,EAChB,iBAAiB,UAAU;AAC7B;AAGA,IAAO,sCAAQ;",
6
6
  "names": []
7
7
  }
@@ -31,7 +31,7 @@ var __objRest = (source, exclude) => {
31
31
  };
32
32
  import * as React from "react";
33
33
  import React2, { useCallback, useLayoutEffect, useRef, useState } from "react";
34
- import { PropTypes } from "react-desc";
34
+ import { PropTypes } from "@elliemae/ds-utilities";
35
35
  import { DSTextBox } from "../../TextBox";
36
36
  import { setCaretPosition } from "../utils/setCaretPosition";
37
37
  const conformValue = (rawValue, cursorPos, lastkeycode) => {