@elliemae/ds-form 3.14.0-next.16 → 3.14.0-next.17

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 (149) hide show
  1. package/dist/cjs/InputMask/mask_types/PhoneInputMask.js +1 -1
  2. package/dist/cjs/InputMask/mask_types/PhoneInputMask.js.map +2 -2
  3. package/dist/esm/InputMask/mask_types/PhoneInputMask.js +1 -1
  4. package/dist/esm/InputMask/mask_types/PhoneInputMask.js.map +2 -2
  5. package/dist/types/Checkbox/index.d.ts +1 -0
  6. package/dist/types/CheckboxGroup/DSCheckboxGroup.d.ts +46 -0
  7. package/dist/types/CheckboxGroup/defaultProps.d.ts +14 -0
  8. package/dist/types/CheckboxGroup/index.d.ts +1 -0
  9. package/dist/types/CheckboxGroup/props.d.ts +26 -0
  10. package/dist/types/CheckboxGroup/tests/DSCheckboxGroup.events.test.d.ts +1 -0
  11. package/dist/types/ComboBox/index.d.ts +1 -0
  12. package/dist/types/ComboBoxFreeSolo/ComboBoxFreeSolo.d.ts +78 -0
  13. package/dist/types/ComboBoxFreeSolo/components/MultiValueLabel.d.ts +5 -0
  14. package/dist/types/ComboBoxFreeSolo/components/MultiValueRemove.d.ts +5 -0
  15. package/dist/types/ComboBoxFreeSolo/components/SingleValue.d.ts +2 -0
  16. package/dist/types/ComboBoxFreeSolo/components/SingleValueRemove.d.ts +5 -0
  17. package/dist/types/ComboBoxFreeSolo/index.d.ts +1 -0
  18. package/dist/types/DateInput/DSDateInput.d.ts +62 -0
  19. package/dist/types/DateInput/components/DateInputImpl.d.ts +40 -0
  20. package/dist/types/DateInput/components/DateInputs.d.ts +40 -0
  21. package/dist/types/DateInput/components/utils.d.ts +40 -0
  22. package/dist/types/DateInput/defaultProps.d.ts +18 -0
  23. package/dist/types/DateInput/index.d.ts +1 -0
  24. package/dist/types/DateInput/props.d.ts +60 -0
  25. package/dist/types/DateInput/tests/DSDateInput.events.test.d.ts +1 -0
  26. package/dist/types/DateInputV2/components/DSDateInput.d.ts +54 -0
  27. package/dist/types/DateInputV2/components/DateInputs.d.ts +32 -0
  28. package/dist/types/DateInputV2/components/helpers.d.ts +1 -0
  29. package/dist/types/DateInputV2/components/props.d.ts +53 -0
  30. package/dist/types/DateInputV2/components/propsTypes.d.ts +21 -0
  31. package/dist/types/DateInputV2/components/styled.d.ts +5 -0
  32. package/dist/types/DateInputV2/components/utils.d.ts +42 -0
  33. package/dist/types/DateInputV2/index.d.ts +2 -0
  34. package/dist/types/DateInputV2/tests/DateInput.test.d.ts +1 -0
  35. package/dist/types/ExpandableInput/DSExpandableInput.d.ts +15 -0
  36. package/dist/types/ExpandableInput/ExpandableInputImpl.d.ts +7 -0
  37. package/dist/types/ExpandableInput/index.d.ts +1 -0
  38. package/dist/types/FloatingLabelInput/DSFloatingLabelInput.d.ts +47 -0
  39. package/dist/types/FloatingLabelInput/FloatingLabelInputImpl.d.ts +27 -0
  40. package/dist/types/FloatingLabelInput/getSvgPath.d.ts +10 -0
  41. package/dist/types/FloatingLabelInput/index.d.ts +1 -0
  42. package/dist/types/FormItem/DSFormItemLayout.d.ts +180 -0
  43. package/dist/types/FormItem/Error/DSError.d.ts +19 -0
  44. package/dist/types/FormItem/Feedback.d.ts +6 -0
  45. package/dist/types/FormItem/Label/DSLabel.d.ts +23 -0
  46. package/dist/types/FormItem/Suffix/Suffix.d.ts +4 -0
  47. package/dist/types/FormItem/ValidationFieldWrapper.d.ts +19 -0
  48. package/dist/types/FormItem/defaultProps.d.ts +51 -0
  49. package/dist/types/FormItem/index.d.ts +2 -0
  50. package/dist/types/FormItem/props.d.ts +80 -0
  51. package/dist/types/FormItem/tests/DSFormItem.events.test.d.ts +1 -0
  52. package/dist/types/FormItem/variants.d.ts +8 -0
  53. package/dist/types/Input/DSInput.d.ts +0 -0
  54. package/dist/types/Input/InputAddonWrapper.d.ts +0 -0
  55. package/dist/types/Input/InputImpl.d.ts +0 -0
  56. package/dist/types/Input/index.d.ts +1 -0
  57. package/dist/types/Input/tests/Input.test.d.ts +0 -0
  58. package/dist/types/InputGroup/AddonWrapper.d.ts +8 -0
  59. package/dist/types/InputGroup/DSInputGroup.d.ts +40 -0
  60. package/dist/types/InputGroup/defaultProps.d.ts +8 -0
  61. package/dist/types/InputGroup/index.d.ts +1 -0
  62. package/dist/types/InputGroup/props.d.ts +24 -0
  63. package/dist/types/InputGroup/tests/DSInputGroup.events.test.d.ts +1 -0
  64. package/dist/types/InputMask/DSInputMask.d.ts +85 -0
  65. package/dist/types/InputMask/DSInputMaskDeprecated.d.ts +18 -0
  66. package/dist/types/InputMask/InputMaskContext.d.ts +18 -0
  67. package/dist/types/InputMask/MaskPipes.d.ts +18 -0
  68. package/dist/types/InputMask/MaskTypes.d.ts +15 -0
  69. package/dist/types/InputMask/addons/AutoCorrectedDatePipe.d.ts +8 -0
  70. package/dist/types/InputMask/defaultProps.d.ts +28 -0
  71. package/dist/types/InputMask/index.d.ts +1 -0
  72. package/dist/types/InputMask/mask_types/DateInputMask.d.ts +36 -0
  73. package/dist/types/InputMask/mask_types/DateTimeInputMask.d.ts +36 -0
  74. package/dist/types/InputMask/mask_types/DictionaryInputMask.d.ts +39 -0
  75. package/dist/types/InputMask/mask_types/NumberInputMask.d.ts +48 -0
  76. package/dist/types/InputMask/mask_types/PhoneInputMask.d.ts +36 -0
  77. package/dist/types/InputMask/mask_types/PhoneInternationalInputMask.d.ts +36 -0
  78. package/dist/types/InputMask/mask_types/SsnInputMask.d.ts +36 -0
  79. package/dist/types/InputMask/mask_types/UsZipCodeInputMask.d.ts +36 -0
  80. package/dist/types/InputMask/mask_types/ZipCodeSearchInputMask.d.ts +36 -0
  81. package/dist/types/InputMask/mask_types/index.d.ts +41 -0
  82. package/dist/types/InputMask/props.d.ts +112 -0
  83. package/dist/types/InputMask/tests/DSInputMask.test.d.ts +1 -0
  84. package/dist/types/InputMask/tests/NumberInputMask.test.d.ts +1 -0
  85. package/dist/types/InputMask/tests/events/DateInputMask.events.test.d.ts +1 -0
  86. package/dist/types/InputMask/tests/events/DateTimeInputMask.events.test.d.ts +1 -0
  87. package/dist/types/InputMask/tests/events/NumberInputMask.events.test.d.ts +1 -0
  88. package/dist/types/InputMask/tests/events/PercentInputMask.events.test.d.ts +1 -0
  89. package/dist/types/InputMask/tests/events/PhoneInputMask.events.test.d.ts +1 -0
  90. package/dist/types/InputMask/tests/events/PhoneInternationalInputMask.events.test.d.ts +1 -0
  91. package/dist/types/InputMask/tests/events/SsnInputMask.events.test.d.ts +1 -0
  92. package/dist/types/InputMask/tests/events/UsZipCodeInputMask.events.test.d.ts +1 -0
  93. package/dist/types/InputMask/tests/events/ZipCodeSearchInputMask.events.test.d.ts +1 -0
  94. package/dist/types/InputMask/types/index.d.ts +5 -0
  95. package/dist/types/InputMask/utils/setCaretPosition.d.ts +3 -0
  96. package/dist/types/InputProtected/DSInputProtected.d.ts +41 -0
  97. package/dist/types/InputProtected/defaultProps.d.ts +4 -0
  98. package/dist/types/InputProtected/index.d.ts +2 -0
  99. package/dist/types/InputProtected/options.d.ts +8 -0
  100. package/dist/types/InputProtected/props.d.ts +14 -0
  101. package/dist/types/InputProtected/tests/DSInputProtected.events.test.d.ts +1 -0
  102. package/dist/types/InputProtected/tests/DSInputProtected.test.d.ts +1 -0
  103. package/dist/types/LargeInputText/DSLargeInputText.d.ts +127 -0
  104. package/dist/types/LargeInputText/defaultProps.d.ts +31 -0
  105. package/dist/types/LargeInputText/index.d.ts +1 -0
  106. package/dist/types/LargeInputText/props.d.ts +95 -0
  107. package/dist/types/LargeInputText/tests/DSLargeInputText.events.test.d.ts +1 -0
  108. package/dist/types/LargeInputText/tests/DSLargeInputText.test.d.ts +1 -0
  109. package/dist/types/MenuItem/components/MenuItem/index.d.ts +0 -0
  110. package/dist/types/MenuItem/components/MenuItem/styled.d.ts +0 -0
  111. package/dist/types/MenuItem/components/MultiMenuItem/MultiMenuItem.d.ts +0 -0
  112. package/dist/types/MenuItem/components/MultiMenuItem/styled.d.ts +0 -0
  113. package/dist/types/MenuItem/components/Section/index.d.ts +0 -0
  114. package/dist/types/MenuItem/components/Section/props.d.ts +0 -0
  115. package/dist/types/MenuItem/components/Section/styled.d.ts +0 -0
  116. package/dist/types/MenuItem/components/Separator/index.d.ts +0 -0
  117. package/dist/types/MenuItem/components/Separator/styled.d.ts +0 -0
  118. package/dist/types/MenuItem/components/SingleMenuItem/SingleMenuItem.d.ts +0 -0
  119. package/dist/types/MenuItem/components/SubmenuItem/index.d.ts +0 -0
  120. package/dist/types/MenuItem/components/SubmenuItem/styled.d.ts +0 -0
  121. package/dist/types/MenuItem/components/index.d.ts +0 -0
  122. package/dist/types/MenuItem/components/styled.d.ts +0 -0
  123. package/dist/types/MenuItem/index.d.ts +0 -0
  124. package/dist/types/MenuItem/props.d.ts +0 -0
  125. package/dist/types/Radio/Circle.d.ts +8 -0
  126. package/dist/types/Radio/DSRadio.d.ts +87 -0
  127. package/dist/types/Radio/index.d.ts +1 -0
  128. package/dist/types/RadioGroup/DSRadioGroup.d.ts +46 -0
  129. package/dist/types/RadioGroup/defaultProps.d.ts +12 -0
  130. package/dist/types/RadioGroup/index.d.ts +1 -0
  131. package/dist/types/RadioGroup/props.d.ts +25 -0
  132. package/dist/types/RadioGroup/tests/DSRadioGroup.events.test.d.ts +1 -0
  133. package/dist/types/RequiredMark/RequiredMark.d.ts +6 -0
  134. package/dist/types/RequiredMark/index.d.ts +1 -0
  135. package/dist/types/SearchBox/index.d.ts +1 -0
  136. package/dist/types/TextBox/index.d.ts +1 -0
  137. package/dist/types/TimeInput/DSTimeInput.d.ts +71 -0
  138. package/dist/types/TimeInput/TimeInputImpl.d.ts +55 -0
  139. package/dist/types/TimeInput/TimeInputs.d.ts +17 -0
  140. package/dist/types/TimeInput/index.d.ts +1 -0
  141. package/dist/types/TimeInput/utils.d.ts +39 -0
  142. package/dist/types/Toggle/DSToggle.d.ts +86 -0
  143. package/dist/types/Toggle/DSToggleImpl.d.ts +61 -0
  144. package/dist/types/Toggle/DSToggleRender.d.ts +32 -0
  145. package/dist/types/Toggle/index.d.ts +1 -0
  146. package/dist/types/Toggle/props.d.ts +47 -0
  147. package/dist/types/Toggle/toggleHelper.d.ts +24 -0
  148. package/dist/types/index.d.ts +21 -0
  149. package/package.json +12 -12
