@elliemae/ds-form 3.22.0-next.25 → 3.22.0-next.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Checkbox/index.js.map +1 -1
- package/dist/cjs/CheckboxGroup/DSCheckboxGroup.js.map +1 -1
- package/dist/cjs/CheckboxGroup/defaultProps.js.map +1 -1
- package/dist/cjs/CheckboxGroup/index.js.map +1 -1
- package/dist/cjs/CheckboxGroup/props.js.map +1 -1
- package/dist/cjs/ComboBox/index.js.map +1 -1
- package/dist/cjs/ComboBoxFreeSolo/ComboBoxFreeSolo.js.map +1 -1
- package/dist/cjs/ComboBoxFreeSolo/components/MultiValueLabel.js.map +1 -1
- package/dist/cjs/ComboBoxFreeSolo/components/MultiValueRemove.js.map +1 -1
- package/dist/cjs/ComboBoxFreeSolo/components/SingleValue.js.map +1 -1
- package/dist/cjs/ComboBoxFreeSolo/components/SingleValueRemove.js.map +1 -1
- package/dist/cjs/ComboBoxFreeSolo/index.js.map +1 -1
- package/dist/cjs/DateInput/DSDateInput.js.map +1 -1
- package/dist/cjs/DateInput/components/DateInputImpl.js.map +1 -1
- package/dist/cjs/DateInput/components/DateInputs.js.map +1 -1
- package/dist/cjs/DateInput/components/utils.js.map +1 -1
- package/dist/cjs/DateInput/defaultProps.js.map +1 -1
- package/dist/cjs/DateInput/index.js.map +1 -1
- package/dist/cjs/DateInput/props.js.map +1 -1
- package/dist/cjs/DateInputV2/components/DSDateInput.js.map +1 -1
- package/dist/cjs/DateInputV2/components/DateInputs.js.map +1 -1
- package/dist/cjs/DateInputV2/components/helpers.js.map +1 -1
- package/dist/cjs/DateInputV2/components/props.js.map +1 -1
- package/dist/cjs/DateInputV2/components/propsTypes.js.map +1 -1
- package/dist/cjs/DateInputV2/components/styled.js.map +1 -1
- package/dist/cjs/DateInputV2/components/utils.js.map +1 -1
- package/dist/cjs/DateInputV2/index.js.map +1 -1
- package/dist/cjs/ExpandableInput/DSExpandableInput.js.map +1 -1
- package/dist/cjs/ExpandableInput/ExpandableInputImpl.js.map +1 -1
- package/dist/cjs/ExpandableInput/index.js.map +1 -1
- package/dist/cjs/FloatingLabelInput/DSFloatingLabelInput.js.map +1 -1
- package/dist/cjs/FloatingLabelInput/FloatingLabelInputImpl.js.map +1 -1
- package/dist/cjs/FloatingLabelInput/getSvgPath.js.map +1 -1
- package/dist/cjs/FloatingLabelInput/index.js.map +1 -1
- package/dist/cjs/FormItem/DSFormItemLayout.js.map +1 -1
- package/dist/cjs/FormItem/Error/DSError.js.map +1 -1
- package/dist/cjs/FormItem/Feedback.js.map +1 -1
- package/dist/cjs/FormItem/Label/DSLabel.js.map +1 -1
- package/dist/cjs/FormItem/Suffix/Suffix.js.map +1 -1
- package/dist/cjs/FormItem/ValidationFieldWrapper.js.map +1 -1
- package/dist/cjs/FormItem/defaultProps.js.map +1 -1
- package/dist/cjs/FormItem/index.js.map +1 -1
- package/dist/cjs/FormItem/props.js.map +1 -1
- package/dist/cjs/FormItem/variants.js.map +1 -1
- package/dist/cjs/Input/DSInput.js.map +1 -1
- package/dist/cjs/Input/InputAddonWrapper.js.map +1 -1
- package/dist/cjs/Input/InputImpl.js.map +1 -1
- package/dist/cjs/Input/index.js.map +1 -1
- package/dist/cjs/InputGroup/AddonWrapper.js.map +1 -1
- package/dist/cjs/InputGroup/DSInputGroup.js.map +1 -1
- package/dist/cjs/InputGroup/defaultProps.js.map +1 -1
- package/dist/cjs/InputGroup/index.js.map +1 -1
- package/dist/cjs/InputGroup/props.js.map +1 -1
- package/dist/cjs/InputMask/DSInputMask.js.map +1 -1
- package/dist/cjs/InputMask/DSInputMaskDeprecated.js.map +1 -1
- package/dist/cjs/InputMask/InputMaskContext.js.map +1 -1
- package/dist/cjs/InputMask/MaskPipes.js.map +1 -1
- package/dist/cjs/InputMask/MaskTypes.js.map +1 -1
- package/dist/cjs/InputMask/addons/AutoCorrectedDatePipe.js.map +1 -1
- package/dist/cjs/InputMask/defaultProps.js.map +1 -1
- package/dist/cjs/InputMask/index.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/DateInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/DateTimeInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/DictionaryInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/NumberInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/PhoneInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/PhoneInternationalInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/SsnInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/UsZipCodeInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/ZipCodeSearchInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/index.js.map +1 -1
- package/dist/cjs/InputMask/props.js.map +1 -1
- package/dist/cjs/InputMask/types/index.js.map +1 -1
- package/dist/cjs/InputMask/utils/setCaretPosition.js.map +1 -1
- package/dist/cjs/InputProtected/DSInputProtected.js.map +1 -1
- package/dist/cjs/InputProtected/defaultProps.js.map +1 -1
- package/dist/cjs/InputProtected/index.js.map +1 -1
- package/dist/cjs/InputProtected/options.js.map +1 -1
- package/dist/cjs/InputProtected/props.js.map +1 -1
- package/dist/cjs/LargeInputText/DSLargeInputText.js.map +1 -1
- package/dist/cjs/LargeInputText/defaultProps.js.map +1 -1
- package/dist/cjs/LargeInputText/index.js.map +1 -1
- package/dist/cjs/LargeInputText/props.js.map +1 -1
- package/dist/cjs/MenuItem/components/MenuItem/index.js.map +1 -1
- package/dist/cjs/MenuItem/components/MenuItem/styled.js.map +1 -1
- package/dist/cjs/MenuItem/components/MultiMenuItem/MultiMenuItem.js.map +1 -1
- package/dist/cjs/MenuItem/components/MultiMenuItem/styled.js.map +1 -1
- package/dist/cjs/MenuItem/components/Section/index.js.map +1 -1
- package/dist/cjs/MenuItem/components/Section/props.js.map +1 -1
- package/dist/cjs/MenuItem/components/Section/styled.js.map +1 -1
- package/dist/cjs/MenuItem/components/Separator/index.js.map +1 -1
- package/dist/cjs/MenuItem/components/Separator/styled.js.map +1 -1
- package/dist/cjs/MenuItem/components/SingleMenuItem/SingleMenuItem.js.map +1 -1
- package/dist/cjs/MenuItem/components/SubmenuItem/index.js.map +1 -1
- package/dist/cjs/MenuItem/components/SubmenuItem/styled.js.map +1 -1
- package/dist/cjs/MenuItem/components/index.js.map +1 -1
- package/dist/cjs/MenuItem/components/styled.js.map +1 -1
- package/dist/cjs/MenuItem/index.js.map +1 -1
- package/dist/cjs/MenuItem/props.js.map +1 -1
- package/dist/cjs/Radio/Circle.js.map +1 -1
- package/dist/cjs/Radio/DSRadio.js.map +1 -1
- package/dist/cjs/Radio/index.js.map +1 -1
- package/dist/cjs/RadioGroup/DSRadioGroup.js.map +1 -1
- package/dist/cjs/RadioGroup/defaultProps.js.map +1 -1
- package/dist/cjs/RadioGroup/index.js.map +1 -1
- package/dist/cjs/RadioGroup/props.js.map +1 -1
- package/dist/cjs/RequiredMark/RequiredMark.js.map +1 -1
- package/dist/cjs/RequiredMark/index.js.map +1 -1
- package/dist/cjs/SearchBox/index.js.map +1 -1
- package/dist/cjs/TextBox/index.js.map +1 -1
- package/dist/cjs/TimeInput/DSTimeInput.js.map +1 -1
- package/dist/cjs/TimeInput/TimeInputImpl.js.map +1 -1
- package/dist/cjs/TimeInput/TimeInputs.js.map +1 -1
- package/dist/cjs/TimeInput/index.js.map +1 -1
- package/dist/cjs/TimeInput/utils.js.map +1 -1
- package/dist/cjs/Toggle/DSToggle.js.map +1 -1
- package/dist/cjs/Toggle/DSToggleImpl.js.map +1 -1
- package/dist/cjs/Toggle/DSToggleRender.js.map +1 -1
- package/dist/cjs/Toggle/index.js.map +1 -1
- package/dist/cjs/Toggle/props.js.map +1 -1
- package/dist/cjs/Toggle/toggleHelper.js.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/Checkbox/index.js.map +1 -1
- package/dist/esm/CheckboxGroup/DSCheckboxGroup.js.map +1 -1
- package/dist/esm/CheckboxGroup/defaultProps.js.map +1 -1
- package/dist/esm/CheckboxGroup/index.js.map +1 -1
- package/dist/esm/CheckboxGroup/props.js.map +1 -1
- package/dist/esm/ComboBox/index.js.map +1 -1
- package/dist/esm/ComboBoxFreeSolo/ComboBoxFreeSolo.js.map +1 -1
- package/dist/esm/ComboBoxFreeSolo/components/MultiValueLabel.js.map +1 -1
- package/dist/esm/ComboBoxFreeSolo/components/MultiValueRemove.js.map +1 -1
- package/dist/esm/ComboBoxFreeSolo/components/SingleValue.js.map +1 -1
- package/dist/esm/ComboBoxFreeSolo/components/SingleValueRemove.js.map +1 -1
- package/dist/esm/ComboBoxFreeSolo/index.js.map +1 -1
- package/dist/esm/DateInput/DSDateInput.js.map +1 -1
- package/dist/esm/DateInput/components/DateInputImpl.js.map +1 -1
- package/dist/esm/DateInput/components/DateInputs.js.map +1 -1
- package/dist/esm/DateInput/components/utils.js.map +1 -1
- package/dist/esm/DateInput/defaultProps.js.map +1 -1
- package/dist/esm/DateInput/index.js.map +1 -1
- package/dist/esm/DateInput/props.js.map +1 -1
- package/dist/esm/DateInputV2/components/DSDateInput.js.map +1 -1
- package/dist/esm/DateInputV2/components/DateInputs.js.map +1 -1
- package/dist/esm/DateInputV2/components/helpers.js.map +1 -1
- package/dist/esm/DateInputV2/components/props.js.map +1 -1
- package/dist/esm/DateInputV2/components/propsTypes.js.map +1 -1
- package/dist/esm/DateInputV2/components/styled.js.map +1 -1
- package/dist/esm/DateInputV2/components/utils.js.map +1 -1
- package/dist/esm/DateInputV2/index.js.map +1 -1
- package/dist/esm/ExpandableInput/DSExpandableInput.js.map +1 -1
- package/dist/esm/ExpandableInput/ExpandableInputImpl.js.map +1 -1
- package/dist/esm/ExpandableInput/index.js.map +1 -1
- package/dist/esm/FloatingLabelInput/DSFloatingLabelInput.js.map +1 -1
- package/dist/esm/FloatingLabelInput/FloatingLabelInputImpl.js.map +1 -1
- package/dist/esm/FloatingLabelInput/getSvgPath.js.map +1 -1
- package/dist/esm/FloatingLabelInput/index.js.map +1 -1
- package/dist/esm/FormItem/DSFormItemLayout.js.map +1 -1
- package/dist/esm/FormItem/Error/DSError.js.map +1 -1
- package/dist/esm/FormItem/Feedback.js.map +1 -1
- package/dist/esm/FormItem/Label/DSLabel.js.map +1 -1
- package/dist/esm/FormItem/Suffix/Suffix.js.map +1 -1
- package/dist/esm/FormItem/ValidationFieldWrapper.js.map +1 -1
- package/dist/esm/FormItem/defaultProps.js.map +1 -1
- package/dist/esm/FormItem/index.js.map +1 -1
- package/dist/esm/FormItem/props.js.map +1 -1
- package/dist/esm/FormItem/variants.js.map +1 -1
- package/dist/esm/Input/DSInput.js.map +1 -1
- package/dist/esm/Input/InputAddonWrapper.js.map +1 -1
- package/dist/esm/Input/InputImpl.js.map +1 -1
- package/dist/esm/Input/index.js.map +1 -1
- package/dist/esm/InputGroup/AddonWrapper.js.map +1 -1
- package/dist/esm/InputGroup/DSInputGroup.js.map +1 -1
- package/dist/esm/InputGroup/defaultProps.js.map +1 -1
- package/dist/esm/InputGroup/index.js.map +1 -1
- package/dist/esm/InputGroup/props.js.map +1 -1
- package/dist/esm/InputMask/DSInputMask.js.map +1 -1
- package/dist/esm/InputMask/DSInputMaskDeprecated.js.map +1 -1
- package/dist/esm/InputMask/InputMaskContext.js.map +1 -1
- package/dist/esm/InputMask/MaskPipes.js.map +1 -1
- package/dist/esm/InputMask/MaskTypes.js.map +1 -1
- package/dist/esm/InputMask/addons/AutoCorrectedDatePipe.js.map +1 -1
- package/dist/esm/InputMask/defaultProps.js.map +1 -1
- package/dist/esm/InputMask/index.js.map +1 -1
- package/dist/esm/InputMask/mask_types/DateInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/DateTimeInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/DictionaryInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/NumberInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/PhoneInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/PhoneInternationalInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/SsnInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/UsZipCodeInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/ZipCodeSearchInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/index.js.map +1 -1
- package/dist/esm/InputMask/props.js.map +1 -1
- package/dist/esm/InputMask/types/index.js.map +1 -1
- package/dist/esm/InputMask/utils/setCaretPosition.js.map +1 -1
- package/dist/esm/InputProtected/DSInputProtected.js.map +1 -1
- package/dist/esm/InputProtected/defaultProps.js.map +1 -1
- package/dist/esm/InputProtected/index.js.map +1 -1
- package/dist/esm/InputProtected/options.js.map +1 -1
- package/dist/esm/InputProtected/props.js.map +1 -1
- package/dist/esm/LargeInputText/DSLargeInputText.js.map +1 -1
- package/dist/esm/LargeInputText/defaultProps.js.map +1 -1
- package/dist/esm/LargeInputText/index.js.map +1 -1
- package/dist/esm/LargeInputText/props.js.map +1 -1
- package/dist/esm/MenuItem/components/MenuItem/index.js.map +1 -1
- package/dist/esm/MenuItem/components/MenuItem/styled.js.map +1 -1
- package/dist/esm/MenuItem/components/MultiMenuItem/MultiMenuItem.js.map +1 -1
- package/dist/esm/MenuItem/components/MultiMenuItem/styled.js.map +1 -1
- package/dist/esm/MenuItem/components/Section/index.js.map +1 -1
- package/dist/esm/MenuItem/components/Section/props.js.map +1 -1
- package/dist/esm/MenuItem/components/Section/styled.js.map +1 -1
- package/dist/esm/MenuItem/components/Separator/index.js.map +1 -1
- package/dist/esm/MenuItem/components/Separator/styled.js.map +1 -1
- package/dist/esm/MenuItem/components/SingleMenuItem/SingleMenuItem.js.map +1 -1
- package/dist/esm/MenuItem/components/SubmenuItem/index.js.map +1 -1
- package/dist/esm/MenuItem/components/SubmenuItem/styled.js.map +1 -1
- package/dist/esm/MenuItem/components/index.js.map +1 -1
- package/dist/esm/MenuItem/components/styled.js.map +1 -1
- package/dist/esm/MenuItem/index.js.map +1 -1
- package/dist/esm/MenuItem/props.js.map +1 -1
- package/dist/esm/Radio/Circle.js.map +1 -1
- package/dist/esm/Radio/DSRadio.js.map +1 -1
- package/dist/esm/Radio/index.js.map +1 -1
- package/dist/esm/RadioGroup/DSRadioGroup.js.map +1 -1
- package/dist/esm/RadioGroup/defaultProps.js.map +1 -1
- package/dist/esm/RadioGroup/index.js.map +1 -1
- package/dist/esm/RadioGroup/props.js.map +1 -1
- package/dist/esm/RequiredMark/RequiredMark.js.map +1 -1
- package/dist/esm/RequiredMark/index.js.map +1 -1
- package/dist/esm/SearchBox/index.js.map +1 -1
- package/dist/esm/TextBox/index.js.map +1 -1
- package/dist/esm/TimeInput/DSTimeInput.js.map +1 -1
- package/dist/esm/TimeInput/TimeInputImpl.js.map +1 -1
- package/dist/esm/TimeInput/TimeInputs.js.map +1 -1
- package/dist/esm/TimeInput/index.js.map +1 -1
- package/dist/esm/TimeInput/utils.js.map +1 -1
- package/dist/esm/Toggle/DSToggle.js.map +1 -1
- package/dist/esm/Toggle/DSToggleImpl.js.map +1 -1
- package/dist/esm/Toggle/DSToggleRender.js.map +1 -1
- package/dist/esm/Toggle/index.js.map +1 -1
- package/dist/esm/Toggle/props.js.map +1 -1
- package/dist/esm/Toggle/toggleHelper.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/types/Radio/Circle.d.ts +8 -0
- package/package.json +18 -18
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/InputMask/DSInputMaskDeprecated.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable react/prop-types */\n/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport React, { Component } from 'react';\nimport { isEqual } from 'lodash';\nimport PropTypes from 'prop-types';\nimport { adjustCaretPosition, conformToMask } from 'text-mask-core';\nimport { setCaretPosition } from './utils/setCaretPosition.js';\nimport { DSTextBox } from '../TextBox/index.js';\n\nconst getValueFromEventOrString = (e) => {\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 getRawMask = (mask, rawValue = '') => (typeof mask === 'function' ? mask(rawValue) : mask);\n\n// this is not safe because we don't take in consideration a lot of cases\n// just a monkeypatch untill we get the v2 going,\n// this work with \"internal\" masks...\nconst UNSAFEGetRawValue = (value, mask) => {\n const safeValue = getValueFromEventOrString(value);\n if (!safeValue) return '';\n const rawMask = getRawMask(mask, value);\n const characterToStrip = rawMask.filter((char) => typeof char === 'string');\n\n return safeValue\n ?.split('')\n ?.filter((char) => {\n const indexCharToStrip = characterToStrip.findIndex((strip) => strip === char);\n if (indexCharToStrip >= 0) {\n characterToStrip.splice(indexCharToStrip, 1);\n return false;\n }\n return true;\n })\n ?.join('');\n};\n\n// this is not safe because we don't take in consideration a lot of cases\n// just a monkeypatch untill we get the v2 going,\n// this work with \"internal\" masks...\nconst UNSAFEIsRawValue = (value, mask) => {\n const safeValue = getValueFromEventOrString(value);\n if (!safeValue) return false;\n const rawMask = getRawMask(mask, safeValue);\n const characterToStrip = rawMask.filter((char) => typeof char === 'string');\n if (safeValue)\n safeValue?.split('')?.forEach((char) => {\n const indexCharToStrip = characterToStrip.findIndex((strip) => strip === char);\n if (indexCharToStrip >= 0) {\n characterToStrip.splice(indexCharToStrip, 1);\n }\n });\n // if we matched all the character to strip, this is not a raw value\n // unsafe, but \"good enough\" for most masks...\n return characterToStrip.length !== 0;\n};\n\nclass DSInputMaskDeprecated extends Component {\n lastkey = null;\n\n lastkeycode = null;\n\n constructor(props) {\n super(props);\n this.inputref = React.createRef();\n\n this.state = {\n maskedValue: '',\n previousConformedValue: '',\n };\n this.conformValue = this.conformValue.bind(this);\n }\n\n conformValue = (\n rawValueOrEvent,\n currentCaretPosition,\n { skipCaretPositioning = false, skipOnChangeCallback = false } = {},\n ) => {\n const { previousConformedValue } = this.state;\n const { onChange, mask, placeholderChar = '_', pipe } = this.props;\n const rawValue = getValueFromEventOrString(rawValueOrEvent);\n\n // short-circuit logic if user cleared the input\n if (rawValue.length === 0) {\n this.setState(\n {\n maskedValue: rawValue,\n previousConformedValue: rawValue,\n focus: true,\n },\n () => {\n const event = {\n target: {\n value: rawValue,\n originalValue: rawValue,\n },\n lastkey: this.lastkey,\n };\n onChange(event);\n },\n );\n return;\n }\n const rawMaskWithTraps = getRawMask(mask, rawValue);\n const rawMask = rawMaskWithTraps.filter((val) => val !== '[]');\n\n // generate the final result we want to put in the state and in the input box\n const conformToMaskResults = conformToMask(rawValue, rawMask, {\n guide: false,\n placeholderChar,\n ...(previousConformedValue && { previousConformedValue }),\n });\n\n const { conformedValue: pipelessConformed } = conformToMaskResults;\n // when the last character must be always preserved we need to manually ensure it\n // because\n // conformToMask -> guide: false will interpeter the last character\n // will remove the last character if it's part of the mask\n // we may want to add a prop for this in the future?\n // this is used for example with \"decimal\" and \"percentage\" masks\n let conformedValueEnsureLastMaskChar = pipelessConformed;\n const lastMaskChar = rawMask[rawMask.length - 1];\n const lastValueChar = pipelessConformed.charAt(pipelessConformed.length - 1);\n if (typeof lastMaskChar === 'string' && lastMaskChar !== lastValueChar) {\n conformedValueEnsureLastMaskChar = pipelessConformed + lastMaskChar;\n }\n\n let pipeResult = {\n indexesOfPipedChars: [],\n value: conformedValueEnsureLastMaskChar,\n valid: true,\n };\n if (typeof pipe === 'function') pipeResult = pipe()(conformedValueEnsureLastMaskChar);\n\n // if the pipe results in an invalid value, we don't allow the change\n // meaning the final result will be like the user never tried to change the input\n // this is because the user will have to inject the validation in his pipe\n // probably pipe is never used, because this never worked before...\n // we will deprecate the \"pipe\" props in the future\n const conformedValue = pipeResult.valid ? pipeResult.value : previousConformedValue;\n\n // generate the \"placeholder\" used in calculating new caret position\n // this means we need\n // empty string as a value\n // guide:true\n // we can ignore \"previousConformedValue\" parameter\n const generatedPlaceHolder = conformToMask('', rawMask, {\n guide: true,\n placeholderChar,\n });\n const { indexesOfPipedChars } = pipeResult;\n const adjustCaretPositionOpts = {\n previousConformedValue,\n conformedValue,\n currentCaretPosition,\n rawValue,\n placeholderChar,\n placeholder: generatedPlaceHolder.conformedValue,\n indexesOfPipedChars,\n caretTrapIndexes: [],\n };\n const caretPos = adjustCaretPosition(adjustCaretPositionOpts);\n\n this.setState(\n {\n maskedValue: conformedValue,\n previousConformedValue: conformedValue,\n focus: true,\n },\n () => {\n const event = {\n target: {\n value: conformedValue,\n originalValue: rawValue,\n },\n lastkey: this.lastkey,\n };\n if (!skipOnChangeCallback) onChange(event);\n if (!skipCaretPositioning) setTimeout(() => setCaretPosition(this.inputref, caretPos));\n },\n );\n };\n\n // eslint-disable-next-line max-statements\n handleOnChange = (e) => {\n const rawValue = e?.target?.value || '';\n const { selectionEnd } = e.target;\n const currentCaretPosition = selectionEnd;\n this.conformValue(rawValue, currentCaretPosition);\n };\n\n handleKeyDown = (e) => {\n e.stopPropagation();\n const { onKeyDown } = this.props;\n this.lastkey = e.key;\n this.lastkeycode = e.keyCode;\n onKeyDown(e);\n };\n\n handleBlur = (e) => {\n const { onBlur } = this.props;\n this.setState({ focus: false });\n onBlur(e);\n };\n\n componentDidMount() {\n const { value, mask } = this.props;\n const isAlreadyRaw = UNSAFEIsRawValue(value, mask);\n const rawVal = isAlreadyRaw ? value : UNSAFEGetRawValue(value, mask);\n if (rawVal === '') return;\n // if value from props is raw, we invoke onChange\n // not invoking onChange on a raw value breaks the internal components depending on this...\n const shouldSkipOnChange = !isAlreadyRaw;\n\n this.conformValue(rawVal, rawVal.length, {\n skipCaretPositioning: true,\n skipOnChangeCallback: shouldSkipOnChange,\n });\n }\n\n componentDidUpdate(prevProps) {\n // ensure the mask is re-applied when value/mask props changes.\n // this is required by internal implementations like DSDateRangePicker\n const { value: prevValOrEvent, mask: prevMask } = prevProps;\n const { value: valOrEvent, mask } = this.props;\n const value = getValueFromEventOrString(valOrEvent);\n const isAlreadyRaw = UNSAFEIsRawValue(value, mask);\n const rawVal = isAlreadyRaw ? value : UNSAFEGetRawValue(value, mask);\n if (rawVal === '') return;\n const rawMask = getRawMask(mask, rawVal);\n\n const prevVal = getValueFromEventOrString(prevValOrEvent);\n const prevIsAlreadyRaw = UNSAFEIsRawValue(prevVal, prevMask);\n const prevRawVal = prevIsAlreadyRaw ? prevVal : UNSAFEGetRawValue(prevVal, prevMask);\n const prevRawMask = getRawMask(prevMask, prevRawVal);\n\n // we need to compare \"raw\" masks, because mask sometimes are functions\n // and if we don't compare raw mask, isEqual will produce unexpected result\n // which would lead to infinite loops\n if (prevVal !== value || !isEqual(prevRawMask, rawMask)) {\n // if value from props is raw, we invoke onChange\n // not invoking onChange on a raw value breaks the internal components depending on this...\n const shouldSkipOnChange = !isAlreadyRaw;\n this.conformValue(rawVal, rawVal.length, {\n skipCaretPositioning: true,\n skipOnChangeCallback: shouldSkipOnChange,\n });\n }\n }\n\n render() {\n const {\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 } = this.props;\n const { maskedValue, focus } = this.state;\n // if component is \"controlled\" we print the value from the props\n // if it's not controlled we use the internal state\n // handleOnChange has the logic to invoke the onChange with the mask applied\n // if the dev controls the component but pass down a value not conformed to the mask\n // it's a problem to be fixed on the dev side.\n // this means no \"get derived state from props\" mumbo-jumbos\n const propsValue = getValueFromEventOrString(value);\n const finalValue = typeof propsValue === 'string' || typeof propsValue === 'number' ? propsValue : maskedValue;\n\n return (\n <DSTextBox\n {...rest}\n aria-label={rest['aria-label']}\n className={className}\n clearable={clearable}\n disabled={disabled}\n fluidWidth={fluidWidth}\n hasError={hasError}\n isActive={focus}\n leftComponent={leftComponent}\n maxLength={maxLength}\n minLength={minLength}\n name={name}\n onBlur={this.handleBlur}\n onChange={this.handleOnChange}\n onClick={onClick}\n onFocus={onFocus}\n onKeyDown={this.handleKeyDown}\n onKeyUp={onKeyUp}\n onPaste={onPaste}\n placeholder={placeholder}\n readOnly={readOnly}\n rightComponent={rightComponent}\n style={style}\n type={type}\n value={finalValue}\n />\n );\n }\n}\n\nDSInputMaskDeprecated.propTypes = {\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 /**\n * Ref for the component\n */\n innerRef: PropTypes.any,\n /**\n * Mask type\n */\n mask: PropTypes.any,\n placeholderChar: PropTypes.string,\n};\n\nexport { DSInputMaskDeprecated };\nexport default DSInputMaskDeprecated;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;AC0SjB;AAtSN,OAAOA,UAAS,iBAAiB;AACjC,SAAS,eAAe;AACxB,OAAO,eAAe;AACtB,SAAS,qBAAqB,qBAAqB;AACnD,SAAS,wBAAwB;AACjC,SAAS,iBAAiB;AAE1B,MAAM,4BAA4B,CAAC,MAAM;AACvC,MAAI,QAAQ;AACZ,MAAI,KAAK,EAAE,QAAQ;AACjB,UAAM;AAAA,MACJ,QAAQ,EAAE,OAAO,OAAO;AAAA,IAC1B,IAAI;AACJ,YAAQ;AAAA,EACV;AACA,SAAO;AACT;AAEA,MAAM,aAAa,CAAC,MAAM,WAAW,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|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/InputMask/InputMaskContext.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport type { TLastkey } from './types/index.js';\n\nexport const InputMaskContext = React.createContext<{\n rawValue: string;\n setRawValue: React.Dispatch<string>;\n rawMask: any;\n setRawMask: React.Dispatch<any>;\n focus: boolean;\n setFocus: React.Dispatch<boolean>;\n lastkey: TLastkey;\n setLastkey: React.Dispatch<TLastkey>;\n cursorPosition: { current: number };\n setCursorPosition: React.Dispatch<{ current: number }>;\n}>({\n rawValue: '',\n setRawValue: () => null,\n rawMask: null,\n setRawMask: () => null,\n focus: false,\n setFocus: () => null,\n lastkey: { code: null, key: null },\n setLastkey: () => null,\n cursorPosition: { current: 0 },\n setCursorPosition: () => null,\n});\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAGX,MAAM,mBAAmBA,OAAM,cAWnC;AAAA,EACD,UAAU;AAAA,EACV,aAAa,MAAM;AAAA,EACnB,SAAS;AAAA,EACT,YAAY,MAAM;AAAA,EAClB,OAAO;AAAA,EACP,UAAU,MAAM;AAAA,EAChB,SAAS,EAAE,MAAM,MAAM,KAAK,KAAK;AAAA,EACjC,YAAY,MAAM;AAAA,EAClB,gBAAgB,EAAE,SAAS,EAAE;AAAA,EAC7B,mBAAmB,MAAM;AAC3B,CAAC;",
|
|
6
6
|
"names": ["React"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/InputMask/MaskPipes.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { autoCorrectedDatePipe } from './addons/AutoCorrectedDatePipe.js';\n\nexport const MASK_PIPES = {\n AUTO_CORRECT_DATE: autoCorrectedDatePipe,\n};\n\nexport const maskPipes = [MASK_PIPES.AUTO_CORRECT_DATE];\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,6BAA6B;AAE/B,MAAM,aAAa;AAAA,EACxB,mBAAmB;AACrB;AAEO,MAAM,YAAY,CAAC,WAAW,iBAAiB;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/InputMask/MaskTypes.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-unused-vars */\n\nexport const MASK_TYPES = {\n DATE: 'ds-mask-date',\n DATE_DEPRECATED: [/\\d/, /\\d/, '/', /\\d/, /\\d/, '/', /\\d/, /\\d/, /\\d/, /\\d/],\n DATE_TIME: 'ds-mask-date-time',\n DATE_TIME_DEPRECATED: [\n /\\d/,\n /\\d/,\n '/',\n /\\d/,\n /\\d/,\n '/',\n /\\d/,\n /\\d/,\n /\\d/,\n /\\d/,\n ' ',\n /[0-2]/,\n /[0-9]/,\n ':',\n /[0-5]/,\n /[0-9]/,\n ],\n DICTIONARY: (props) => ({ type: 'ds-mask-dictionary', ...props }),\n PHONE: 'ds-mask-phone',\n PHONE_INTENATIONAL: 'ds-mask-phone-international',\n SSN: 'ds-mask-ssn',\n US_ZIP_CODE: 'ds-mask-us-zip-code',\n ZIP_CODE_SEARCH: 'ds-mask-zip-code-search',\n NUMBER: (props) => (_number) => ({ type: 'ds-mask-number', ...props }),\n PERCENT: (props) => (_number) => ({ type: 'ds-mask-percent', ...props }),\n};\n\nexport const maskTypes = [\n MASK_TYPES.DATE,\n MASK_TYPES.DATE_DEPRECATED,\n MASK_TYPES.DATE_TIME,\n MASK_TYPES.DATE_TIME_DEPRECATED,\n MASK_TYPES.PHONE,\n MASK_TYPES.PHONE_INTENATIONAL,\n MASK_TYPES.SSN,\n MASK_TYPES.US_ZIP_CODE,\n MASK_TYPES.NUMBER,\n MASK_TYPES.PERCENT,\n];\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACEhB,MAAM,aAAa;AAAA,EACxB,MAAM;AAAA,EACN,iBAAiB,CAAC,MAAM,MAAM,KAAK,MAAM,MAAM,KAAK,MAAM,MAAM,MAAM,IAAI;AAAA,EAC1E,WAAW;AAAA,EACX,sBAAsB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,YAAY,CAAC,WAAW,EAAE,MAAM,sBAAsB,GAAG,MAAM;AAAA,EAC/D,OAAO;AAAA,EACP,oBAAoB;AAAA,EACpB,KAAK;AAAA,EACL,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB,QAAQ,CAAC,UAAU,CAAC,aAAa,EAAE,MAAM,kBAAkB,GAAG,MAAM;AAAA,EACpE,SAAS,CAAC,UAAU,CAAC,aAAa,EAAE,MAAM,mBAAmB,GAAG,MAAM;AACxE;AAEO,MAAM,YAAY;AAAA,EACvB,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AACb;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/addons/AutoCorrectedDatePipe.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "const maxValueMonth = [31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst formatOrder = ['yyyy', 'yy', 'mm', 'dd', 'HH', 'MM', 'SS'];\nexport const autoCorrectedDatePipe = (dateFormat = 'mm dd yyyy', { minYear = 1, maxYear = 9999 } = {}) => {\n const dateFormatArray = dateFormat\n .split(/[^dmyHMS]+/)\n .sort((a, b) => formatOrder.indexOf(a) - formatOrder.indexOf(b));\n return (conformedValue) => {\n const indexesOfPipedChars = [];\n const maxValue = {\n dd: 31,\n mm: 12,\n yy: 99,\n yyyy: maxYear,\n HH: 23,\n MM: 59,\n SS: 59,\n };\n const minValue = {\n dd: 1,\n mm: 1,\n yy: 0,\n yyyy: minYear,\n HH: 0,\n MM: 0,\n SS: 0,\n };\n const conformedValueArr = conformedValue.split('');\n\n // Check first digit\n dateFormatArray.forEach((format) => {\n const position = dateFormat.indexOf(format);\n const maxFirstDigit = parseInt(maxValue[format].toString().substr(0, 1), 10);\n\n if (parseInt(conformedValueArr[position], 10) > maxFirstDigit) {\n conformedValueArr[position + 1] = conformedValueArr[position];\n conformedValueArr[position] = 0;\n indexesOfPipedChars.push(position);\n }\n });\n\n // Check for invalid date\n let month = 0;\n const isInvalid = dateFormatArray.some((format) => {\n const position = dateFormat.indexOf(format);\n const { length } = format;\n const textValue = conformedValue.substr(position, length).replace(/\\D/g, '');\n const value = parseInt(textValue, 10);\n if (format === 'mm') {\n month = value || 0;\n }\n const maxValueForFormat = format === 'dd' ? maxValueMonth[month] : maxValue[format];\n if (format === 'yyyy' && (minYear !== 1 || maxYear !== 9999)) {\n const scopedMaxValue = parseInt(maxValue[format].toString().substring(0, textValue.length), 10);\n const scopedMinValue = parseInt(minValue[format].toString().substring(0, textValue.length), 10);\n return value < scopedMinValue || value > scopedMaxValue;\n }\n return value > maxValueForFormat || (textValue.length === length && value < minValue[format]);\n });\n\n return {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;AAGD,QAAI,QAAQ;AACZ,UAAM,YAAY,gBAAgB,KAAK,CAAC,WAAW;AACjD,YAAM,WAAW,WAAW,QAAQ,MAAM;AAC1C,YAAM,EAAE,OAAO,IAAI;AACnB,YAAM,YAAY,eAAe,OAAO,UAAU,MAAM,EAAE,QAAQ,OAAO,EAAE;AAC3E,YAAM,QAAQ,SAAS,WAAW,EAAE;AACpC,UAAI,WAAW,MAAM;AACnB,gBAAQ,SAAS;AAAA,MACnB;AACA,YAAM,oBAAoB,WAAW,OAAO,cAAc,KAAK,IAAI,SAAS,MAAM;AAClF,UAAI,WAAW,WAAW,YAAY,KAAK,YAAY,OAAO;AAC5D,cAAM,iBAAiB,SAAS,SAAS,MAAM,EAAE,SAAS,EAAE,UAAU,GAAG,UAAU,MAAM,GAAG,EAAE;AAC9F,cAAM,iBAAiB,SAAS,SAAS,MAAM,EAAE,SAAS,EAAE,UAAU,GAAG,UAAU,MAAM,GAAG,EAAE;AAC9F,eAAO,QAAQ,kBAAkB,QAAQ;AAAA,MAC3C;AACA,aAAO,QAAQ,qBAAsB,UAAU,WAAW,UAAU,QAAQ,SAAS,MAAM;AAAA,IAC7F,CAAC;AAED,WAAO;AAAA,MACL,OAAO,kBAAkB,KAAK,EAAE;AAAA,MAChC,OAAO,CAAC;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/InputMask/defaultProps.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { MASK_TYPES } from './MaskTypes.js';\n\nexport const defaultProps = {\n autoFocus: false,\n style: {},\n disabled: false,\n className: '',\n name: '',\n maxLength: 255,\n minLength: 0,\n fluidWidth: false,\n onKeyDown: () => null,\n onClick: () => null,\n onChange: () => null,\n onFocus: () => null,\n onBlur: () => null,\n onPaste: () => null,\n onKeyUp: () => null,\n value: '',\n hasError: false,\n readOnly: false,\n innerRef: null,\n type: 'text',\n clearable: false,\n leftComponent: null,\n rightComponent: null,\n mask: MASK_TYPES.DATE,\n pipe: null,\n useSubfix: '',\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,kBAAkB;AAEpB,MAAM,eAAe;AAAA,EAC1B,WAAW;AAAA,EACX,OAAO,CAAC;AAAA,EACR,UAAU;AAAA,EACV,WAAW;AAAA,EACX,MAAM;AAAA,EACN,WAAW;AAAA,EACX,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,WAAW,MAAM;AAAA,EACjB,SAAS,MAAM;AAAA,EACf,UAAU,MAAM;AAAA,EAChB,SAAS,MAAM;AAAA,EACf,QAAQ,MAAM;AAAA,EACd,SAAS,MAAM;AAAA,EACf,SAAS,MAAM;AAAA,EACf,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,MAAM;AAAA,EACN,WAAW;AAAA,EACX,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,MAAM,WAAW;AAAA,EACjB,MAAM;AAAA,EACN,WAAW;AACb;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/InputMask/index.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSInputMask.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/mask_types/DateInputMask.tsx"],
|
|
4
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-props-helpers';\nimport { DSTextBox } from '../../TextBox/index.js';\nimport type { TCharsToAdd } from '../types/index.js';\nimport { setCaretPosition } from '../utils/setCaretPosition.js';\n\nconst conformValue = (rawValue: string, cursorPos: number, lastkeycode: number) => {\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(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 { DateInputMask };\nexport default DateInputMask;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACgJnB;AA9IJ,SAAgB,aAAa,iBAAiB,QAAQ,gBAAgB;AAEtE,SAAS,iBAAiB;AAE1B,SAAS,wBAAwB;AAEjC,MAAM,eAAe,CAAC,UAAkB,WAAmB,gBAAwB;AACjF,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;AACrC,QAAI,gBAAgB,SAAS,MAAM,SAAS,CAAC;AAAG,mBAAa;AAAA,EAC/D;AAGA,QAAM,kBAA+B;AAAA,IACnC,CAAC,KAAK,CAAC;AAAA,IACP,CAAC,KAAK,CAAC;AAAA,EACT;AAEA,kBAAgB,QAAQ,CAAC,CAAC,OAAO,GAAG,MAAM;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,GAAG,MAAM;AACxC,UAAI,cAAc;AAAK,qBAAa,MAAM;AAAA,IAC5C,CAAC;AAAA,EACH,WAAW,gBAAgB,KAAK,WAAW;AACzC,oBAAgB,QAAQ,CAAC,CAAC,OAAO,GAAG,MAAM;AACxC,UAAI,cAAc,MAAM;AAAG,qBAAa,MAAM;AAAA,IAChD,CAAC;AAAA,EACH;AAEA,SAAO,EAAE,iBAAiB,gBAAgB,KAAK,EAAE,GAAG,UAAU;AAChE;AAEA,MAAM,gBAAgB,CAAC;AAAA,EACrB;AAAA,E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,CAAC;AAE1B,kBAAgB,MAAM;AAEpB,YAAQ;AAAA,MACN,UAAU;AAAA,MACV,WAAW,eAAe;AAAA,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,wBAAQ;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/mask_types/DateTimeInputMask.tsx"],
|
|
4
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-props-helpers';\nimport { DSTextBox } from '../../TextBox/index.js';\nimport type { TCharsToAdd } from '../types/index.js';\nimport { setCaretPosition } from '../utils/setCaretPosition.js';\n\nconst conformValue = (rawValue: string, cursorPos: number, lastkeycode: number) => {\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]/)) nextMaskedValue.splice(8, 1);\n while (nextMaskedValue.length > 10 && !nextMaskedValue[10].match(/[0-5]/)) 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(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 { DateTimeInputMask };\nexport default DateTimeInputMask;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACsJnB;AAnJJ,SAAgB,aAAa,iBAAiB,QAAQ,gBAAgB;AAEtE,SAAS,iBAAiB;AAE1B,SAAS,wBAAwB;AAEjC,MAAM,eAAe,CAAC,UAAkB,WAAmB,gBAAwB;AACjF,QAAM,kBAAkB,SACrB,MAAM,EAAE,EACR,OAAO,CAAC,SAAS,QAAQ,OAAO,QAAQ,GAAG,EAC3C,MAAM,GAAG,EAAE;AAEd,SAAO,gBAAgB,SAAS,KAAK,CAAC,gBAAgB,CAAC,EAAE,MAAM,OAAO;AAAG,oBAAgB,OAAO,GAAG,CAAC;AACpG,SAAO,gBAAgB,SAAS,MAAM,CAAC,gBAAgB,EAAE,EAAE,MAAM,OAAO;AAAG,oBAAgB,OAAO,IAAI,CAAC;AAEvG,MAAI,YAAY;AAChB,WAAS,IAAI,GAAG,IAAI,WAAW,KAAK,GAAG;AACrC,QAAI,gBAAgB,SAAS,MAAM,SAAS,CAAC;AAAG,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,GAAG,MAAM;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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,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO;AAAA;AAAA,EACT;AAEJ;AAGA,IAAO,4BAAQ;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/mask_types/DictionaryInputMask.tsx"],
|
|
4
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-props-helpers';\nimport { DSTextBox } from '../../TextBox/index.js';\nimport { setCaretPosition } from '../utils/setCaretPosition.js';\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(rawValue, cursorPos, lastkeycode, allowedWords, ignoreCase);\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 { DictionaryInputMask };\nexport default DictionaryInputMask;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;AC6InB;AAzIJ,SAAgB,aAAa,iBAAiB,QAAQ,gBAAgB;AAEtE,SAAS,iBAAiB;AAC1B,SAAS,wBAAwB;AAEjC,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;AAAA,MAAO,CAAC,SAChD,WAAW,MAAM,kBAAkB,SAAS,CAAC,GAAG,UAAU;AAAA,IAC5D;AACA,QAAI,cAAc,QAAQ;AACxB,yBAAmB,SAAS,CAAC;AAC7B,4BAAsB;AAAA,IACxB;AAAA,EACF;AAEA,SAAO,EAAE,iBAAiB,WAAW,UAAU;AACjD;AAEA,MAAM,sBAAsB,CAAC;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAC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,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,8BAAQ;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/mask_types/NumberInputMask.tsx"],
|
|
4
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-props-helpers';\nimport { DSTextBox } from '../../TextBox/index.js';\nimport { setCaretPosition } from '../utils/setCaretPosition.js';\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\nexport { NumberInputMask };\nexport default NumberInputMask;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACgQnB;AA3PJ,SAAgB,aAAa,iBAAiB,QAAQ,gBAAgB;AAEtE,SAAS,iBAAiB;AAC1B,SAAS,wBAAwB;AAGjC,MAAM,wBAAwB,CAAC,GAAG,6BAChC,EAAE,QAAQ,yBAAyB,wBAAwB;AAE7D,MAAM,eAAe,CACnB,cACA,eACA,aACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MACG;AACH,QAAM,cAAc,aAAa,QAAQ,MAAM;AAC/C,QAAM,cAAc,aAAa,YAAY,MAAM;AACnD,QAAM,gBAAgB,aAAa,QAAQ,GAAG;AAE9C,QAAM,YAAY,iBAAiB,gBAAgB,KAAK,IAAI,cAAc,OAAO;AAEjF,QAAM,WAAW,aAAa;AAAA,IAC5B,gBAAgB,KAAK,IAAI,cAAc,OAAO;AAAA,IAC9C,gBAAgB,KAAK,aAAa,SAAS;AAAA,EAC7C;AAEA,QAAM,mBAAmB,SACtB,MAAM,EAAE,EACR,OAAO,CAAC,SAAU,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K,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;AACR,UAAI,kBAAkB,gBAAgB,IAAI;AACxC,gBAAQ;AAAA,UACN,UAAU;AAAA,UACV,WAAW;AAAA,UACX,SAAS;AAAA,UACT,uBAAuB;AAAA,UACvB,wBAAwB;AAAA,QAC1B,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA,CAAC,aAAa,gBAAgB,QAAQ,cAAc,MAAM;AAAA,EAC5D;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,0BAAQ;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/mask_types/PhoneInputMask.tsx"],
|
|
4
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-props-helpers';\nimport { DSTextBox } from '../../TextBox/index.js';\nimport type { TCharsToAdd } from '../types/index.js';\nimport { setCaretPosition } from '../utils/setCaretPosition.js';\n\nconst conformValue = (rawValue, cursorPos, lastkeycode) => {\n let nextMaskedValue = String(rawValue)\n .split('')\n .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 };\nex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AO,uBAAiB,SAAS,SAAS,eAAe,OAAO;AAAA,EACtE,GAAG,CAAC,OAAO,cAAc,CAAC;AAE1B,kBAAgB,MAAM;AAEpB,YAAQ;AAAA,MACN,UAAU;AAAA,MACV,WAAW,eAAe;AAAA,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;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/mask_types/PhoneInternationalInputMask.tsx"],
|
|
4
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-props-helpers';\nimport { DSTextBox } from '../../TextBox/index.js';\nimport type { TCharsToAdd } from '../types/index.js';\nimport { setCaretPosition } from '../utils/setCaretPosition.js';\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') 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 ['+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(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 { PhoneInternationalInputMask };\nexport default PhoneInternationalInputMask;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACqJnB;AAnJJ,SAAgB,aAAa,iBAAiB,QAAQ,gBAAgB;AAEtE,SAAS,iBAAiB;AAE1B,SAAS,wBAAwB;AAEjC,MAAM,eAAe,CAAC,UAAU,WAAW,gBAAgB;AACzD,MAAI,kBAAkB,SACnB,MAAM,IAAI,EACV,MAAM,EAAE,EAAE,CAAC,EACX,MAAM,EAAE,EACR,OAAO,CAAC,SAAS,QAAQ,OAAO,QAAQ,GAAG;AAE9C,SAAO,gBAAgB,UAAU,gBAAgB,CAAC,MAAM;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,SAAS,MAAM,SAAS,CAAC;AAAG,mBAAa;AAAA,EAC/D;AAGA,QAAM,kBAA+B;AAAA,IACnC,CAAC,QAAQ,CAAC;AAAA,IACV,CAAC,MAAM,CAAC;AAAA,IACR,CAAC,KAAK,EAAE;AAAA,EACV;AAEA,kBAAgB,QAAQ,CAAC,CAAC,OAAO,GAAG,MAAM;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,GAAG,MAAM;AACxC,UAAI,cAAc;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A,MACA,OAAO;AAAA;AAAA,EACT;AAEJ;AAGA,IAAO,sCAAQ;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/mask_types/SsnInputMask.tsx"],
|
|
4
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-props-helpers';\nimport { DSTextBox } from '../../TextBox/index.js';\nimport type { TCharsToAdd } from '../types/index.js';\nimport { setCaretPosition } from '../utils/setCaretPosition.js';\n\nconst conformValue = (rawValue, cursorPos, lastkeycode) => {\n const nextMaskedValue = rawValue\n .split('')\n .filter((char) => char >= '0' && char <= '9')\n .slice(0, 9);\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 ['-', 3],\n ['-', 6],\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 SsnInputMask = ({\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 { SsnInputMask };\nexport default SsnInputMask;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;AC+InB;AA7IJ,SAAgB,aAAa,iBAAiB,QAAQ,gBAAgB;AAEtE,SAAS,iBAAiB;AAE1B,SAAS,wBAAwB;AAEjC,MAAM,eAAe,CAAC,UAAU,WAAW,gBAAgB;AACzD,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;AACrC,QAAI,gBAAgB,SAAS,MAAM,SAAS,CAAC;AAAG,mBAAa;AAAA,EAC/D;AAGA,QAAM,kBAA+B;AAAA,IACnC,CAAC,KAAK,CAAC;AAAA,IACP,CAAC,KAAK,CAAC;AAAA,EACT;AAEA,kBAAgB,QAAQ,CAAC,CAAC,OAAO,GAAG,MAAM;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,GAAG,MAAM;AACxC,UAAI,cAAc;AAAK,qBAAa,MAAM;AAAA,IAC5C,CAAC;AAAA,EACH,WAAW,gBAAgB,KAAK,WAAW;AACzC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@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/mask_types/UsZipCodeInputMask.tsx"],
|
|
4
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-props-helpers';\nimport { DSTextBox } from '../../TextBox/index.js';\nimport { setCaretPosition } from '../utils/setCaretPosition.js';\n\nconst conformValue = (rawValue: string, cursorPos: number) => {\n const nextMaskedValue = rawValue\n .split('')\n .filter((char) => char >= '0' && char <= '9')\n .slice(0, 5);\n\n let maskedPos = 0;\n for (let i = 0; i < cursorPos; i += 1) {\n if (nextMaskedValue[maskedPos] === rawValue[i]) maskedPos += 1;\n }\n return { nextMaskedValue: nextMaskedValue.join(''), maskedPos };\n};\n\nconst UsZipCodeInputMask = ({\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);\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 { UsZipCodeInputMask };\nexport default UsZipCodeInputMask;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACuHnB;AArHJ,SAAgB,aAAa,iBAAiB,QAAQ,gBAAgB;AAEtE,SAAS,iBAAiB;AAC1B,SAAS,wBAAwB;AAEjC,MAAM,eAAe,CAAC,UAAkB,cAAsB;AAC5D,QA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;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO;AAAA;AAAA,EACT;AAEJ;AAGA,IAAO,6BAAQ;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/mask_types/ZipCodeSearchInputMask.tsx"],
|
|
4
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-props-helpers';\nimport { DSTextBox } from '../../TextBox/index.js';\nimport type { TCharsToAdd } from '../types/index.js';\nimport { setCaretPosition } from '../utils/setCaretPosition.js';\n\nconst conformValue = (rawValue, cursorPos, lastkeycode) => {\n const nextMaskedValue = rawValue\n .split('')\n .filter((char) => char >= '0' && char <= '9')\n .slice(0, 9);\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 = [['-', 5]];\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 ZipCodeSearchInputMask = ({\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 && typeof innerRef === 'function') 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 { ZipCodeSearchInputMask };\nexport default ZipCodeSearchInputMask;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;AC4InB;AA1IJ,SAAgB,aAAa,iBAAiB,QAAQ,gBAAgB;AAEtE,SAAS,iBAAiB;AAE1B,SAAS,wBAAwB;AAEjC,MAAM,eAAe,CAAC,UAAU,WAAW,gBAAgB;AACzD,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;AACrC,QAAI,gBAAgB,SAAS,MAAM,SAAS,CAAC;AAAG,mBAAa;AAAA,EAC/D;AAGA,QAAM,kBAA+B,CAAC,CAAC,KAAK,CAAC,CAAC;AAE9C,kBAAgB,QAAQ,CAAC,CAAC,OAAO,GAAG,MAAM;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,GAAG,MAAM;AACxC,UAAI,cAAc;AAAK,qBAAa,MAAM;AAAA,IAC5C,CAAC;AAAA,EACH,WAAW,gBAAgB,K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AO,iCAAQ;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/mask_types/index.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { DateInputMask } from './DateInputMask.js';\nimport { DateTimeInputMask } from './DateTimeInputMask.js';\nimport { DictionaryInputMask } from './DictionaryInputMask.js';\nimport { NumberInputMask } from './NumberInputMask.js';\nimport { PhoneInputMask } from './PhoneInputMask.js';\nimport { PhoneInternationalInputMask } from './PhoneInternationalInputMask.js';\nimport { SsnInputMask } from './SsnInputMask.js';\nimport { UsZipCodeInputMask } from './UsZipCodeInputMask.js';\nimport { ZipCodeSearchInputMask } from './ZipCodeSearchInputMask.js';\n\nconst dollarSign = '$';\nconst percentSign = '%';\nconst emptyString = '';\nconst comma = ',';\nconst period = '.';\n\nexport const OutOfTheBoxMaskTypes = {\n 'ds-mask-date': (props) => <DateInputMask {...props} />,\n 'ds-mask-date-time': (props) => <DateTimeInputMask {...props} />,\n 'ds-mask-dictionary': ({ ignoreCase = true, ...rest }) => <DictionaryInputMask ignoreCase={ignoreCase} {...rest} />,\n 'ds-mask-number': ({\n prefix = dollarSign,\n suffix = emptyString,\n includeThousandsSeparator = true,\n thousandsSeparatorSymbol = comma,\n allowDecimal = false,\n decimalSymbol = period,\n decimalLimit = 2,\n requireDecimal = false,\n allowNegative = false,\n allowLeadingZeroes = false,\n integerLimit = null,\n ...rest\n }) => (\n <NumberInputMask\n prefix={prefix}\n suffix={suffix}\n includeThousandsSeparator={includeThousandsSeparator}\n thousandsSeparatorSymbol={thousandsSeparatorSymbol}\n allowDecimal={allowDecimal}\n decimalSymbol={decimalSymbol}\n decimalLimit={decimalLimit}\n requireDecimal={requireDecimal}\n allowNegative={allowNegative}\n allowLeadingZeroes={allowLeadingZeroes}\n integerLimit={integerLimit}\n {...rest}\n />\n ),\n 'ds-mask-percent': ({\n prefix = emptyString,\n suffix = percentSign,\n includeThousandsSeparator = true,\n thousandsSeparatorSymbol = comma,\n allowDecimal = false,\n decimalSymbol = period,\n decimalLimit = 2,\n requireDecimal = false,\n allowNegative = false,\n allowLeadingZeroes = false,\n integerLimit = null,\n ...rest\n }) => (\n <NumberInputMask\n prefix={prefix}\n suffix={suffix}\n includeThousandsSeparator={includeThousandsSeparator}\n thousandsSeparatorSymbol={thousandsSeparatorSymbol}\n allowDecimal={allowDecimal}\n decimalSymbol={decimalSymbol}\n decimalLimit={decimalLimit}\n requireDecimal={requireDecimal}\n allowNegative={allowNegative}\n allowLeadingZeroes={allowLeadingZeroes}\n integerLimit={integerLimit}\n {...rest}\n />\n ),\n 'ds-mask-phone': (props) => <PhoneInputMask {...props} />,\n 'ds-mask-phone-international': (props) => <PhoneInternationalInputMask {...props} />,\n 'ds-mask-ssn': (props) => <SsnInputMask {...props} />,\n 'ds-mask-us-zip-code': (props) => <UsZipCodeInputMask {...props} />,\n 'ds-mask-zip-code-search': (props) => <ZipCodeSearchInputMask {...props} />,\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACkBM;AAjB7B,SAAS,qBAAqB;AAC9B,SAAS,yBAAyB;AAClC,SAAS,2BAA2B;AACpC,SAAS,uBAAuB;AAChC,SAAS,sBAAsB;AAC/B,SAAS,mCAAmC;AAC5C,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AACnC,SAAS,8BAA8B;AAEvC,MAAM,aAAa;AACnB,MAAM,cAAc;AACpB,MAAM,cAAc;AACpB,MAAM,QAAQ;AACd,MAAM,SAAS;AAER,MAAM,uBAAuB;AAAA,EAClC,gBAAgB,CAAC,UAAU,oBAAC,iBAAe,GAAG,OAAO;AAAA,EACrD,qBAAqB,CAAC,UAAU,oBAAC,qBAAmB,GAAG,OAAO;AAAA,EAC9D,sBAAsB,CAAC,EAAE,aAAa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OAAO;AAC3E;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/InputMask/props.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from '@elliemae/ds-props-helpers';\n\nexport const inputProps = {\n /** Should component focus automatically */\n autoFocus: PropTypes.bool.description('Should component focus automatically'),\n /**\n * Set style for the input mask\n */\n style: PropTypes.object.description('Set style for the input mask'),\n /**\n * Whether the input mask is disabled or not\n */\n disabled: PropTypes.bool.description('Whether the input mask is disabled or not'),\n /** disableTooltip */\n disableTooltip: PropTypes.bool\n .description('Whether to show a tooltip or not when text does not fit')\n .defaultValue(true),\n /** css class */\n className: PropTypes.string.description('css class'),\n /** html name prop for form */\n name: PropTypes.string.description('html name prop for form'),\n /**\n * Max length for the input mask\n */\n maxLength: PropTypes.number.description('Max length for the input mask'),\n /**\n * Min length for the input mask\n */\n minLength: PropTypes.number.description('Min length for the input mask'),\n /**\n * Whether to make the content of the input mask fit the container or not\n */\n fluidWidth: PropTypes.bool.description('Whether to make the content of the input mask fit the container or not'),\n /** isShowElipsisActive */\n isShowElipsisActive: PropTypes.bool\n .description('Wheter to enable the ellipsis and tooltip functionality or not')\n .defaultValue(true),\n /**\n * Component that works as placeholder\n */\n placeholder: PropTypes.node.description('Component that works as placeholder'),\n /**\n * Allows a function that is triggered once a key is being pressed\n */\n onKeyDown: PropTypes.func.description('Allows a function that is triggered once a key is being pressed'),\n /**\n * Allows a function that is triggered once the input mask is clicked\n */\n onClick: PropTypes.func.description('Allows a function that is triggered once the input mask is clicked'),\n /**\n * Allows a function that is triggered once the input mask changes\n */\n onChange: PropTypes.func.description('Allows a function that is triggered once the input mask changes'),\n /**\n * Allows a function that is triggered once the input mask is focused\n */\n onFocus: PropTypes.func.description('Allows a function that is triggered once the input mask is focused'),\n /**\n * Allows a function that is triggered once the input mask loses focus\n */\n onBlur: PropTypes.func.description('Allows a function that is triggered once the input mask loses focus'),\n /**\n * Allows a function that is triggered once the input mask is pasted\n */\n onPaste: PropTypes.func.description('Allows a function that is triggered once the input mask is pasted'),\n /**\n * Allows a function that is triggered once in the input mask a keyboard key is released\n */\n onKeyUp: PropTypes.func.description(\n 'Allows a function that is triggered once in the input mask a keyboard key is released',\n ),\n /**\n * Default value once the component is initialized\n */\n value: PropTypes.string.description('Default value once the component is initialized'),\n /**\n * Whether the input mask has error or not\n */\n hasError: PropTypes.bool.description('Whether the input mask has error or not'),\n /**\n * Whether the input mask is read only or not\n */\n readOnly: PropTypes.bool.description('Whether the input mask is read only or not'),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]).description(\n 'Whether the input mask is read only or not',\n ),\n /**\n * Type of input. Ex: 'text'\n */\n type: PropTypes.string.description(\"Type of input. Ex: 'text'\"),\n /**\n * Whether the input mask is clearable or not\n */\n clearable: PropTypes.bool.description('Whether the input mask is clearable or not'),\n /**\n * Component to be added at the right side of the input\n */\n leftComponent: PropTypes.node.description('Component to be added at the right side of the input'),\n /**\n * Component to be added at the right side of the input\n */\n rightComponent: PropTypes.node.description('Component to be added at the right side of the input'),\n /**\n * Mask that has to match with the input information entered\n * ['DATE', 'PHONE', 'PHONE_INTENATIONAL', 'SSN', 'US_ZIP_CODE', 'NUMBER', 'PERCENT']\n */\n mask: PropTypes.oneOfType([PropTypes.array, PropTypes.string, PropTypes.func, PropTypes.object]).description(\n \"Mask that has to match with the input information entered. ['DATE', 'PHONE', 'PHONE_INTENATIONAL', 'SSN', 'US_ZIP_CODE', 'NUMBER', 'PERCENT', 'ZIP_CODE_SEARCH']\",\n ),\n /**\n Expects pipe functions. i.e. autoCorrectedDatePipe\n link a docu de text-mask\n */\n pipe: PropTypes.func.description('Expects pipe functions. i.e. autoCorrectedDatePipe'),\n /**\n * Put a sufix after the input mask\n */\n useSubfix: PropTypes.string.description('Put a sufix after the input mask'),\n /**\n * The placeholder character represents the fillable spot in the mask.\n * The default placeholder character is underscore, _\n */\n placeholderChar: PropTypes.string\n .description(\n `The placeholder character represents the fillable spot in the mask.\n The default placeholder character is underscore, _.`,\n )\n .defaultValue('_'),\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAEnB,MAAM,aAAa;AAAA;AAAA,EAExB,WAAW,UAAU,KAAK,YAAY,sCAAsC;AAAA;AAAA;AAAA;AAAA,EAI5E,OAAO,UAAU,OAAO,YAAY,8BAA8B;AAAA;AAAA;AAAA;AAAA,EAIlE,UAAU,UAAU,KAAK,YAAY,2CAA2C;AAAA;AAAA,EAEhF,gBAAgB,UAAU,KACvB,YAAY,yDAAyD,EACrE,aAAa,IAAI;AAAA;AAAA,EAEpB,WAAW,UAAU,OAAO,YAAY,WAAW;AAAA;AAAA,EAEnD,MAAM,UAAU,OAAO,YAAY,yBAAyB;AAAA;AAAA;AAAA;AAAA,EAI5D,WAAW,UAAU,OAAO,YAAY,+BAA+B;AAAA;AAAA;AAAA;AAAA,EAIvE,WAAW,UAAU,OAAO,YAAY,+BAA+B;AAAA;AAAA;AAAA;AAAA,EAIvE,YAAY,UAAU,KAAK,YAAY,wEAAwE;AAAA;AAAA,EAE/G,qBAAqB,UAAU,KAC5B,YAAY,gEAAgE,EAC5E,aAAa,IAAI;AAAA;AAAA;AAAA;AAAA,EAIpB,aAAa,UAAU,KAAK,YAAY,qCAAqC;AAAA;AAAA;AAAA;AAAA,EAI7E,WAAW,UAAU,KAAK,YAAY,iEAAiE;AAAA;AAAA;AAAA;AAAA,EAIvG,SAAS,UAAU,KAAK,YAAY,oEAAoE;AAAA;AAAA;AAAA;AAAA,EAIxG,UAAU,UAAU,KAAK,YAAY,iEAAiE;AAAA;AAAA;AAAA;AAAA,EAItG,SAAS,UAAU,KAAK,YAAY,oEAAoE;AAAA;AAAA;AAAA;AAAA,EAI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-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/utils/setCaretPosition.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "const setCaretPosition = (ctrl, pos) => {\n // Modern browsers\n if (ctrl?.setSelectionRange) {\n ctrl?.focus();\n ctrl?.setSelectionRange(pos, pos);\n\n // IE8 and below\n } else if (ctrl?.createTextRange) {\n const range = ctrl?.createTextRange();\n range?.collapse(true);\n range?.moveEnd('character', pos);\n range?.moveStart('character', pos);\n range?.select();\n }\n};\n\nexport { setCaretPosition };\nexport default setCaretPosition;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,MAAM,mBAAmB,CAAC,MAAM,QAAQ;AAEtC,MAAI,MAAM,mBAAmB;AAC3B,UAAM,MAAM;AACZ,UAAM,kBAAkB,KAAK,GAAG;AAAA,EAGlC,WAAW,MAAM,iBAAiB;AAChC,UAAM,QAAQ,MAAM,gBAAgB;AACpC,WAAO,SAAS,IAAI;AACpB,WAAO,QAAQ,aAAa,GAAG;AAC/B,WAAO,UAAU,aAAa,GAAG;AACjC,WAAO,OAAO;AAAA,EAChB;AACF;AAGA,IAAO,2BAAQ;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/InputProtected/DSInputProtected.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable import/no-unresolved */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useState, useCallback, useEffect } from 'react';\nimport { useDeprecateComponent } from '@elliemae/ds-utilities';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { LockUnlocked, LockLocked, VisibleView, InvisibleHide } from '@elliemae/ds-icons';\nimport { DSButton } from '@elliemae/ds-button';\nimport { DSInputGroup } from '../InputGroup/index.js';\nimport { DSInputMask } from '../InputMask/index.js';\nimport { inputProtectedProps } from './props.js';\nimport { defaultProps } from './defaultProps.js';\nimport { LEFT_ADDON_OPTIONS, RIGHT_ADDON_OPTIONS } from './options.js';\n\nconst ADDON_ICON_OPTIONS = {\n LockUnlocked: <LockUnlocked />,\n LockLocked: <LockLocked />,\n VisibleView: <VisibleView />,\n InvisibleHide: <InvisibleHide />,\n};\n\nconst DSInputProtected = ({\n leftAddon,\n rightAddon,\n onChange,\n value,\n readOnly,\n mask,\n type,\n placeholderChar = undefined,\n ...rest\n}) => {\n useDeprecateComponent({ componentName: 'ds-form/InputProtected', version: 'TBD Date: 2023 Q3' });\n\n const left = leftAddon && ADDON_ICON_OPTIONS[leftAddon];\n const right = rightAddon && ADDON_ICON_OPTIONS[rightAddon];\n const [inputLocked, setLocked] = useState(leftAddon === LEFT_ADDON_OPTIONS.LockLocked);\n const [inputHidden, setHidden] = useState(rightAddon === RIGHT_ADDON_OPTIONS.InvisibleHide);\n\n useEffect(() => {\n setLocked(leftAddon === LEFT_ADDON_OPTIONS.LockLocked);\n setHidden(rightAddon === RIGHT_ADDON_OPTIONS.InvisibleHide);\n }, [leftAddon, rightAddon]);\n\n const handleLeft = useCallback(() => {\n setLocked(!inputLocked);\n }, [inputLocked]);\n const handleRight = useCallback(() => {\n setHidden(!inputHidden);\n }, [inputHidden]);\n\n return (\n <div>\n <DSInputGroup\n leftAddon={\n left ? (\n <DSButton\n aria-label={`${inputLocked ? 'Allow' : 'Disallow'} Edition`}\n buttonType=\"secondary\"\n icon={ADDON_ICON_OPTIONS[inputLocked ? LEFT_ADDON_OPTIONS.LockLocked : LEFT_ADDON_OPTIONS.LockUnlocked]}\n onClick={handleLeft}\n />\n ) : undefined\n }\n rightAddon={\n right ? (\n <DSButton\n aria-label={`${inputHidden ? 'Show' : 'Hide'} Characters`}\n buttonType=\"secondary\"\n icon={\n ADDON_ICON_OPTIONS[inputHidden ? RIGHT_ADDON_OPTIONS.InvisibleHide : RIGHT_ADDON_OPTIONS.VisibleView]\n }\n onClick={handleRight}\n containerProps={{\n 'data-testid': 'inputprotected-show-hide-button',\n }}\n />\n ) : undefined\n }\n >\n <DSInputMask\n {...rest}\n mask={mask}\n placeholderChar={placeholderChar}\n onChange={onChange}\n disabled={left ? inputLocked : readOnly}\n type={right && inputHidden ? 'password' : type}\n value={value}\n />\n </DSInputGroup>\n </div>\n );\n};\n\nDSInputProtected.propTypes = inputProtectedProps;\nDSInputProtected.defaultProps = defaultProps;\nDSInputProtected.displayName = 'DSInputProtected';\nconst DSInputProtectedWithSchema = describe(DSInputProtected);\nDSInputProtectedWithSchema.propTypes = inputProtectedProps;\n\nexport { DSInputProtectedWithSchema, DSInputProtected };\nexport default DSInputProtected;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACeP;AAZhB,SAAgB,UAAU,aAAa,iBAAiB;AACxD,SAAS,6BAA6B;AACtC,SAAS,gBAAgB;AACzB,SAAS,cAAc,YAAY,aAAa,qBAAqB;AACrE,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAC5B,SAAS,2BAA2B;AACpC,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB,2BAA2B;AAExD,MAAM,qBAAqB;AAAA,EACzB,cAAc,oBAAC,gBAAa;AAAA,EAC5B,YAAY,oBAAC,cAAW;AAAA,EACxB,aAAa,oBAAC,eAAY;AAAA,EAC1B,eAAe,oBAAC,iBAAc;AAChC;AAEA,MAAM,mBAAmB,CAAC;AAAA,EACxB;AAAA,EAC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AA,UACA,UAAU,OAAO,cAAc;AAAA,UAC/B,MAAM,SAAS,cAAc,aAAa;AAAA,UAC1C;AAAA;AAAA,MACF;AAAA;AAAA,EACF,GACF;AAEJ;AAEA,iBAAiB,YAAY;AAC7B,iBAAiB,eAAe;AAChC,iBAAiB,cAAc;AAC/B,MAAM,6BAA6B,SAAS,gBAAgB;AAC5D,2BAA2B,YAAY;AAGvC,IAAO,2BAAQ;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/InputProtected/defaultProps.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { RIGHT_ADDON_OPTIONS } from './options.js';\n\nexport const defaultProps = {\n rightAddon: RIGHT_ADDON_OPTIONS.InvisibleHide,\n mask: (data) => new Array(data.length).fill(/./),\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,2BAA2B;AAE7B,MAAM,eAAe;AAAA,EAC1B,YAAY,oBAAoB;AAAA,EAChC,MAAM,CAAC,SAAS,IAAI,MAAM,KAAK,MAAM,EAAE,KAAK,GAAG;AACjD;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/InputProtected/index.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSInputProtected.js';\nexport * from './options.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/InputProtected/options.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const LEFT_ADDON_OPTIONS = {\n LockUnlocked: 'LockUnlocked',\n LockLocked: 'LockLocked',\n};\n\nexport const RIGHT_ADDON_OPTIONS = {\n VisibleView: 'VisibleView',\n InvisibleHide: 'InvisibleHide',\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,qBAAqB;AAAA,EAChC,cAAc;AAAA,EACd,YAAY;AACd;AAEO,MAAM,sBAAsB;AAAA,EACjC,aAAa;AAAA,EACb,eAAe;AACjB;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/InputProtected/props.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from '@elliemae/ds-props-helpers';\nimport { LEFT_ADDON_OPTIONS, RIGHT_ADDON_OPTIONS } from './options.js';\n\nexport const inputProtectedProps = {\n leftAddon: PropTypes.oneOf([LEFT_ADDON_OPTIONS.LockLocked, LEFT_ADDON_OPTIONS.LockUnlocked]).description(\n 'left addon component to display',\n ),\n rightAddon: PropTypes.oneOf([RIGHT_ADDON_OPTIONS.VisibleView, RIGHT_ADDON_OPTIONS.InvisibleHide])\n .description('right addon component to display')\n .defaultValue(RIGHT_ADDON_OPTIONS.InvisibleHide),\n onChange: PropTypes.func.description('Function executed when input s value changes'),\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('input s value'),\n readOnly: PropTypes.bool.description('Whether the input is read-only or not').defaultValue(false),\n mask: PropTypes.oneOfType([PropTypes.array, PropTypes.func, PropTypes.object, PropTypes.string]).description(\n 'mask to apply',\n ),\n type: PropTypes.oneOf(['password', 'number', 'text']).description('type of input'),\n /**\n * PlaceholderChar: The placeholder character represents the fillable spot in the mask.\n * The default placeholder character is underscore, _.\n */\n placeholderChar: PropTypes.string.description(\n `The placeholder character represents the fillable spot in the mask.\n * The default placeholder character is underscore, _.`,\n ),\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAC1B,SAAS,oBAAoB,2BAA2B;AAEjD,MAAM,sBAAsB;AAAA,EACjC,WAAW,UAAU,MAAM,CAAC,mBAAmB,YAAY,mBAAmB,YAAY,CAAC,EAAE;AAAA,IAC3F;AAAA,EACF;AAAA,EACA,YAAY,UAAU,MAAM,CAAC,oBAAoB,aAAa,oBAAoB,aAAa,CAAC,EAC7F,YAAY,kCAAkC,EAC9C,aAAa,oBAAoB,aAAa;AAAA,EACjD,UAAU,UAAU,KAAK,YAAY,8CAA8C;AAAA,EACnF,OAAO,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE,YAAY,eAAe;AAAA,EAC5F,UAAU,UAAU,KAAK,YAAY,uCAAuC,EAAE,aAAa,KAAK;AAAA,EAChG,MAAM,UAAU,UAAU,CAAC,UAAU,OAAO,UAAU,MAAM,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE;AAAA,IAC/F;AAAA,EACF;AAAA,EACA,MAAM,UAAU,MAAM,CAAC,YAAY,UAAU,MAAM,CAAC,EAAE,YAAY,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA,EAKjF,iBAAiB,UAAU,OAAO;AAAA,IAChC;AAAA;AAAA,EAEF;AACF;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/LargeInputText/DSLargeInputText.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable jsx-a11y/no-autofocus, react/prop-types */\nimport React, { useMemo } from 'react';\nimport { useDeprecateComponent } from '@elliemae/ds-utilities';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { convertPropToCssClassName, aggregatedClasses } from '@elliemae/ds-classnames';\nimport { props } from './props.js';\nimport { defaultProps } from './defaultProps.js';\n\nconst CounterArea = aggregatedClasses('div')('counter', 'textarea', ({ limitError }) => ({\n 'limit-error': limitError,\n}));\n\nconst DSLargeInputText = ({\n containerProps,\n autoFocus,\n className,\n disabled,\n name,\n id,\n maxLength,\n minLength,\n placeholder,\n onClick,\n onChange,\n onFocus,\n onBlur,\n onKeyUp,\n onKeyDown,\n onPaste,\n value,\n hasError,\n required,\n readOnly,\n resize,\n innerRef,\n ariaLabel,\n ariaAutocomplete,\n role,\n characterLimitCounter,\n rows,\n errorLimit,\n tabIndex,\n}) => {\n useDeprecateComponent({ componentName: 'ds-form/LargeInputText', version: 'TBD Date: 2023 Q3' });\n\n const limitError = useMemo(\n () => characterLimitCounter < String(value).length && characterLimitCounter > 0,\n [characterLimitCounter, value],\n );\n const { cssClassName, classNameElement, classNameBlock } = convertPropToCssClassName(\n 'form-element-textarea',\n 'text',\n {\n hasError: limitError || hasError,\n readOnly,\n disabled,\n },\n );\n // auto size when user types\n const handleKeyUp = (e) => {\n // const { target } = e\n onKeyUp(e);\n // if (e.key !== 'Enter') return\n // target.style.cssText = 'height:auto; padding:0'\n // target.style.cssText = `height: ${target.scrollHeight}px`\n };\n return (\n <>\n <div {...containerProps} className={`${cssClassName} ${className}`}>\n <div className={classNameBlock('wrapper')}>\n <textarea\n ref={innerRef}\n aria-autocomplete={ariaAutocomplete}\n aria-label={ariaLabel}\n aria-multiline\n aria-placeholder={placeholder}\n aria-required={required}\n autoFocus={autoFocus}\n className={classNameElement('textarea')}\n data-testid=\"ds-large-input_main-component\"\n disabled={disabled}\n id={id}\n maxLength={maxLength}\n minLength={minLength}\n name={name}\n onBlur={onBlur}\n onChange={onChange}\n onClick={onClick}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n onKeyUp={handleKeyUp}\n onPaste={onPaste}\n placeholder={placeholder}\n role={role}\n rows={String(rows)}\n style={{\n resize,\n }}\n value={value}\n tabIndex={tabIndex}\n />\n </div>\n </div>\n {characterLimitCounter > 0 && (\n <CounterArea classProps={{ limitError }} data-testid=\"counter-area\">\n {`${limitError ? `${errorLimit} ${characterLimitCounter} characters. ` : ''}${\n String(value).length\n } / ${characterLimitCounter}`}\n </CounterArea>\n )}\n </>\n );\n};\n\nDSLargeInputText.propTypes = props;\nDSLargeInputText.defaultProps = defaultProps;\nDSLargeInputText.displayName = 'DSLargeInputText';\nconst DSLargeInputTextWithSchema = describe(DSLargeInputText).description('A large input');\nDSLargeInputTextWithSchema.propTypes = props;\n\nexport { DSLargeInputTextWithSchema, DSLargeInputText };\n\nexport default DSLargeInputText;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACoEnB,mBAGM,KAHN;AAlEJ,SAAgB,eAAe;AAC/B,SAAS,6BAA6B;AACtC,SAAS,gBAAgB;AACzB,SAAS,2BAA2B,yBAAyB;AAC7D,SAAS,aAAa;AACtB,SAAS,oBAAoB;AAE7B,MAAM,cAAc,kBAAkB,KAAK,EAAE,WAAW,YAAY,CAAC,EAAE,WAAW,OAAO;AAAA,EACvF,eAAe;AACjB,EAAE;AAEF,MAAM,mBAAmB,CAAC;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,wBAAsB,EAAE,eAAe,0BAA0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Y;AAIvC,IAAO,2BAAQ;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/LargeInputText/defaultProps.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const defaultProps = {\n containerProps: {},\n autoFocus: false,\n className: '',\n disabled: false,\n name: '',\n id: null,\n maxLength: null,\n minLength: 0,\n placeholder: '',\n onClick: () => null,\n onChange: () => null,\n onFocus: () => null,\n onBlur: () => null,\n onKeyUp: () => null,\n onKeyDown: () => null,\n onPaste: () => null,\n value: '',\n hasError: false,\n required: false,\n readOnly: false,\n resize: 'vertical',\n innerRef: null,\n ariaLabel: 'Enter text',\n ariaAutocomplete: 'none',\n role: 'textbox',\n characterLimitCounter: 0,\n rows: 3,\n errorLimit: 'Please limit your entry to',\n tabIndex: '',\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,eAAe;AAAA,EAC1B,gBAAgB,CAAC;AAAA,EACjB,WAAW;AAAA,EACX,WAAW;AAAA,EACX,UAAU;AAAA,EACV,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,WAAW;AAAA,EACX,WAAW;AAAA,EACX,aAAa;AAAA,EACb,SAAS,MAAM;AAAA,EACf,UAAU,MAAM;AAAA,EAChB,SAAS,MAAM;AAAA,EACf,QAAQ,MAAM;AAAA,EACd,SAAS,MAAM;AAAA,EACf,WAAW,MAAM;AAAA,EACjB,SAAS,MAAM;AAAA,EACf,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,WAAW;AAAA,EACX,kBAAkB;AAAA,EAClB,MAAM;AAAA,EACN,uBAAuB;AAAA,EACvB,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,UAAU;AACZ;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/LargeInputText/index.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { default, DSLargeInputTextWithSchema, DSLargeInputText } from './DSLargeInputText.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,WAAAA,UAAS,4BAA4B,wBAAwB;",
|
|
6
6
|
"names": ["default"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/LargeInputText/props.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from '@elliemae/ds-props-helpers';\n\nexport const props = {\n /** Injected props to wrapper element of component */\n containerProps: PropTypes.object.description('Injected props to wrapper element of component'),\n /**\n * Whether uses auto focus or not\n */\n autoFocus: PropTypes.bool.description('Whether uses auto focus or not'),\n /** CSS class */\n className: PropTypes.string.description('CSS class'),\n /**\n * Whether is disabled or not\n */\n disabled: PropTypes.bool.description('Whether is disabled or not'),\n /** HTML form name property */\n name: PropTypes.string.description('HTML form name property'),\n /** HTML id */\n id: PropTypes.number.description('HTML id'),\n /**\n * Max length for text to be entered\n */\n maxLength: PropTypes.number.description('Max length for text to be entered'),\n /**\n * Min length for text to be entered\n */\n minLength: PropTypes.number.description('Min length for text to be entered'),\n /**\n * Placeholder for the text\n */\n placeholder: PropTypes.string.description('Placeholder for the text'),\n /**\n * Allows a function that is triggered once the input text is clicked\n */\n onClick: PropTypes.func.description('Allows a function that is triggered once the input text is clicked'),\n /**\n * Allows a function that is triggered once the input text changes\n */\n onChange: PropTypes.func.description('Allows a function that is triggered once the input text changes'),\n /**\n * Allows a function that is triggered once the input text is focused\n */\n onFocus: PropTypes.func.description('Allows a function that is triggered once the input text is focused'),\n /**\n * Allows a function that is triggered once the input text loses focus\n */\n onBlur: PropTypes.func.description('Allows a function that is triggered once the input text loses focus'),\n /**\n * Allows a function that is triggered once in the input a keyboard key is released\n */\n onKeyUp: PropTypes.func.description(\n 'Allows a function that is triggered once in the input a keyboard key is released',\n ),\n /**\n * Allows a function that is triggered once a key is being pressed\n */\n onKeyDown: PropTypes.func.description('Allows a function that is triggered once a key is being pressed'),\n /**\n * Allows a function that is triggered once the input text is pasted\n */\n onPaste: PropTypes.func.description('Allows a function that is triggered once the input text is pasted'),\n /**\n * Default value once the component is initialized\n */\n value: PropTypes.string.description('Default value once the component is initialized'),\n /**\n * Whether the input text has error or not\n */\n hasError: PropTypes.bool.description('Whether the input text has error or not'),\n /**\n * Whether the input text is required or not\n */\n required: PropTypes.bool.description('Whether the input text is required or not'),\n /**\n * Whether the input text is read only or not\n */\n readOnly: PropTypes.bool.description('Whether the input text is read only or not'),\n /**\n * Whether the input text style is vertical or not\n */\n resize: PropTypes.string\n .description(\n 'The resizable handle feature is being deprocated due to the inability to fully comply with accessibility standards and would be less than optimal for the best user experience. The auto-resize functionality will repalce it and complies with accessibility standards and guidelines.',\n )\n .deprecated({ version: '4.x' }),\n /** ref forwarded to component */\n innerRef: PropTypes.func.description('ref forwarded to component'),\n /** a11y aria label */\n ariaLabel: PropTypes.string.description('a11y aria label'),\n ariaAutocomplete: PropTypes.string.description(''),\n /**\n * Type of input. Ex: textbox\n */\n role: PropTypes.string.description('Type of input. Ex: textbox'),\n /**\n * it will show a counter/limit if the value is greater than 0\n */\n characterLimitCounter: PropTypes.number.description('it will show a counter/limit if the value is greater than 0'),\n /**\n * Tab index html property.\n */\n tabIndex: PropTypes.string.description('Tab index html property.'),\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAEnB,MAAM,QAAQ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