@@ -34,7 +34,7 @@ var import_react = require("react");
34
34
  var import_TextBox = require("../../TextBox");
35
35
  var import_setCaretPosition = require("../utils/setCaretPosition");
36
36
  const conformValue = (rawValue, cursorPos, lastkeycode) => {
37
- let nextMaskedValue = rawValue.split("").filter((char) => char >= "0" && char <= "9");
37
+ let nextMaskedValue = String(rawValue).split("").filter((char) => char >= "0" && char <= "9");
38
38
  while (nextMaskedValue.length && nextMaskedValue[0] === "0")
39
39
  nextMaskedValue.splice(0, 1);
40
40
  nextMaskedValue = nextMaskedValue.slice(0, 10);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/InputMask/mask_types/PhoneInputMask.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* 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 type { TCharsToAdd } from '../types';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst conformValue = (rawValue, cursorPos, lastkeycode) => {\n let nextMaskedValue = rawValue.split('').filter((char) => char >= '0' && char <= '9');\n\n while (nextMaskedValue.length && nextMaskedValue[0] === '0') 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]\n const 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(rawValue, cursorPos, lastkeycode);\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\nexport { PhoneInputMask };\nexport default PhoneInputMask;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADiJnB;AA/IJ,mBAAsE;AAEtE,qBAA0B;AAE1B,8BAAiC;AAEjC,MAAM,eAAe,CAAC,UAAU,WAAW,gBAAgB;AACzD,MAAI,kBAAkB,SAAS,MAAM,EAAE,EAAE,OAAO,CAAC,SAAS,QAAQ,OAAO,QAAQ,GAAG;AAEpF,SAAO,gBAAgB,UAAU,gBAAgB,OAAO;AAAK,oBAAgB,OAAO,GAAG,CAAC;AAExF,oBAAkB,gBAAgB,MAAM,GAAG,EAAE;AAE7C,MAAI,YAAY;AAChB,WAAS,IAAI,GAAG,IAAI,WAAW,KAAK,GAAG;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AM;AACL,eAAS,KAAK;AACd,aAAO,CAAC;AAAA,IACV;AAAA,IACA,CAAC,MAAM;AAAA,EACT;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU,CAAC,QAAQ;AACjB,iBAAS,UAAU;AACnB,YAAI;AAAU,mBAAS,GAAG;AAAA,MAC5B;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,QAAQ;AAAA,MACR,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA,WAAW;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO;AAAA;AAAA,EACT;AAEJ;AAGA,IAAO,yBAAQ;",
4
+ "sourcesContent": ["/* 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 type { TCharsToAdd } from '../types';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst conformValue = (rawValue, cursorPos, lastkeycode) => {\n let nextMaskedValue = String(rawValue).split('').filter((char) => char >= '0' && char <= '9');\n\n while (nextMaskedValue.length && nextMaskedValue[0] === '0') 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]\n const 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(rawValue, cursorPos, lastkeycode);\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\nexport { PhoneInputMask };\nexport default PhoneInputMask;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADiJnB;AA/IJ,mBAAsE;AAEtE,qBAA0B;AAE1B,8BAAiC;AAEjC,MAAM,eAAe,CAAC,UAAU,WAAW,gBAAgB;AACzD,MAAI,kBAAkB,OAAO,QAAQ,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,SAAS,QAAQ,OAAO,QAAQ,GAAG;AAE5F,SAAO,gBAAgB,UAAU,gBAAgB,OAAO;AAAK,oBAAgB,OAAO,GAAG,CAAC;AAExF,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;AA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AC,MAAM;AAAA,EACT;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU,CAAC,QAAQ;AACjB,iBAAS,UAAU;AACnB,YAAI;AAAU,mBAAS,GAAG;AAAA,MAC5B;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,QAAQ;AAAA,MACR,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA,WAAW;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO;AAAA;AAAA,EACT;AAEJ;AAGA,IAAO,yBAAQ;",
6
6
  "names": []
7
7
  }
@@ -4,7 +4,7 @@ import { useCallback, useLayoutEffect, useRef, useState } from "react";
4
4
  import { DSTextBox } from "../../TextBox";
5
5
  import { setCaretPosition } from "../utils/setCaretPosition";
6
6
  const conformValue = (rawValue, cursorPos, lastkeycode) => {
7
- let nextMaskedValue = rawValue.split("").filter((char) => char >= "0" && char <= "9");
7
+ let nextMaskedValue = String(rawValue).split("").filter((char) => char >= "0" && char <= "9");
8
8
  while (nextMaskedValue.length && nextMaskedValue[0] === "0")
9
9
  nextMaskedValue.splice(0, 1);
10
10
  nextMaskedValue = nextMaskedValue.slice(0, 10);
@@ -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 '@elliemae/ds-utilities';\nimport { DSTextBox } from '../../TextBox';\nimport type { TCharsToAdd } from '../types';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst conformValue = (rawValue, cursorPos, lastkeycode) => {\n let nextMaskedValue = rawValue.split('').filter((char) => char >= '0' && char <= '9');\n\n while (nextMaskedValue.length && nextMaskedValue[0] === '0') 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]\n const 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(rawValue, cursorPos, lastkeycode);\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\nexport { PhoneInputMask };\nexport default PhoneInputMask;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACiJnB;AA/IJ,SAAgB,aAAa,iBAAiB,QAAQ,gBAAgB;AAEtE,SAAS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,MAC1B,aAAa,QAAQ;AAAA,MACrB,uBAAuB;AAAA,IACzB,CAAC;AAAA,EACH,GAAG,CAAC,OAAO,OAAO,eAAe,OAAO,CAAC;AAEzC,QAAM,gBAAgB;AAAA,IACpB,CAAC,MAAM;AACL,QAAE,gBAAgB;AAClB,iBAAW,EAAE,KAAK,EAAE,KAAK,MAAM,EAAE,QAAQ,CAAC;AAC1C,gBAAU,CAAC;AAAA,IACb;AAAA,IACA,CAAC,SAAS;AAAA,EACZ;AAEA,QAAM,aAAa;AAAA,IACjB,CAAC,MAAM;AACL,eAAS,KAAK;AACd,aAAO,CAAC;AAAA,IACV;AAAA,IACA,CAAC,MAAM;AAAA,EACT;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU,CAAC,QAAQ;AACjB,iBAAS,UAAU;AACnB,YAAI;AAAU,mBAAS,GAAG;AAAA,MAC5B;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,QAAQ;AAAA,MACR,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA,WAAW;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO;AAAA;AAAA,EACT;AAEJ;AAGA,IAAO,yBAAQ;",
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 type { TCharsToAdd } from '../types';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst conformValue = (rawValue, cursorPos, lastkeycode) => {\n let nextMaskedValue = String(rawValue).split('').filter((char) => char >= '0' && char <= '9');\n\n while (nextMaskedValue.length && nextMaskedValue[0] === '0') 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]\n const 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(rawValue, cursorPos, lastkeycode);\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\nexport { PhoneInputMask };\nexport default PhoneInputMask;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACiJnB;AA/IJ,SAAgB,aAAa,iBAAiB,QAAQ,gBAAgB;AAEtE,SAAS,iBAAiB;AAE1B,SAAS,wBAAwB;AAEjC,MAAM,eAAe,CAAC,UAAU,WAAW,gBAAgB;AACzD,MAAI,kBAAkB,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AAO,OAAO,eAAe,OAAO,CAAC;AAEzC,QAAM,gBAAgB;AAAA,IACpB,CAAC,MAAM;AACL,QAAE,gBAAgB;AAClB,iBAAW,EAAE,KAAK,EAAE,KAAK,MAAM,EAAE,QAAQ,CAAC;AAC1C,gBAAU,CAAC;AAAA,IACb;AAAA,IACA,CAAC,SAAS;AAAA,EACZ;AAEA,QAAM,aAAa;AAAA,IACjB,CAAC,MAAM;AACL,eAAS,KAAK;AACd,aAAO,CAAC;AAAA,IACV;AAAA,IACA,CAAC,MAAM;AAAA,EACT;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU,CAAC,QAAQ;AACjB,iBAAS,UAAU;AACnB,YAAI;AAAU,mBAAS,GAAG;AAAA,MAC5B;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,QAAQ;AAAA,MACR,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA,WAAW;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO;AAAA;AAAA,EACT;AAEJ;AAGA,IAAO,yBAAQ;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1 @@
1
+ export * from '@elliemae/ds-common/Checkbox';
@@ -0,0 +1,46 @@
1
+ declare const DSCheckboxGroup: {
2
+ ({ onChange, activeValue, children, disabled, orientation, truncateText, labelProps, containerProps, }: {
3
+ onChange: any;
4
+ activeValue: any;
5
+ children: any;
6
+ disabled: any;
7
+ orientation: any;
8
+ truncateText: any;
9
+ labelProps: any;
10
+ containerProps: any;
11
+ }): JSX.Element;
12
+ propTypes: {
13
+ onChange: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
14
+ activeValue: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
15
+ children: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
16
+ disabled: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
17
+ orientation: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
18
+ labelProps: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
19
+ };
20
+ defaultProps: {
21
+ onChange: () => null;
22
+ activeValue: never[];
23
+ children: never[];
24
+ disabled: boolean;
25
+ orientation: string;
26
+ truncateText: boolean;
27
+ labelProps: {
28
+ feedbackMessage: string;
29
+ labelText: string;
30
+ required: boolean;
31
+ };
32
+ containerProps: {};
33
+ };
34
+ displayName: string;
35
+ };
36
+ declare const DSCheckboxGroupWithSchema: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").DocumentedReactComponent<{
37
+ onChange: any;
38
+ activeValue: any;
39
+ children: any;
40
+ disabled: any;
41
+ orientation: any;
42
+ truncateText: any;
43
+ labelProps: any;
44
+ containerProps: any;
45
+ }>;
46
+ export { DSCheckboxGroup, DSCheckboxGroupWithSchema };
@@ -0,0 +1,14 @@
1
+ export declare const defaultProps: {
2
+ onChange: () => null;
3
+ activeValue: never[];
4
+ children: never[];
5
+ disabled: boolean;
6
+ orientation: string;
7
+ truncateText: boolean;
8
+ labelProps: {
9
+ feedbackMessage: string;
10
+ labelText: string;
11
+ required: boolean;
12
+ };
13
+ containerProps: {};
14
+ };
@@ -0,0 +1 @@
1
+ export * from './DSCheckboxGroup';
@@ -0,0 +1,26 @@
1
+ export declare const props: {
2
+ /**
3
+ * Allows a function that is triggered once the checkbox group changes
4
+ */
5
+ onChange: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
6
+ /**
7
+ * Default active value
8
+ */
9
+ activeValue: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
10
+ /**
11
+ * Checkbox group items to show of type DSCheckbox
12
+ */
13
+ children: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
14
+ /**
15
+ * Whether the checkbox group is disabled or not
16
+ */
17
+ disabled: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
18
+ /**
19
+ * ['horizontal', 'vertical']
20
+ */
21
+ orientation: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
22
+ /**
23
+ * label props
24
+ */
25
+ labelProps: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
26
+ };
@@ -0,0 +1 @@
1
+ export * from '@elliemae/ds-common/ComboBox';
@@ -0,0 +1,78 @@
1
+ import PropTypes from 'prop-types';
2
+ declare const ComboBoxFreeSolo: {
3
+ ({ isMulti, options, value, onChange, onChangeV2, onInputChange, onFocus, onBlur, containerProps, disabled, menuIsOpen, placeholder, formatCreateLabel, maxOptions, ...rest }: {
4
+ [x: string]: any;
5
+ isMulti?: boolean | undefined;
6
+ options?: {} | undefined;
7
+ value?: never[] | undefined;
8
+ onChange?: ((...args: any[]) => void) | undefined;
9
+ onChangeV2?: ((...args: any[]) => void) | undefined;
10
+ onInputChange?: ((...args: any[]) => void) | undefined;
11
+ onFocus?: ((...args: any[]) => void) | undefined;
12
+ onBlur?: ((...args: any[]) => void) | undefined;
13
+ containerProps?: {} | undefined;
14
+ disabled?: boolean | undefined;
15
+ menuIsOpen?: boolean | undefined;
16
+ placeholder?: string | undefined;
17
+ formatCreateLabel?: ((val: any) => string) | undefined;
18
+ maxOptions?: undefined;
19
+ }): JSX.Element;
20
+ propTypes: {
21
+ containerProps: PropTypes.Requireable<object>;
22
+ /**
23
+ * Allows a function that is triggered once the combo box is focused
24
+ */
25
+ onFocus: PropTypes.Requireable<(...args: any[]) => any>;
26
+ /**
27
+ * Allows a function that is triggered once the combo box loses focus
28
+ */
29
+ onBlur: PropTypes.Requireable<(...args: any[]) => any>;
30
+ /**
31
+ * Allows a function that is triggered when a new value is selected from the dropdown menu
32
+ */
33
+ onChange: PropTypes.Validator<(...args: any[]) => any>;
34
+ /**
35
+ * Allows a function that is triggered when a new value is selected from the dropdown menu
36
+ * It will return the current options selected
37
+ */
38
+ onChangeV2: PropTypes.Requireable<(...args: any[]) => any>;
39
+ /**
40
+ * Allows a function that is triggered once the input value changes (on every keystroke)
41
+ */
42
+ onInputChange: PropTypes.Requireable<(...args: any[]) => any>;
43
+ value: PropTypes.Requireable<object>;
44
+ /**
45
+ * Value that the combo box has as default
46
+ */
47
+ options: PropTypes.Requireable<(object | null | undefined)[]>;
48
+ /**
49
+ * Whether the combo box is disabled or not
50
+ */
51
+ disabled: PropTypes.Requireable<boolean>;
52
+ /**
53
+ * Whether the combo box free solo is multi selectable or not
54
+ */
55
+ isMulti: PropTypes.Requireable<boolean>;
56
+ /**
57
+ * Placeholder for the combo box
58
+ */
59
+ placeholder: PropTypes.Requireable<string>;
60
+ /**
61
+ * Whether the combo box menu is open or not
62
+ */
63
+ menuIsOpen: PropTypes.Requireable<boolean>;
64
+ /**
65
+ * Whether to show the combo box menu inline or not
66
+ */
67
+ /**
68
+ * function that reciveves the new value and returns the formatted value
69
+ */
70
+ formatCreateLabel: PropTypes.Requireable<(...args: any[]) => any>;
71
+ /**
72
+ * Max options to be displayed on the menu list
73
+ */
74
+ maxOptions: PropTypes.Requireable<number>;
75
+ };
76
+ };
77
+ export { ComboBoxFreeSolo };
78
+ export default ComboBoxFreeSolo;
@@ -0,0 +1,5 @@
1
+ declare const MultiValueLabel: ({ children, clear }: {
2
+ children: any;
3
+ clear: any;
4
+ }) => JSX.Element;
5
+ export { MultiValueLabel };
@@ -0,0 +1,5 @@
1
+ declare const MultiValueRemove: {
2
+ (props: any): JSX.Element;
3
+ style(base: any): any;
4
+ };
5
+ export { MultiValueRemove };
@@ -0,0 +1,2 @@
1
+ declare const SingleValue: (props: any) => JSX.Element;
2
+ export { SingleValue };
@@ -0,0 +1,5 @@
1
+ declare const SingleValueRemove: {
2
+ (props: any): JSX.Element;
3
+ style(base: any): any;
4
+ };
5
+ export { SingleValueRemove };
@@ -0,0 +1 @@
1
+ export * from './ComboBoxFreeSolo';
@@ -0,0 +1,62 @@
1
+ import { DateInputImpl } from './components/DateInputImpl';
2
+ declare const DSDateInput: {
3
+ ({ innerRef, className, style, onFocus, onBlur, onClear, onChange, onKeyDown, onError, format, value, clearable, disabled, yearMaxRange, yearMinRange, containerProps, INTERNAL_V2_NO_MUTATION, }: {
4
+ innerRef: any;
5
+ className: any;
6
+ style: any;
7
+ onFocus: any;
8
+ onBlur: any;
9
+ onClear: any;
10
+ onChange: any;
11
+ onKeyDown: any;
12
+ onError: any;
13
+ format: any;
14
+ value: any;
15
+ clearable: any;
16
+ disabled: any;
17
+ yearMaxRange: any;
18
+ yearMinRange: any;
19
+ containerProps: any;
20
+ INTERNAL_V2_NO_MUTATION: any;
21
+ }): JSX.Element;
22
+ propTypes: {
23
+ containerProps: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
24
+ innerRef: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
25
+ className: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
26
+ style: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
27
+ onBlur: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
28
+ onFocus: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
29
+ onClear: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
30
+ onKeyDown: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
31
+ onChange: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
32
+ onError: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
33
+ format: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
34
+ value: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
35
+ clearable: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
36
+ disabled: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
37
+ yearMaxRange: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
38
+ yearMinRange: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
39
+ };
40
+ defaultProps: {
41
+ className: string;
42
+ style: {};
43
+ onFocus: () => null;
44
+ onBlur: () => null;
45
+ onClear: () => null;
46
+ onChange: () => null;
47
+ onKeyDown: () => null;
48
+ onError: () => null;
49
+ format: string;
50
+ value: string;
51
+ clearable: boolean;
52
+ disabled: boolean;
53
+ yearMaxRange: number;
54
+ yearMinRange: number;
55
+ containerProps: {};
56
+ INTERNAL_V2_NO_MUTATION: boolean;
57
+ };
58
+ displayName: string;
59
+ };
60
+ declare const DSDateInputWithSchema: any;
61
+ export { DateInputImpl, DSDateInputWithSchema, DSDateInput };
62
+ export default DSDateInput;
@@ -0,0 +1,40 @@
1
+ import PropTypes from 'prop-types';
2
+ declare const DateInputImpl: {
3
+ ({ format, innerRef, onBlur, onChange, onKeyDown, onError, className, value, disabled, yearMaxRange, yearMinRange, onFocus, INTERNAL_V2_NO_MUTATION, }: {
4
+ format: any;
5
+ innerRef: any;
6
+ onBlur: any;
7
+ onChange: any;
8
+ onKeyDown: any;
9
+ onError: any;
10
+ className: any;
11
+ value: any;
12
+ disabled: any;
13
+ yearMaxRange: any;
14
+ yearMinRange: any;
15
+ onFocus: any;
16
+ INTERNAL_V2_NO_MUTATION: any;
17
+ }): JSX.Element;
18
+ propTypes: {
19
+ innerRef: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | PropTypes.InferProps<{
20
+ current: PropTypes.Requireable<any>;
21
+ }> | null | undefined>>;
22
+ onBlur: PropTypes.Requireable<boolean>;
23
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
24
+ onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
25
+ onError: PropTypes.Requireable<(...args: any[]) => any>;
26
+ format: PropTypes.Requireable<string>;
27
+ showMonth: PropTypes.Requireable<boolean>;
28
+ className: PropTypes.Requireable<string>;
29
+ showDay: PropTypes.Requireable<boolean>;
30
+ showYear: PropTypes.Requireable<boolean>;
31
+ step: PropTypes.Requireable<number>;
32
+ onFocus: PropTypes.Requireable<(...args: any[]) => any>;
33
+ yearMaxRange: PropTypes.Requireable<number>;
34
+ disabled: PropTypes.Requireable<boolean>;
35
+ yearMinRange: PropTypes.Requireable<number>;
36
+ value: PropTypes.Requireable<unknown>;
37
+ };
38
+ };
39
+ export { DateInputImpl };
40
+ export default DateInputImpl;
@@ -0,0 +1,40 @@
1
+ import PropTypes from 'prop-types';
2
+ declare const DateInputs: {
3
+ ({ innerRef, onBlur, onChange, onCustomKeyDown, onError, format, showMonth, showDay, showYear, step, yearMaxRange, disabled, yearMinRange, time, INTERNAL_V2_NO_MUTATION, }: {
4
+ innerRef: any;
5
+ onBlur: any;
6
+ onChange: any;
7
+ onCustomKeyDown: any;
8
+ onError: any;
9
+ format?: string | undefined;
10
+ showMonth?: boolean | undefined;
11
+ showDay?: boolean | undefined;
12
+ showYear?: boolean | undefined;
13
+ step?: number | undefined;
14
+ yearMaxRange: any;
15
+ disabled: any;
16
+ yearMinRange: any;
17
+ time: any;
18
+ INTERNAL_V2_NO_MUTATION: any;
19
+ }): JSX.Element;
20
+ propTypes: {
21
+ innerRef: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | PropTypes.InferProps<{
22
+ current: PropTypes.Requireable<any>;
23
+ }> | null | undefined>>;
24
+ onBlur: PropTypes.Requireable<boolean>;
25
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
26
+ onCustomKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
27
+ onError: PropTypes.Requireable<(...args: any[]) => any>;
28
+ format: PropTypes.Requireable<string>;
29
+ showMonth: PropTypes.Requireable<boolean>;
30
+ showDay: PropTypes.Requireable<boolean>;
31
+ showYear: PropTypes.Requireable<boolean>;
32
+ step: PropTypes.Requireable<number>;
33
+ yearMaxRange: PropTypes.Requireable<number>;
34
+ disabled: PropTypes.Requireable<boolean>;
35
+ yearMinRange: PropTypes.Requireable<number>;
36
+ time: PropTypes.Requireable<unknown>;
37
+ };
38
+ };
39
+ export { DateInputs };
40
+ export default DateInputs;
@@ -0,0 +1,40 @@
1
+ export declare const isArrowIncrementDecrement: (key: any) => boolean;
2
+ export declare const setNativeValue: (element: any, value: any) => void;
3
+ export declare const formatDay: (format: any, value: any) => string;
4
+ export declare const formatYear: (format: any, value: any) => string;
5
+ export declare const formatMonth: (format: any, value: any) => string;
6
+ export declare const parseTimeNumberFromText: (stringValue: any) => number | null;
7
+ export declare const triggerOnBlur: (blurEvent: any, onBlur?: () => void) => void;
8
+ export declare const focusNextInput: (currentEl: any) => void;
9
+ export declare const focusPreviousInput: (currentEl: any) => void;
10
+ export declare const getValidTimeNumber: ({ min, max }: {
11
+ min: any;
12
+ max: any;
13
+ }, number: any, valueString?: string, onError?: () => null) => any;
14
+ export declare const shouldFocusNextInput: (max: any, number: number | undefined, stringValue: any) => boolean;
15
+ export declare const getDateValuesFromTime: (time: any, format: any) => {
16
+ month?: undefined;
17
+ day?: undefined;
18
+ year?: undefined;
19
+ } | {
20
+ month: string;
21
+ day: string;
22
+ year: string;
23
+ };
24
+ export declare const resetTimeValues: () => {
25
+ month: string;
26
+ day: string;
27
+ year: string;
28
+ };
29
+ export declare const onInputFocus: (e: any) => void;
30
+ export declare const getNextTimeValue: (value: any, target: any, yearMinRange: any, yearMaxRange: any, step?: number, incrementing?: boolean) => number;
31
+ export declare const focusNextInputIfNeeded: (currentEl: any, max: any, number: any, stringValue: any, currentKey: any) => void;
32
+ export declare const commonInputProps: (digits: number | undefined, onKeyDown: any, placeholder: any) => {
33
+ pattern: string;
34
+ placeholder: any;
35
+ type: string;
36
+ onKeyDown: any;
37
+ onFocus: (e: any) => void;
38
+ };
39
+ export declare const handleCompletedDate: (time: any, date: any, show: any, INTERNAL_V2_NO_MUTATION: any) => any;
40
+ export declare const isTimeCompletelySet: (date: any, show: any, range: any) => boolean;
@@ -0,0 +1,18 @@
1
+ export declare const defaultProps: {
2
+ className: string;
3
+ style: {};
4
+ onFocus: () => null;
5
+ onBlur: () => null;
6
+ onClear: () => null;
7
+ onChange: () => null;
8
+ onKeyDown: () => null;
9
+ onError: () => null;
10
+ format: string;
11
+ value: string;
12
+ clearable: boolean;
13
+ disabled: boolean;
14
+ yearMaxRange: number;
15
+ yearMinRange: number;
16
+ containerProps: {};
17
+ INTERNAL_V2_NO_MUTATION: boolean;
18
+ };
@@ -0,0 +1 @@
1
+ export * from './DSDateInput';
@@ -0,0 +1,60 @@
1
+ export declare const props: {
2
+ /** props injected to date input wrapper node */
3
+ containerProps: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
4
+ /** inner ref for input wrapper */
5
+ innerRef: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
6
+ /** class for input */
7
+ className: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
8
+ /**
9
+ * Set style for the date input
10
+ */
11
+ style: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
12
+ /**
13
+ * Triggers the onBlur when focus moves out of date input
14
+ */
15
+ onBlur: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
16
+ /**
17
+ * Triggers the onFocus when the component gets the focus
18
+ */
19
+ onFocus: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
20
+ /**
21
+ * Triggers the onClear
22
+ */
23
+ onClear: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
24
+ /**
25
+ * Triggers the onKeyDown
26
+ */
27
+ onKeyDown: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
28
+ /**
29
+ * Allows a function that is triggered once the date input changes
30
+ */
31
+ onChange: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
32
+ /**
33
+ * Triggers the onError once one input date is wrong
34
+ */
35
+ onError: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
36
+ /**
37
+ * Format type for date input
38
+ */
39
+ format: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
40
+ /**
41
+ * Default value once the component is initialized
42
+ */
43
+ value: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
44
+ /**
45
+ * Whether the date input is clearable or not
46
+ */
47
+ clearable: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
48
+ /**
49
+ * Whether the date input is disabled or not
50
+ */
51
+ disabled: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
52
+ /**
53
+ * Max year that can be accepted by the date input
54
+ */
55
+ yearMaxRange: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
56
+ /**
57
+ * Min year that can be accepted by the date input
58
+ */
59
+ yearMinRange: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
60
+ };