@elliemae/ds-form 3.16.0 → 3.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Checkbox/index.js +4 -0
- package/dist/cjs/Checkbox/index.js.map +1 -1
- package/dist/cjs/CheckboxGroup/DSCheckboxGroup.js +8 -4
- package/dist/cjs/CheckboxGroup/DSCheckboxGroup.js.map +2 -2
- package/dist/cjs/CheckboxGroup/defaultProps.js +4 -0
- package/dist/cjs/CheckboxGroup/defaultProps.js.map +1 -1
- package/dist/cjs/CheckboxGroup/index.js +5 -1
- package/dist/cjs/CheckboxGroup/index.js.map +2 -2
- package/dist/cjs/CheckboxGroup/props.js +23 -1
- package/dist/cjs/CheckboxGroup/props.js.map +2 -2
- package/dist/cjs/ComboBox/index.js +4 -0
- package/dist/cjs/ComboBox/index.js.map +1 -1
- package/dist/cjs/ComboBoxFreeSolo/ComboBoxFreeSolo.js +52 -5
- package/dist/cjs/ComboBoxFreeSolo/ComboBoxFreeSolo.js.map +2 -2
- package/dist/cjs/ComboBoxFreeSolo/components/MultiValueLabel.js +4 -0
- package/dist/cjs/ComboBoxFreeSolo/components/MultiValueLabel.js.map +1 -1
- package/dist/cjs/ComboBoxFreeSolo/components/MultiValueRemove.js +4 -0
- package/dist/cjs/ComboBoxFreeSolo/components/MultiValueRemove.js.map +1 -1
- package/dist/cjs/ComboBoxFreeSolo/components/SingleValue.js +6 -2
- package/dist/cjs/ComboBoxFreeSolo/components/SingleValue.js.map +2 -2
- package/dist/cjs/ComboBoxFreeSolo/components/SingleValueRemove.js +4 -0
- package/dist/cjs/ComboBoxFreeSolo/components/SingleValueRemove.js.map +1 -1
- package/dist/cjs/ComboBoxFreeSolo/index.js +5 -1
- package/dist/cjs/ComboBoxFreeSolo/index.js.map +2 -2
- package/dist/cjs/DateInput/DSDateInput.js +9 -4
- package/dist/cjs/DateInput/DSDateInput.js.map +2 -2
- package/dist/cjs/DateInput/components/DateInputImpl.js +6 -1
- package/dist/cjs/DateInput/components/DateInputImpl.js.map +2 -2
- package/dist/cjs/DateInput/components/DateInputs.js +8 -1
- package/dist/cjs/DateInput/components/DateInputs.js.map +2 -2
- package/dist/cjs/DateInput/components/utils.js +5 -1
- package/dist/cjs/DateInput/components/utils.js.map +1 -1
- package/dist/cjs/DateInput/defaultProps.js +5 -1
- package/dist/cjs/DateInput/defaultProps.js.map +1 -1
- package/dist/cjs/DateInput/index.js +5 -1
- package/dist/cjs/DateInput/index.js.map +2 -2
- package/dist/cjs/DateInput/props.js +46 -0
- package/dist/cjs/DateInput/props.js.map +1 -1
- package/dist/cjs/DateInputV2/components/DSDateInput.js +7 -3
- package/dist/cjs/DateInputV2/components/DSDateInput.js.map +2 -2
- package/dist/cjs/DateInputV2/components/DateInputs.js +9 -4
- package/dist/cjs/DateInputV2/components/DateInputs.js.map +2 -2
- package/dist/cjs/DateInputV2/components/helpers.js +5 -1
- package/dist/cjs/DateInputV2/components/helpers.js.map +2 -2
- package/dist/cjs/DateInputV2/components/props.js +34 -0
- package/dist/cjs/DateInputV2/components/props.js.map +1 -1
- package/dist/cjs/DateInputV2/components/propsTypes.js +4 -0
- package/dist/cjs/DateInputV2/components/propsTypes.js.map +1 -1
- package/dist/cjs/DateInputV2/components/styled.js +4 -0
- package/dist/cjs/DateInputV2/components/styled.js.map +1 -1
- package/dist/cjs/DateInputV2/components/utils.js +5 -1
- package/dist/cjs/DateInputV2/components/utils.js.map +1 -1
- package/dist/cjs/DateInputV2/index.js +6 -2
- package/dist/cjs/DateInputV2/index.js.map +2 -2
- package/dist/cjs/ExpandableInput/DSExpandableInput.js +5 -1
- package/dist/cjs/ExpandableInput/DSExpandableInput.js.map +2 -2
- package/dist/cjs/ExpandableInput/ExpandableInputImpl.js +5 -1
- package/dist/cjs/ExpandableInput/ExpandableInputImpl.js.map +2 -2
- package/dist/cjs/ExpandableInput/index.js +5 -1
- package/dist/cjs/ExpandableInput/index.js.map +2 -2
- package/dist/cjs/FloatingLabelInput/DSFloatingLabelInput.js +70 -3
- package/dist/cjs/FloatingLabelInput/DSFloatingLabelInput.js.map +2 -2
- package/dist/cjs/FloatingLabelInput/FloatingLabelInputImpl.js +6 -2
- package/dist/cjs/FloatingLabelInput/FloatingLabelInputImpl.js.map +2 -2
- package/dist/cjs/FloatingLabelInput/getSvgPath.js +7 -1
- package/dist/cjs/FloatingLabelInput/getSvgPath.js.map +1 -1
- package/dist/cjs/FloatingLabelInput/index.js +5 -1
- package/dist/cjs/FloatingLabelInput/index.js.map +2 -2
- package/dist/cjs/FormItem/DSFormItemLayout.js +13 -7
- package/dist/cjs/FormItem/DSFormItemLayout.js.map +2 -2
- package/dist/cjs/FormItem/Error/DSError.js +6 -0
- package/dist/cjs/FormItem/Error/DSError.js.map +1 -1
- package/dist/cjs/FormItem/Feedback.js +4 -0
- package/dist/cjs/FormItem/Feedback.js.map +1 -1
- package/dist/cjs/FormItem/Label/DSLabel.js +5 -1
- package/dist/cjs/FormItem/Label/DSLabel.js.map +2 -2
- package/dist/cjs/FormItem/Suffix/Suffix.js +4 -0
- package/dist/cjs/FormItem/Suffix/Suffix.js.map +1 -1
- package/dist/cjs/FormItem/ValidationFieldWrapper.js +5 -0
- package/dist/cjs/FormItem/ValidationFieldWrapper.js.map +1 -1
- package/dist/cjs/FormItem/defaultProps.js +8 -4
- package/dist/cjs/FormItem/defaultProps.js.map +2 -2
- package/dist/cjs/FormItem/index.js +6 -2
- package/dist/cjs/FormItem/index.js.map +2 -2
- package/dist/cjs/FormItem/props.js +45 -1
- package/dist/cjs/FormItem/props.js.map +2 -2
- package/dist/cjs/FormItem/variants.js +4 -0
- package/dist/cjs/FormItem/variants.js.map +1 -1
- package/dist/cjs/Input/DSInput.js +4 -0
- package/dist/cjs/Input/DSInput.js.map +1 -1
- package/dist/cjs/Input/InputAddonWrapper.js +4 -0
- package/dist/cjs/Input/InputAddonWrapper.js.map +1 -1
- package/dist/cjs/Input/InputImpl.js +4 -0
- package/dist/cjs/Input/InputImpl.js.map +1 -1
- package/dist/cjs/Input/index.js +4 -0
- package/dist/cjs/Input/index.js.map +1 -1
- package/dist/cjs/InputGroup/AddonWrapper.js +4 -0
- package/dist/cjs/InputGroup/AddonWrapper.js.map +1 -1
- package/dist/cjs/InputGroup/DSInputGroup.js +8 -3
- package/dist/cjs/InputGroup/DSInputGroup.js.map +2 -2
- package/dist/cjs/InputGroup/defaultProps.js +4 -0
- package/dist/cjs/InputGroup/defaultProps.js.map +1 -1
- package/dist/cjs/InputGroup/index.js +5 -1
- package/dist/cjs/InputGroup/index.js.map +2 -2
- package/dist/cjs/InputGroup/props.js +19 -0
- package/dist/cjs/InputGroup/props.js.map +1 -1
- package/dist/cjs/InputMask/DSInputMask.js +10 -6
- package/dist/cjs/InputMask/DSInputMask.js.map +2 -2
- package/dist/cjs/InputMask/DSInputMaskDeprecated.js +13 -2
- package/dist/cjs/InputMask/DSInputMaskDeprecated.js.map +2 -2
- package/dist/cjs/InputMask/InputMaskContext.js +4 -0
- package/dist/cjs/InputMask/InputMaskContext.js.map +2 -2
- package/dist/cjs/InputMask/MaskPipes.js +5 -1
- package/dist/cjs/InputMask/MaskPipes.js.map +2 -2
- package/dist/cjs/InputMask/MaskTypes.js +4 -0
- package/dist/cjs/InputMask/MaskTypes.js.map +1 -1
- package/dist/cjs/InputMask/addons/AutoCorrectedDatePipe.js +4 -0
- package/dist/cjs/InputMask/addons/AutoCorrectedDatePipe.js.map +1 -1
- package/dist/cjs/InputMask/defaultProps.js +5 -1
- package/dist/cjs/InputMask/defaultProps.js.map +2 -2
- package/dist/cjs/InputMask/index.js +5 -1
- package/dist/cjs/InputMask/index.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/DateInputMask.js +6 -2
- package/dist/cjs/InputMask/mask_types/DateInputMask.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/DateTimeInputMask.js +6 -2
- package/dist/cjs/InputMask/mask_types/DateTimeInputMask.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/DictionaryInputMask.js +6 -2
- package/dist/cjs/InputMask/mask_types/DictionaryInputMask.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/NumberInputMask.js +6 -2
- package/dist/cjs/InputMask/mask_types/NumberInputMask.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/PhoneInputMask.js +6 -2
- package/dist/cjs/InputMask/mask_types/PhoneInputMask.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/PhoneInternationalInputMask.js +6 -2
- package/dist/cjs/InputMask/mask_types/PhoneInternationalInputMask.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/SsnInputMask.js +6 -2
- package/dist/cjs/InputMask/mask_types/SsnInputMask.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/UsZipCodeInputMask.js +6 -2
- package/dist/cjs/InputMask/mask_types/UsZipCodeInputMask.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/ZipCodeSearchInputMask.js +6 -2
- package/dist/cjs/InputMask/mask_types/ZipCodeSearchInputMask.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/index.js +13 -9
- package/dist/cjs/InputMask/mask_types/index.js.map +2 -2
- package/dist/cjs/InputMask/props.js +84 -0
- package/dist/cjs/InputMask/props.js.map +1 -1
- package/dist/cjs/InputMask/types/index.js +4 -0
- package/dist/cjs/InputMask/types/index.js.map +1 -1
- package/dist/cjs/InputMask/utils/setCaretPosition.js +4 -0
- package/dist/cjs/InputMask/utils/setCaretPosition.js.map +1 -1
- package/dist/cjs/InputProtected/DSInputProtected.js +9 -5
- package/dist/cjs/InputProtected/DSInputProtected.js.map +2 -2
- package/dist/cjs/InputProtected/defaultProps.js +5 -1
- package/dist/cjs/InputProtected/defaultProps.js.map +2 -2
- package/dist/cjs/InputProtected/index.js +6 -2
- package/dist/cjs/InputProtected/index.js.map +2 -2
- package/dist/cjs/InputProtected/options.js +4 -0
- package/dist/cjs/InputProtected/options.js.map +1 -1
- package/dist/cjs/InputProtected/props.js +9 -1
- package/dist/cjs/InputProtected/props.js.map +2 -2
- package/dist/cjs/LargeInputText/DSLargeInputText.js +6 -2
- package/dist/cjs/LargeInputText/DSLargeInputText.js.map +2 -2
- package/dist/cjs/LargeInputText/defaultProps.js +4 -0
- package/dist/cjs/LargeInputText/defaultProps.js.map +1 -1
- package/dist/cjs/LargeInputText/index.js +5 -1
- package/dist/cjs/LargeInputText/index.js.map +2 -2
- package/dist/cjs/LargeInputText/props.js +70 -0
- package/dist/cjs/LargeInputText/props.js.map +1 -1
- package/dist/cjs/MenuItem/components/MenuItem/index.js +4 -0
- package/dist/cjs/MenuItem/components/MenuItem/index.js.map +1 -1
- package/dist/cjs/MenuItem/components/MenuItem/styled.js +4 -0
- package/dist/cjs/MenuItem/components/MenuItem/styled.js.map +1 -1
- package/dist/cjs/MenuItem/components/MultiMenuItem/MultiMenuItem.js +4 -0
- package/dist/cjs/MenuItem/components/MultiMenuItem/MultiMenuItem.js.map +1 -1
- package/dist/cjs/MenuItem/components/MultiMenuItem/styled.js +4 -0
- package/dist/cjs/MenuItem/components/MultiMenuItem/styled.js.map +1 -1
- package/dist/cjs/MenuItem/components/Section/index.js +4 -0
- package/dist/cjs/MenuItem/components/Section/index.js.map +1 -1
- package/dist/cjs/MenuItem/components/Section/props.js +4 -0
- package/dist/cjs/MenuItem/components/Section/props.js.map +1 -1
- package/dist/cjs/MenuItem/components/Section/styled.js +4 -0
- package/dist/cjs/MenuItem/components/Section/styled.js.map +1 -1
- package/dist/cjs/MenuItem/components/Separator/index.js +4 -0
- package/dist/cjs/MenuItem/components/Separator/index.js.map +1 -1
- package/dist/cjs/MenuItem/components/Separator/styled.js +4 -0
- package/dist/cjs/MenuItem/components/Separator/styled.js.map +1 -1
- package/dist/cjs/MenuItem/components/SingleMenuItem/SingleMenuItem.js +4 -0
- package/dist/cjs/MenuItem/components/SingleMenuItem/SingleMenuItem.js.map +1 -1
- package/dist/cjs/MenuItem/components/SubmenuItem/index.js +4 -0
- package/dist/cjs/MenuItem/components/SubmenuItem/index.js.map +1 -1
- package/dist/cjs/MenuItem/components/SubmenuItem/styled.js +4 -0
- package/dist/cjs/MenuItem/components/SubmenuItem/styled.js.map +1 -1
- package/dist/cjs/MenuItem/components/index.js +4 -0
- package/dist/cjs/MenuItem/components/index.js.map +1 -1
- package/dist/cjs/MenuItem/components/styled.js +4 -0
- package/dist/cjs/MenuItem/components/styled.js.map +1 -1
- package/dist/cjs/MenuItem/index.js +4 -0
- package/dist/cjs/MenuItem/index.js.map +1 -1
- package/dist/cjs/MenuItem/props.js +4 -0
- package/dist/cjs/MenuItem/props.js.map +1 -1
- package/dist/cjs/Radio/Circle.js +4 -0
- package/dist/cjs/Radio/Circle.js.map +1 -1
- package/dist/cjs/Radio/DSRadio.js +35 -1
- package/dist/cjs/Radio/DSRadio.js.map +2 -2
- package/dist/cjs/Radio/index.js +5 -1
- package/dist/cjs/Radio/index.js.map +2 -2
- package/dist/cjs/RadioGroup/DSRadioGroup.js +8 -4
- package/dist/cjs/RadioGroup/DSRadioGroup.js.map +2 -2
- package/dist/cjs/RadioGroup/defaultProps.js +4 -0
- package/dist/cjs/RadioGroup/defaultProps.js.map +1 -1
- package/dist/cjs/RadioGroup/index.js +5 -1
- package/dist/cjs/RadioGroup/index.js.map +2 -2
- package/dist/cjs/RadioGroup/props.js +20 -0
- package/dist/cjs/RadioGroup/props.js.map +1 -1
- package/dist/cjs/RequiredMark/RequiredMark.js +4 -0
- package/dist/cjs/RequiredMark/RequiredMark.js.map +1 -1
- package/dist/cjs/RequiredMark/index.js +5 -1
- package/dist/cjs/RequiredMark/index.js.map +2 -2
- package/dist/cjs/SearchBox/index.js +4 -0
- package/dist/cjs/SearchBox/index.js.map +1 -1
- package/dist/cjs/TextBox/index.js +4 -0
- package/dist/cjs/TextBox/index.js.map +1 -1
- package/dist/cjs/TimeInput/DSTimeInput.js +29 -2
- package/dist/cjs/TimeInput/DSTimeInput.js.map +2 -2
- package/dist/cjs/TimeInput/TimeInputImpl.js +32 -1
- package/dist/cjs/TimeInput/TimeInputImpl.js.map +2 -2
- package/dist/cjs/TimeInput/TimeInputs.js +6 -1
- package/dist/cjs/TimeInput/TimeInputs.js.map +2 -2
- package/dist/cjs/TimeInput/index.js +5 -1
- package/dist/cjs/TimeInput/index.js.map +2 -2
- package/dist/cjs/TimeInput/utils.js +4 -0
- package/dist/cjs/TimeInput/utils.js.map +1 -1
- package/dist/cjs/Toggle/DSToggle.js +38 -1
- package/dist/cjs/Toggle/DSToggle.js.map +2 -2
- package/dist/cjs/Toggle/DSToggleImpl.js +40 -3
- package/dist/cjs/Toggle/DSToggleImpl.js.map +2 -2
- package/dist/cjs/Toggle/DSToggleRender.js +4 -0
- package/dist/cjs/Toggle/DSToggleRender.js.map +1 -1
- package/dist/cjs/Toggle/index.js +5 -1
- package/dist/cjs/Toggle/index.js.map +2 -2
- package/dist/cjs/Toggle/props.js +37 -0
- package/dist/cjs/Toggle/props.js.map +1 -1
- package/dist/cjs/Toggle/toggleHelper.js +4 -0
- package/dist/cjs/Toggle/toggleHelper.js.map +1 -1
- package/dist/cjs/index.js +25 -21
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/package.json +7 -0
- package/dist/esm/CheckboxGroup/DSCheckboxGroup.js +4 -4
- package/dist/esm/CheckboxGroup/DSCheckboxGroup.js.map +2 -2
- package/dist/esm/CheckboxGroup/index.js +1 -1
- package/dist/esm/CheckboxGroup/index.js.map +1 -1
- package/dist/esm/CheckboxGroup/props.js +19 -1
- package/dist/esm/CheckboxGroup/props.js.map +2 -2
- package/dist/esm/ComboBoxFreeSolo/ComboBoxFreeSolo.js +48 -5
- package/dist/esm/ComboBoxFreeSolo/ComboBoxFreeSolo.js.map +2 -2
- package/dist/esm/ComboBoxFreeSolo/components/MultiValueLabel.js.map +1 -1
- package/dist/esm/ComboBoxFreeSolo/components/SingleValue.js +2 -2
- package/dist/esm/ComboBoxFreeSolo/components/SingleValue.js.map +1 -1
- package/dist/esm/ComboBoxFreeSolo/index.js +1 -1
- package/dist/esm/ComboBoxFreeSolo/index.js.map +1 -1
- package/dist/esm/DateInput/DSDateInput.js +5 -4
- package/dist/esm/DateInput/DSDateInput.js.map +2 -2
- package/dist/esm/DateInput/components/DateInputImpl.js +2 -1
- package/dist/esm/DateInput/components/DateInputImpl.js.map +2 -2
- package/dist/esm/DateInput/components/DateInputs.js +4 -1
- package/dist/esm/DateInput/components/DateInputs.js.map +2 -2
- package/dist/esm/DateInput/components/utils.js +1 -1
- package/dist/esm/DateInput/components/utils.js.map +1 -1
- package/dist/esm/DateInput/defaultProps.js +1 -1
- package/dist/esm/DateInput/defaultProps.js.map +1 -1
- package/dist/esm/DateInput/index.js +1 -1
- package/dist/esm/DateInput/index.js.map +1 -1
- package/dist/esm/DateInput/props.js +42 -0
- package/dist/esm/DateInput/props.js.map +1 -1
- package/dist/esm/DateInputV2/components/DSDateInput.js +3 -3
- package/dist/esm/DateInputV2/components/DSDateInput.js.map +1 -1
- package/dist/esm/DateInputV2/components/DateInputs.js +5 -4
- package/dist/esm/DateInputV2/components/DateInputs.js.map +2 -2
- package/dist/esm/DateInputV2/components/helpers.js +1 -1
- package/dist/esm/DateInputV2/components/helpers.js.map +1 -1
- package/dist/esm/DateInputV2/components/props.js +30 -0
- package/dist/esm/DateInputV2/components/props.js.map +1 -1
- package/dist/esm/DateInputV2/components/styled.js.map +1 -1
- package/dist/esm/DateInputV2/components/utils.js +1 -1
- package/dist/esm/DateInputV2/components/utils.js.map +1 -1
- package/dist/esm/DateInputV2/index.js +2 -2
- package/dist/esm/DateInputV2/index.js.map +1 -1
- package/dist/esm/ExpandableInput/DSExpandableInput.js +1 -1
- package/dist/esm/ExpandableInput/DSExpandableInput.js.map +1 -1
- package/dist/esm/ExpandableInput/ExpandableInputImpl.js +1 -1
- package/dist/esm/ExpandableInput/ExpandableInputImpl.js.map +1 -1
- package/dist/esm/ExpandableInput/index.js +1 -1
- package/dist/esm/ExpandableInput/index.js.map +1 -1
- package/dist/esm/FloatingLabelInput/DSFloatingLabelInput.js +66 -3
- package/dist/esm/FloatingLabelInput/DSFloatingLabelInput.js.map +2 -2
- package/dist/esm/FloatingLabelInput/FloatingLabelInputImpl.js +2 -2
- package/dist/esm/FloatingLabelInput/FloatingLabelInputImpl.js.map +1 -1
- package/dist/esm/FloatingLabelInput/getSvgPath.js +3 -1
- package/dist/esm/FloatingLabelInput/getSvgPath.js.map +1 -1
- package/dist/esm/FloatingLabelInput/index.js +1 -1
- package/dist/esm/FloatingLabelInput/index.js.map +1 -1
- package/dist/esm/FormItem/DSFormItemLayout.js +9 -7
- package/dist/esm/FormItem/DSFormItemLayout.js.map +2 -2
- package/dist/esm/FormItem/Error/DSError.js +2 -0
- package/dist/esm/FormItem/Error/DSError.js.map +1 -1
- package/dist/esm/FormItem/Label/DSLabel.js +1 -1
- package/dist/esm/FormItem/Label/DSLabel.js.map +1 -1
- package/dist/esm/FormItem/ValidationFieldWrapper.js +1 -0
- package/dist/esm/FormItem/ValidationFieldWrapper.js.map +1 -1
- package/dist/esm/FormItem/defaultProps.js +4 -4
- package/dist/esm/FormItem/defaultProps.js.map +1 -1
- package/dist/esm/FormItem/index.js +2 -2
- package/dist/esm/FormItem/index.js.map +1 -1
- package/dist/esm/FormItem/props.js +41 -1
- package/dist/esm/FormItem/props.js.map +2 -2
- package/dist/esm/InputGroup/DSInputGroup.js +4 -3
- package/dist/esm/InputGroup/DSInputGroup.js.map +2 -2
- package/dist/esm/InputGroup/index.js +1 -1
- package/dist/esm/InputGroup/index.js.map +1 -1
- package/dist/esm/InputGroup/props.js +15 -0
- package/dist/esm/InputGroup/props.js.map +1 -1
- package/dist/esm/InputMask/DSInputMask.js +6 -6
- package/dist/esm/InputMask/DSInputMask.js.map +2 -2
- package/dist/esm/InputMask/DSInputMaskDeprecated.js +9 -2
- package/dist/esm/InputMask/DSInputMaskDeprecated.js.map +2 -2
- package/dist/esm/InputMask/InputMaskContext.js.map +1 -1
- package/dist/esm/InputMask/MaskPipes.js +1 -1
- package/dist/esm/InputMask/MaskPipes.js.map +1 -1
- package/dist/esm/InputMask/addons/AutoCorrectedDatePipe.js.map +1 -1
- package/dist/esm/InputMask/defaultProps.js +1 -1
- package/dist/esm/InputMask/defaultProps.js.map +1 -1
- package/dist/esm/InputMask/index.js +1 -1
- package/dist/esm/InputMask/index.js.map +1 -1
- package/dist/esm/InputMask/mask_types/DateInputMask.js +2 -2
- package/dist/esm/InputMask/mask_types/DateInputMask.js.map +2 -2
- package/dist/esm/InputMask/mask_types/DateTimeInputMask.js +2 -2
- package/dist/esm/InputMask/mask_types/DateTimeInputMask.js.map +2 -2
- package/dist/esm/InputMask/mask_types/DictionaryInputMask.js +2 -2
- package/dist/esm/InputMask/mask_types/DictionaryInputMask.js.map +2 -2
- package/dist/esm/InputMask/mask_types/NumberInputMask.js +2 -2
- package/dist/esm/InputMask/mask_types/NumberInputMask.js.map +2 -2
- package/dist/esm/InputMask/mask_types/PhoneInputMask.js +2 -2
- package/dist/esm/InputMask/mask_types/PhoneInputMask.js.map +2 -2
- package/dist/esm/InputMask/mask_types/PhoneInternationalInputMask.js +2 -2
- package/dist/esm/InputMask/mask_types/PhoneInternationalInputMask.js.map +2 -2
- package/dist/esm/InputMask/mask_types/SsnInputMask.js +2 -2
- package/dist/esm/InputMask/mask_types/SsnInputMask.js.map +2 -2
- package/dist/esm/InputMask/mask_types/UsZipCodeInputMask.js +2 -2
- package/dist/esm/InputMask/mask_types/UsZipCodeInputMask.js.map +2 -2
- package/dist/esm/InputMask/mask_types/ZipCodeSearchInputMask.js +2 -2
- package/dist/esm/InputMask/mask_types/ZipCodeSearchInputMask.js.map +2 -2
- package/dist/esm/InputMask/mask_types/index.js +9 -9
- package/dist/esm/InputMask/mask_types/index.js.map +2 -2
- package/dist/esm/InputMask/props.js +80 -0
- package/dist/esm/InputMask/props.js.map +1 -1
- package/dist/esm/InputProtected/DSInputProtected.js +5 -5
- package/dist/esm/InputProtected/DSInputProtected.js.map +2 -2
- package/dist/esm/InputProtected/defaultProps.js +1 -1
- package/dist/esm/InputProtected/defaultProps.js.map +1 -1
- package/dist/esm/InputProtected/index.js +2 -2
- package/dist/esm/InputProtected/index.js.map +1 -1
- package/dist/esm/InputProtected/props.js +5 -1
- package/dist/esm/InputProtected/props.js.map +2 -2
- package/dist/esm/LargeInputText/DSLargeInputText.js +2 -2
- package/dist/esm/LargeInputText/DSLargeInputText.js.map +1 -1
- package/dist/esm/LargeInputText/index.js +1 -1
- package/dist/esm/LargeInputText/index.js.map +1 -1
- package/dist/esm/LargeInputText/props.js +66 -0
- package/dist/esm/LargeInputText/props.js.map +1 -1
- package/dist/esm/Radio/Circle.js.map +1 -1
- package/dist/esm/Radio/DSRadio.js +31 -1
- package/dist/esm/Radio/DSRadio.js.map +2 -2
- package/dist/esm/Radio/index.js +1 -1
- package/dist/esm/Radio/index.js.map +1 -1
- package/dist/esm/RadioGroup/DSRadioGroup.js +4 -4
- package/dist/esm/RadioGroup/DSRadioGroup.js.map +2 -2
- package/dist/esm/RadioGroup/index.js +1 -1
- package/dist/esm/RadioGroup/index.js.map +1 -1
- package/dist/esm/RadioGroup/props.js +16 -0
- package/dist/esm/RadioGroup/props.js.map +1 -1
- package/dist/esm/RequiredMark/index.js +1 -1
- package/dist/esm/RequiredMark/index.js.map +1 -1
- package/dist/esm/TimeInput/DSTimeInput.js +25 -2
- package/dist/esm/TimeInput/DSTimeInput.js.map +2 -2
- package/dist/esm/TimeInput/TimeInputImpl.js +28 -1
- package/dist/esm/TimeInput/TimeInputImpl.js.map +2 -2
- package/dist/esm/TimeInput/TimeInputs.js +2 -1
- package/dist/esm/TimeInput/TimeInputs.js.map +2 -2
- package/dist/esm/TimeInput/index.js +1 -1
- package/dist/esm/TimeInput/index.js.map +1 -1
- package/dist/esm/Toggle/DSToggle.js +34 -1
- package/dist/esm/Toggle/DSToggle.js.map +2 -2
- package/dist/esm/Toggle/DSToggleImpl.js +36 -3
- package/dist/esm/Toggle/DSToggleImpl.js.map +2 -2
- package/dist/esm/Toggle/index.js +1 -1
- package/dist/esm/Toggle/index.js.map +1 -1
- package/dist/esm/Toggle/props.js +33 -0
- package/dist/esm/Toggle/props.js.map +1 -1
- package/dist/esm/index.js +21 -21
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +7 -0
- package/package.json +18 -18
- package/dist/types/Checkbox/index.d.ts +0 -1
- package/dist/types/CheckboxGroup/DSCheckboxGroup.d.ts +0 -46
- package/dist/types/CheckboxGroup/defaultProps.d.ts +0 -14
- package/dist/types/CheckboxGroup/index.d.ts +0 -1
- package/dist/types/CheckboxGroup/props.d.ts +0 -26
- package/dist/types/CheckboxGroup/tests/DSCheckboxGroup.events.test.d.ts +0 -1
- package/dist/types/ComboBox/index.d.ts +0 -1
- package/dist/types/ComboBoxFreeSolo/ComboBoxFreeSolo.d.ts +0 -78
- package/dist/types/ComboBoxFreeSolo/components/MultiValueLabel.d.ts +0 -5
- package/dist/types/ComboBoxFreeSolo/components/MultiValueRemove.d.ts +0 -5
- package/dist/types/ComboBoxFreeSolo/components/SingleValue.d.ts +0 -2
- package/dist/types/ComboBoxFreeSolo/components/SingleValueRemove.d.ts +0 -5
- package/dist/types/ComboBoxFreeSolo/index.d.ts +0 -1
- package/dist/types/DateInput/DSDateInput.d.ts +0 -62
- package/dist/types/DateInput/components/DateInputImpl.d.ts +0 -40
- package/dist/types/DateInput/components/DateInputs.d.ts +0 -40
- package/dist/types/DateInput/components/utils.d.ts +0 -40
- package/dist/types/DateInput/defaultProps.d.ts +0 -18
- package/dist/types/DateInput/index.d.ts +0 -1
- package/dist/types/DateInput/props.d.ts +0 -60
- package/dist/types/DateInput/tests/DSDateInput.events.test.d.ts +0 -1
- package/dist/types/DateInputV2/components/DSDateInput.d.ts +0 -54
- package/dist/types/DateInputV2/components/DateInputs.d.ts +0 -32
- package/dist/types/DateInputV2/components/helpers.d.ts +0 -1
- package/dist/types/DateInputV2/components/props.d.ts +0 -53
- package/dist/types/DateInputV2/components/propsTypes.d.ts +0 -21
- package/dist/types/DateInputV2/components/styled.d.ts +0 -5
- package/dist/types/DateInputV2/components/utils.d.ts +0 -42
- package/dist/types/DateInputV2/index.d.ts +0 -2
- package/dist/types/DateInputV2/tests/DateInput.test.d.ts +0 -1
- package/dist/types/ExpandableInput/DSExpandableInput.d.ts +0 -15
- package/dist/types/ExpandableInput/ExpandableInputImpl.d.ts +0 -7
- package/dist/types/ExpandableInput/index.d.ts +0 -1
- package/dist/types/FloatingLabelInput/DSFloatingLabelInput.d.ts +0 -47
- package/dist/types/FloatingLabelInput/FloatingLabelInputImpl.d.ts +0 -27
- package/dist/types/FloatingLabelInput/getSvgPath.d.ts +0 -10
- package/dist/types/FloatingLabelInput/index.d.ts +0 -1
- package/dist/types/FormItem/DSFormItemLayout.d.ts +0 -180
- package/dist/types/FormItem/Error/DSError.d.ts +0 -19
- package/dist/types/FormItem/Feedback.d.ts +0 -6
- package/dist/types/FormItem/Label/DSLabel.d.ts +0 -23
- package/dist/types/FormItem/Suffix/Suffix.d.ts +0 -4
- package/dist/types/FormItem/ValidationFieldWrapper.d.ts +0 -19
- package/dist/types/FormItem/defaultProps.d.ts +0 -51
- package/dist/types/FormItem/index.d.ts +0 -2
- package/dist/types/FormItem/props.d.ts +0 -80
- package/dist/types/FormItem/tests/DSFormItem.events.test.d.ts +0 -1
- package/dist/types/FormItem/variants.d.ts +0 -8
- package/dist/types/Input/DSInput.d.ts +0 -0
- package/dist/types/Input/InputAddonWrapper.d.ts +0 -0
- package/dist/types/Input/InputImpl.d.ts +0 -0
- package/dist/types/Input/index.d.ts +0 -1
- package/dist/types/Input/tests/Input.test.d.ts +0 -0
- package/dist/types/InputGroup/AddonWrapper.d.ts +0 -8
- package/dist/types/InputGroup/DSInputGroup.d.ts +0 -40
- package/dist/types/InputGroup/defaultProps.d.ts +0 -8
- package/dist/types/InputGroup/index.d.ts +0 -1
- package/dist/types/InputGroup/props.d.ts +0 -24
- package/dist/types/InputGroup/tests/DSInputGroup.events.test.d.ts +0 -1
- package/dist/types/InputMask/DSInputMask.d.ts +0 -85
- package/dist/types/InputMask/DSInputMaskDeprecated.d.ts +0 -18
- package/dist/types/InputMask/InputMaskContext.d.ts +0 -18
- package/dist/types/InputMask/MaskPipes.d.ts +0 -18
- package/dist/types/InputMask/MaskTypes.d.ts +0 -15
- package/dist/types/InputMask/addons/AutoCorrectedDatePipe.d.ts +0 -8
- package/dist/types/InputMask/defaultProps.d.ts +0 -28
- package/dist/types/InputMask/index.d.ts +0 -1
- package/dist/types/InputMask/mask_types/DateInputMask.d.ts +0 -36
- package/dist/types/InputMask/mask_types/DateTimeInputMask.d.ts +0 -36
- package/dist/types/InputMask/mask_types/DictionaryInputMask.d.ts +0 -39
- package/dist/types/InputMask/mask_types/NumberInputMask.d.ts +0 -48
- package/dist/types/InputMask/mask_types/PhoneInputMask.d.ts +0 -36
- package/dist/types/InputMask/mask_types/PhoneInternationalInputMask.d.ts +0 -36
- package/dist/types/InputMask/mask_types/SsnInputMask.d.ts +0 -36
- package/dist/types/InputMask/mask_types/UsZipCodeInputMask.d.ts +0 -36
- package/dist/types/InputMask/mask_types/ZipCodeSearchInputMask.d.ts +0 -36
- package/dist/types/InputMask/mask_types/index.d.ts +0 -41
- package/dist/types/InputMask/props.d.ts +0 -112
- package/dist/types/InputMask/tests/DSInputMask.test.d.ts +0 -1
- package/dist/types/InputMask/tests/NumberInputMask.test.d.ts +0 -1
- package/dist/types/InputMask/tests/events/DateInputMask.events.test.d.ts +0 -1
- package/dist/types/InputMask/tests/events/DateTimeInputMask.events.test.d.ts +0 -1
- package/dist/types/InputMask/tests/events/NumberInputMask.events.test.d.ts +0 -1
- package/dist/types/InputMask/tests/events/PercentInputMask.events.test.d.ts +0 -1
- package/dist/types/InputMask/tests/events/PhoneInputMask.events.test.d.ts +0 -1
- package/dist/types/InputMask/tests/events/PhoneInternationalInputMask.events.test.d.ts +0 -1
- package/dist/types/InputMask/tests/events/SsnInputMask.events.test.d.ts +0 -1
- package/dist/types/InputMask/tests/events/UsZipCodeInputMask.events.test.d.ts +0 -1
- package/dist/types/InputMask/tests/events/ZipCodeSearchInputMask.events.test.d.ts +0 -1
- package/dist/types/InputMask/types/index.d.ts +0 -5
- package/dist/types/InputMask/utils/setCaretPosition.d.ts +0 -3
- package/dist/types/InputProtected/DSInputProtected.d.ts +0 -41
- package/dist/types/InputProtected/defaultProps.d.ts +0 -4
- package/dist/types/InputProtected/index.d.ts +0 -2
- package/dist/types/InputProtected/options.d.ts +0 -8
- package/dist/types/InputProtected/props.d.ts +0 -14
- package/dist/types/InputProtected/tests/DSInputProtected.events.test.d.ts +0 -1
- package/dist/types/InputProtected/tests/DSInputProtected.test.d.ts +0 -1
- package/dist/types/LargeInputText/DSLargeInputText.d.ts +0 -127
- package/dist/types/LargeInputText/defaultProps.d.ts +0 -31
- package/dist/types/LargeInputText/index.d.ts +0 -1
- package/dist/types/LargeInputText/props.d.ts +0 -95
- package/dist/types/LargeInputText/tests/DSLargeInputText.events.test.d.ts +0 -1
- package/dist/types/LargeInputText/tests/DSLargeInputText.test.d.ts +0 -1
- package/dist/types/MenuItem/components/MenuItem/index.d.ts +0 -0
- package/dist/types/MenuItem/components/MenuItem/styled.d.ts +0 -0
- package/dist/types/MenuItem/components/MultiMenuItem/MultiMenuItem.d.ts +0 -0
- package/dist/types/MenuItem/components/MultiMenuItem/styled.d.ts +0 -0
- package/dist/types/MenuItem/components/Section/index.d.ts +0 -0
- package/dist/types/MenuItem/components/Section/props.d.ts +0 -0
- package/dist/types/MenuItem/components/Section/styled.d.ts +0 -0
- package/dist/types/MenuItem/components/Separator/index.d.ts +0 -0
- package/dist/types/MenuItem/components/Separator/styled.d.ts +0 -0
- package/dist/types/MenuItem/components/SingleMenuItem/SingleMenuItem.d.ts +0 -0
- package/dist/types/MenuItem/components/SubmenuItem/index.d.ts +0 -0
- package/dist/types/MenuItem/components/SubmenuItem/styled.d.ts +0 -0
- package/dist/types/MenuItem/components/index.d.ts +0 -0
- package/dist/types/MenuItem/components/styled.d.ts +0 -0
- package/dist/types/MenuItem/index.d.ts +0 -0
- package/dist/types/MenuItem/props.d.ts +0 -0
- package/dist/types/Radio/Circle.d.ts +0 -8
- package/dist/types/Radio/DSRadio.d.ts +0 -87
- package/dist/types/Radio/index.d.ts +0 -1
- package/dist/types/RadioGroup/DSRadioGroup.d.ts +0 -46
- package/dist/types/RadioGroup/defaultProps.d.ts +0 -12
- package/dist/types/RadioGroup/index.d.ts +0 -1
- package/dist/types/RadioGroup/props.d.ts +0 -25
- package/dist/types/RadioGroup/tests/DSRadioGroup.events.test.d.ts +0 -1
- package/dist/types/RequiredMark/RequiredMark.d.ts +0 -6
- package/dist/types/RequiredMark/index.d.ts +0 -1
- package/dist/types/SearchBox/index.d.ts +0 -1
- package/dist/types/TextBox/index.d.ts +0 -1
- package/dist/types/TimeInput/DSTimeInput.d.ts +0 -71
- package/dist/types/TimeInput/TimeInputImpl.d.ts +0 -55
- package/dist/types/TimeInput/TimeInputs.d.ts +0 -17
- package/dist/types/TimeInput/index.d.ts +0 -1
- package/dist/types/TimeInput/utils.d.ts +0 -39
- package/dist/types/Toggle/DSToggle.d.ts +0 -86
- package/dist/types/Toggle/DSToggleImpl.d.ts +0 -61
- package/dist/types/Toggle/DSToggleRender.d.ts +0 -32
- package/dist/types/Toggle/index.d.ts +0 -1
- package/dist/types/Toggle/props.d.ts +0 -47
- package/dist/types/Toggle/toggleHelper.d.ts +0 -24
- package/dist/types/index.d.ts +0 -21
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/mask_types/NumberInputMask.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\n/* eslint-disable max-statements */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\n\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport { DSTextBox } from '../../TextBox';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\n// http://stackoverflow.com/a/10899795/604296\nconst addThousandsSeparator = (n, thousandsSeparatorSymbol) =>\n n.replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousandsSeparatorSymbol);\n\nconst conformValue = (\n prevRawValue,\n prevCursorPos,\n lastkeycode,\n {\n prefix,\n suffix,\n includeThousandsSeparator,\n thousandsSeparatorSymbol,\n allowDecimal,\n decimalSymbol,\n decimalLimit,\n requireDecimal,\n allowNegative,\n allowLeadingZeroes,\n integerLimit,\n shouldCompleteDecimals,\n },\n) => {\n const prefixIndex = prevRawValue.indexOf(prefix);\n const suffixIndex = prevRawValue.lastIndexOf(suffix);\n const negativeIndex = prevRawValue.indexOf('-');\n\n const cursorPos = prevCursorPos - (prefixIndex === -1 ? 0 : prefixIndex + prefix.length);\n\n const rawValue = prevRawValue.substring(\n prefixIndex === -1 ? 0 : prefixIndex + prefix.length,\n suffixIndex === -1 ? prevRawValue.length : suffixIndex,\n );\n\n const filteredRawValue = rawValue\n .split('')\n .filter((char) => (char >= '0' && char <= '9') || char === decimalSymbol || char === '-');\n\n let isNegative = allowNegative && negativeIndex !== -1 && (prefixIndex === -1 || negativeIndex < prefixIndex);\n\n let integer = '';\n let decimal = '';\n let foundDecimalSymbol = false;\n\n const integerFits = () => integerLimit === null || integer.length < integerLimit;\n const decimalFits = () => decimalLimit === null || decimal.length < decimalLimit;\n\n filteredRawValue.forEach((char) => {\n if (allowDecimal && !foundDecimalSymbol && char === decimalSymbol) {\n foundDecimalSymbol = true;\n } else if (allowNegative && !integer.length && !foundDecimalSymbol && char === '-') {\n isNegative = true;\n } else if (char >= '0' && char <= '9') {\n if (!foundDecimalSymbol && integerFits()) {\n integer += char;\n } else if (foundDecimalSymbol && decimalFits()) {\n decimal += char;\n }\n }\n });\n\n if (requireDecimal) foundDecimalSymbol = true;\n if (!requireDecimal && !decimal?.length && lastkeycode === 8) {\n foundDecimalSymbol = false;\n }\n if (!integer && !decimal) foundDecimalSymbol = false;\n\n if (foundDecimalSymbol && !integer && decimal) {\n integer = '0';\n }\n\n if (!allowLeadingZeroes) {\n while (integer.length > 1 && integer[0] === '0') integer = integer.substring(1);\n }\n\n let nextMaskedValue = includeThousandsSeparator ? addThousandsSeparator(integer, thousandsSeparatorSymbol) : integer;\n nextMaskedValue += foundDecimalSymbol ? decimalSymbol : '';\n\n if (shouldCompleteDecimals) while (decimal.length !== decimalLimit) decimal += '0';\n\n nextMaskedValue += decimal;\n\n let maskedPos = 0;\n for (let i = 0; i < cursorPos; i += 1) {\n if (nextMaskedValue[maskedPos] === thousandsSeparatorSymbol) maskedPos += 1;\n if (nextMaskedValue[maskedPos] === rawValue[i]) maskedPos += 1;\n }\n if (nextMaskedValue.length || isNegative) {\n nextMaskedValue = prefix + nextMaskedValue;\n maskedPos += prefix.length;\n\n if (isNegative) {\n if (lastkeycode !== 8 || nextMaskedValue !== prefix) nextMaskedValue = `-${nextMaskedValue}`;\n maskedPos += 1;\n }\n\n nextMaskedValue += suffix;\n }\n\n if (lastkeycode !== 8 && maskedPos < nextMaskedValue.length) {\n if (nextMaskedValue[maskedPos] === decimalSymbol && integer.length === integerLimit) {\n maskedPos += 1;\n } else if (nextMaskedValue[maskedPos] === thousandsSeparatorSymbol) {\n maskedPos += 1;\n }\n }\n\n return {\n nextMaskedValue,\n maskedPos: Math.min(maskedPos, nextMaskedValue.length - suffix.length),\n };\n};\n\nconst NumberInputMask = ({\n focus,\n setFocus,\n setRawMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n allowDecimal,\n allowLeadingZeroes,\n allowNegative,\n autoFocus,\n className,\n clearable = false,\n decimalLimit,\n decimalSymbol,\n disabled,\n fluidWidth,\n hasError,\n includeThousandsSeparator,\n innerRef,\n integerLimit,\n leftComponent,\n maxLength,\n minLength,\n name,\n onBlur,\n onChange,\n onClick,\n onFocus,\n onKeyDown,\n onKeyUp,\n onPaste,\n placeholder,\n prefix,\n readOnly,\n requireDecimal,\n rightComponent,\n style,\n suffix,\n thousandsSeparatorSymbol,\n type,\n value,\n ...rest\n}) => {\n const inputRef = useRef();\n const [maskedValue, setMaskedValue] = useState(value);\n\n const conform = useCallback(\n ({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true, shouldCompleteDecimals = false }) => {\n const { nextMaskedValue, maskedPos } = conformValue(rawValue, cursorPos, lastkeycode, {\n prefix,\n suffix,\n includeThousandsSeparator,\n thousandsSeparatorSymbol,\n allowDecimal,\n decimalSymbol,\n decimalLimit,\n requireDecimal,\n allowNegative,\n allowLeadingZeroes,\n integerLimit,\n shouldCompleteDecimals,\n });\n const event = {\n target: {\n value: nextMaskedValue,\n originalValue: rawValue,\n },\n };\n if (onChange && nextMaskedValue !== maskedValue) onChange(event);\n\n setMaskedValue(nextMaskedValue);\n setRawValue(nextMaskedValue);\n\n if (shouldUpdateCursorPos) setCursorPosition({ current: maskedPos });\n },\n [maskedValue, onChange],\n );\n\n const handleOnChange = useCallback(\n (e) => {\n const { value: rawValue, selectionEnd } = e.target;\n setRawMask(rawValue);\n setRawValue(rawValue);\n setCursorPosition({ current: selectionEnd });\n setFocus(true);\n },\n [setRawMask, setRawValue, setCursorPosition, setFocus, lastkey.code],\n );\n\n useLayoutEffect(() => {\n if (focus) setCaretPosition(inputRef.current, cursorPosition.current);\n }, [focus, cursorPosition]);\n\n useLayoutEffect(() => {\n // if the value changes, then re-conform the mask\n conform({\n rawValue: value,\n cursorPos: cursorPosition.current,\n lastkeycode: lastkey.code,\n shouldUpdateCursorPos: focus,\n });\n }, [focus, value, cursorPosition.current]);\n\n const handleKeyDown = useCallback(\n (e) => {\n e.stopPropagation();\n setLastkey({ key: e.key, code: e.keyCode });\n onKeyDown(e);\n },\n [onKeyDown],\n );\n\n const handleBlur = useCallback(\n (e) => {\n setFocus(false);\n onBlur(e);\n if (requireDecimal && maskedValue !== '') {\n conform({\n rawValue: maskedValue,\n cursorPos: 0,\n lastkey: 0,\n shouldUpdateCursorPos: 0,\n shouldCompleteDecimals: true,\n });\n }\n },\n [maskedValue, requireDecimal, suffix, decimalLimit, onBlur],\n );\n\n return (\n <DSTextBox\n {...rest}\n className={className}\n clearable={clearable}\n disabled={disabled}\n fluidWidth={fluidWidth}\n hasError={hasError}\n innerRef={(ref) => {\n inputRef.current = ref;\n if (innerRef) innerRef(ref);\n }}\n isActive={focus}\n leftComponent={leftComponent}\n maxLength={maxLength}\n minLength={minLength}\n name={name}\n onBlur={handleBlur}\n onChange={handleOnChange}\n onClick={onClick}\n onFocus={onFocus}\n onKeyDown={handleKeyDown}\n onKeyUp={onKeyUp}\n onPaste={onPaste}\n placeholder={placeholder}\n readOnly={readOnly}\n rightComponent={rightComponent}\n style={style}\n type={type}\n value={maskedValue}\n />\n );\n};\n\nexport { NumberInputMask };\nexport default NumberInputMask;\n"],
|
|
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,QAAQ,OAAO,QAAQ,OAAQ,SAAS,iBAAiB,SAAS,GAAG;AAE1F,MAAI,aAAa,iBAAiB,kBAAkB,OAAO,gBAAgB,MAAM,gBAAgB;AAEjG,MAAI,UAAU;AACd,MAAI,UAAU;AACd,MAAI,qBAAqB;AAEzB,QAAM,cAAc,MAAM,iBAAiB,QAAQ,QAAQ,SAAS;AACpE,QAAM,cAAc,MAAM,iBAAiB,QAAQ,QAAQ,SAAS;AAEpE,mBAAiB,QAAQ,CAAC,SAAS;AACjC,QAAI,gBAAgB,CAAC,sBAAsB,SAAS,eAAe;AACjE,2BAAqB;AAAA,IACvB,WAAW,iBAAiB,CAAC,QAAQ,UAAU,CAAC,sBAAsB,SAAS,KAAK;AAClF,mBAAa;AAAA,IACf,WAAW,QAAQ,OAAO,QAAQ,KAAK;AACrC,UAAI,CAAC,sBAAsB,YAAY,GAAG;AACxC,mBAAW;AAAA,MACb,WAAW,sBAAsB,YAAY,GAAG;AAC9C,mBAAW;AAAA,MACb;AAAA,IACF;AAAA,EACF,CAAC;AAED,MAAI;AAAgB,yBAAqB;AACzC,MAAI,CAAC,kBAAkB,CAAC,SAAS,UAAU,gBAAgB,GAAG;AAC5D,yBAAqB;AAAA,EACvB;AACA,MAAI,CAAC,WAAW,CAAC;AAAS,yBAAqB;AAE/C,MAAI,sBAAsB,CAAC,WAAW,SAAS;AAC7C,cAAU;AAAA,EACZ;AAEA,MAAI,CAAC,oBAAoB;AACvB,WAAO,QAAQ,SAAS,KAAK,QAAQ,
|
|
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
|
+
"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,QAAQ,OAAO,QA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AAM,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": []
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback, useLayoutEffect, useRef, useState } from "react";
|
|
4
|
-
import { DSTextBox } from "../../TextBox";
|
|
5
|
-
import { setCaretPosition } from "../utils/setCaretPosition";
|
|
4
|
+
import { DSTextBox } from "../../TextBox/index.js";
|
|
5
|
+
import { setCaretPosition } from "../utils/setCaretPosition.js";
|
|
6
6
|
const conformValue = (rawValue, cursorPos, lastkeycode) => {
|
|
7
7
|
let nextMaskedValue = String(rawValue).split("").filter((char) => char >= "0" && char <= "9");
|
|
8
8
|
while (nextMaskedValue.length && nextMaskedValue[0] === "0")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/mask_types/PhoneInputMask.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport { DSTextBox } from '../../TextBox';\nimport type { TCharsToAdd } from '../types';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst conformValue = (rawValue, cursorPos, lastkeycode) => {\n let nextMaskedValue = String(rawValue)\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 };\nexport default PhoneInputMask;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACmJnB;AAjJJ,SAAgB,aAAa,iBAAiB,QAAQ,gBAAgB;AAEtE,SAAS,iBAAiB;AAE1B,SAAS,wBAAwB;AAEjC,MAAM,eAAe,CAAC,UAAU,WAAW,gBAAgB;AACzD,MAAI,kBAAkB,OAAO,QAAQ,EAClC,MAAM,EAAE,EACR,OAAO,CAAC,SAAS,QAAQ,OAAO,QAAQ,GAAG;AAE9C,SAAO,gBAAgB,UAAU,gBAAgB,
|
|
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 };\nexport default PhoneInputMask;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACmJnB;AAjJJ,SAAgB,aAAa,iBAAiB,QAAQ,gBAAgB;AAEtE,SAAS,iBAAiB;AAE1B,SAAS,wBAAwB;AAEjC,MAAM,eAAe,CAAC,UAAU,WAAW,gBAAgB;AACzD,MAAI,kBAAkB,OAAO,QAAQ,EAClC,MAAM,EAAE,EACR,OAAO,CAAC,SAAS,QAAQ,OAAO,QAAQ,GAAG;AAE9C,SAAO,gBAAgB,UAAU,gBA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AgB;AAClB,iBAAW,EAAE,KAAK,EAAE,KAAK,MAAM,EAAE,QAAQ,CAAC;AAC1C,gBAAU,CAAC;AAAA,IACb;AAAA,IACA,CAAC,SAAS;AAAA,EACZ;AAEA,QAAM,aAAa;AAAA,IACjB,CAAC,MAAM;AACL,eAAS,KAAK;AACd,aAAO,CAAC;AAAA,IACV;AAAA,IACA,CAAC,MAAM;AAAA,EACT;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU,CAAC,QAAQ;AACjB,iBAAS,UAAU;AACnB,YAAI;AAAU,mBAAS,GAAG;AAAA,MAC5B;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,QAAQ;AAAA,MACR,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA,WAAW;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO;AAAA;AAAA,EACT;AAEJ;AAGA,IAAO,yBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback, useLayoutEffect, useRef, useState } from "react";
|
|
4
|
-
import { DSTextBox } from "../../TextBox";
|
|
5
|
-
import { setCaretPosition } from "../utils/setCaretPosition";
|
|
4
|
+
import { DSTextBox } from "../../TextBox/index.js";
|
|
5
|
+
import { setCaretPosition } from "../utils/setCaretPosition.js";
|
|
6
6
|
const conformValue = (rawValue, cursorPos, lastkeycode) => {
|
|
7
7
|
let nextMaskedValue = rawValue.split("+1").slice(-1)[0].split("").filter((char) => char >= "0" && char <= "9");
|
|
8
8
|
while (nextMaskedValue.length && nextMaskedValue[0] === "0")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/mask_types/PhoneInternationalInputMask.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport { DSTextBox } from '../../TextBox';\nimport type { TCharsToAdd } from '../types';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst conformValue = (rawValue, cursorPos, lastkeycode) => {\n let nextMaskedValue = rawValue\n .split('+1')\n .slice(-1)[0]\n .split('')\n .filter((char) => char >= '0' && char <= '9');\n\n while (nextMaskedValue.length && nextMaskedValue[0] === '0') 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
|
-
"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,
|
|
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
|
+
"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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AA,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,sCAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback, useLayoutEffect, useRef, useState } from "react";
|
|
4
|
-
import { DSTextBox } from "../../TextBox";
|
|
5
|
-
import { setCaretPosition } from "../utils/setCaretPosition";
|
|
4
|
+
import { DSTextBox } from "../../TextBox/index.js";
|
|
5
|
+
import { setCaretPosition } from "../utils/setCaretPosition.js";
|
|
6
6
|
const conformValue = (rawValue, cursorPos, lastkeycode) => {
|
|
7
7
|
const nextMaskedValue = rawValue.split("").filter((char) => char >= "0" && char <= "9").slice(0, 9);
|
|
8
8
|
let maskedPos = 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/mask_types/SsnInputMask.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport { DSTextBox } from '../../TextBox';\nimport type { TCharsToAdd } from '../types';\nimport { setCaretPosition } from '../utils/setCaretPosition';\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
|
-
"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,
|
|
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
|
+
"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,MA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;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,uBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback, useLayoutEffect, useRef, useState } from "react";
|
|
4
|
-
import { DSTextBox } from "../../TextBox";
|
|
5
|
-
import { setCaretPosition } from "../utils/setCaretPosition";
|
|
4
|
+
import { DSTextBox } from "../../TextBox/index.js";
|
|
5
|
+
import { setCaretPosition } from "../utils/setCaretPosition.js";
|
|
6
6
|
const conformValue = (rawValue, cursorPos) => {
|
|
7
7
|
const nextMaskedValue = rawValue.split("").filter((char) => char >= "0" && char <= "9").slice(0, 5);
|
|
8
8
|
let maskedPos = 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/mask_types/UsZipCodeInputMask.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport { DSTextBox } from '../../TextBox';\nimport { setCaretPosition } from '../utils/setCaretPosition';\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
|
-
"mappings": "AAAA,YAAY,WAAW;ACuHnB;AArHJ,SAAgB,aAAa,iBAAiB,QAAQ,gBAAgB;AAEtE,SAAS,iBAAiB;AAC1B,SAAS,wBAAwB;AAEjC,MAAM,eAAe,CAAC,UAAkB,cAAsB;AAC5D,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,
|
|
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
|
+
"mappings": "AAAA,YAAY,WAAW;ACuHnB;AArHJ,SAAgB,aAAa,iBAAiB,QAAQ,gBAAgB;AAEtE,SAAS,iBAAiB;AAC1B,SAAS,wBAAwB;AAEjC,MAAM,eAAe,CAAC,UAAkB,cAAsB;AAC5D,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;AACA,SAAO,EAAE,iBAAiB,gBAAgB,KAAK,EAAE,GAAG,UAAU;AAChE;AAEA,MAAM,qBAAqB,CAAC;AAAA,EAC1B;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;AAA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gB;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,6BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback, useLayoutEffect, useRef, useState } from "react";
|
|
4
|
-
import { DSTextBox } from "../../TextBox";
|
|
5
|
-
import { setCaretPosition } from "../utils/setCaretPosition";
|
|
4
|
+
import { DSTextBox } from "../../TextBox/index.js";
|
|
5
|
+
import { setCaretPosition } from "../utils/setCaretPosition.js";
|
|
6
6
|
const conformValue = (rawValue, cursorPos, lastkeycode) => {
|
|
7
7
|
const nextMaskedValue = rawValue.split("").filter((char) => char >= "0" && char <= "9").slice(0, 9);
|
|
8
8
|
let maskedPos = 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/mask_types/ZipCodeSearchInputMask.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport { DSTextBox } from '../../TextBox';\nimport type { TCharsToAdd } from '../types';\nimport { setCaretPosition } from '../utils/setCaretPosition';\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
|
-
"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,
|
|
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
|
+
"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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AA,MAC9D;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,iCAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { DateInputMask } from "./DateInputMask";
|
|
4
|
-
import { DateTimeInputMask } from "./DateTimeInputMask";
|
|
5
|
-
import { DictionaryInputMask } from "./DictionaryInputMask";
|
|
6
|
-
import { NumberInputMask } from "./NumberInputMask";
|
|
7
|
-
import { PhoneInputMask } from "./PhoneInputMask";
|
|
8
|
-
import { PhoneInternationalInputMask } from "./PhoneInternationalInputMask";
|
|
9
|
-
import { SsnInputMask } from "./SsnInputMask";
|
|
10
|
-
import { UsZipCodeInputMask } from "./UsZipCodeInputMask";
|
|
11
|
-
import { ZipCodeSearchInputMask } from "./ZipCodeSearchInputMask";
|
|
3
|
+
import { DateInputMask } from "./DateInputMask.js";
|
|
4
|
+
import { DateTimeInputMask } from "./DateTimeInputMask.js";
|
|
5
|
+
import { DictionaryInputMask } from "./DictionaryInputMask.js";
|
|
6
|
+
import { NumberInputMask } from "./NumberInputMask.js";
|
|
7
|
+
import { PhoneInputMask } from "./PhoneInputMask.js";
|
|
8
|
+
import { PhoneInternationalInputMask } from "./PhoneInternationalInputMask.js";
|
|
9
|
+
import { SsnInputMask } from "./SsnInputMask.js";
|
|
10
|
+
import { UsZipCodeInputMask } from "./UsZipCodeInputMask.js";
|
|
11
|
+
import { ZipCodeSearchInputMask } from "./ZipCodeSearchInputMask.js";
|
|
12
12
|
const dollarSign = "$";
|
|
13
13
|
const percentSign = "%";
|
|
14
14
|
const emptyString = "";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/InputMask/mask_types/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { DateInputMask } from './DateInputMask';\nimport { DateTimeInputMask } from './DateTimeInputMask';\nimport { DictionaryInputMask } from './DictionaryInputMask';\nimport { NumberInputMask } from './NumberInputMask';\nimport { PhoneInputMask } from './PhoneInputMask';\nimport { PhoneInternationalInputMask } from './PhoneInternationalInputMask';\nimport { SsnInputMask } from './SsnInputMask';\nimport { UsZipCodeInputMask } from './UsZipCodeInputMask';\nimport { ZipCodeSearchInputMask } from './ZipCodeSearchInputMask';\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
|
-
"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,
|
|
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
|
+
"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,MAAM,GAAG,KAAK,MAAM,oBAAC,uBAAoB,YAAyB,GAAG,MAAM;AAAA,EACjH,kBAAkB,CAAC;AAAA,IACjB,SAAS;AAAA,IACT,SAAS;AAAA,IACT,4BAA4B;AAAA,IAC5B,2BAA2B;AAAA,IAC3B,eAAe;AAAA,IACf,gBAAgB;AAAA,IAChB,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,gBAAgB;AAAA,IAChB,qBAAqB;AAAA,IACrB,eAAe;AAAA,IACf,GAAG;AAAA,EACL,MACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAAA,EAEF,mBAAmB,CAAC;AAAA,IAClB,SAAS;AAAA,IACT,SAAS;AAAA,IACT,4BAA4B;AAAA,IAC5B,2BAA2B;AAAA,IAC3B,eAAe;AAAA,IACf,gBAAgB;AAAA,IAChB,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,gBAAgB;AAAA,IAChB,qBAAqB;AAAA,IACrB,eAAe;AAAA,IACf,GAAG;AAAA,EACL,MACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAAA,EAEF,iBAAiB,CAAC,UAAU,oBAAC,kBAAgB,GAAG,OAAO;AAAA,EACvD,+BAA+B,CAAC,UAAU,oBAAC,+BAA6B,GAAG,OAAO;AAAA,EAClF,eAAe,CAAC,UAAU,oBAAC,gBAAc,GAAG,OAAO;AAAA,EACnD,uBAAuB,CAAC,UAAU,oBAAC,sBAAoB,GAAG,OAAO;AAAA,EACjE,2BAA2B,CAAC,UAAU,oBAAC,0BAAwB,GAAG,OAAO;AAC3E;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,41 +1,121 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { PropTypes } from "@elliemae/ds-props-helpers";
|
|
3
3
|
const inputProps = {
|
|
4
|
+
/** Should component focus automatically */
|
|
4
5
|
autoFocus: PropTypes.bool.description("Should component focus automatically"),
|
|
6
|
+
/**
|
|
7
|
+
* Set style for the input mask
|
|
8
|
+
*/
|
|
5
9
|
style: PropTypes.object.description("Set style for the input mask"),
|
|
10
|
+
/**
|
|
11
|
+
* Whether the input mask is disabled or not
|
|
12
|
+
*/
|
|
6
13
|
disabled: PropTypes.bool.description("Whether the input mask is disabled or not"),
|
|
14
|
+
/** disableTooltip */
|
|
7
15
|
disableTooltip: PropTypes.bool.description("Whether to show a tooltip or not when text does not fit").defaultValue(true),
|
|
16
|
+
/** css class */
|
|
8
17
|
className: PropTypes.string.description("css class"),
|
|
18
|
+
/** html name prop for form */
|
|
9
19
|
name: PropTypes.string.description("html name prop for form"),
|
|
20
|
+
/**
|
|
21
|
+
* Max length for the input mask
|
|
22
|
+
*/
|
|
10
23
|
maxLength: PropTypes.number.description("Max length for the input mask"),
|
|
24
|
+
/**
|
|
25
|
+
* Min length for the input mask
|
|
26
|
+
*/
|
|
11
27
|
minLength: PropTypes.number.description("Min length for the input mask"),
|
|
28
|
+
/**
|
|
29
|
+
* Whether to make the content of the input mask fit the container or not
|
|
30
|
+
*/
|
|
12
31
|
fluidWidth: PropTypes.bool.description("Whether to make the content of the input mask fit the container or not"),
|
|
32
|
+
/** isShowElipsisActive */
|
|
13
33
|
isShowElipsisActive: PropTypes.bool.description("Wheter to enable the ellipsis and tooltip functionality or not").defaultValue(true),
|
|
34
|
+
/**
|
|
35
|
+
* Component that works as placeholder
|
|
36
|
+
*/
|
|
14
37
|
placeholder: PropTypes.node.description("Component that works as placeholder"),
|
|
38
|
+
/**
|
|
39
|
+
* Allows a function that is triggered once a key is being pressed
|
|
40
|
+
*/
|
|
15
41
|
onKeyDown: PropTypes.func.description("Allows a function that is triggered once a key is being pressed"),
|
|
42
|
+
/**
|
|
43
|
+
* Allows a function that is triggered once the input mask is clicked
|
|
44
|
+
*/
|
|
16
45
|
onClick: PropTypes.func.description("Allows a function that is triggered once the input mask is clicked"),
|
|
46
|
+
/**
|
|
47
|
+
* Allows a function that is triggered once the input mask changes
|
|
48
|
+
*/
|
|
17
49
|
onChange: PropTypes.func.description("Allows a function that is triggered once the input mask changes"),
|
|
50
|
+
/**
|
|
51
|
+
* Allows a function that is triggered once the input mask is focused
|
|
52
|
+
*/
|
|
18
53
|
onFocus: PropTypes.func.description("Allows a function that is triggered once the input mask is focused"),
|
|
54
|
+
/**
|
|
55
|
+
* Allows a function that is triggered once the input mask loses focus
|
|
56
|
+
*/
|
|
19
57
|
onBlur: PropTypes.func.description("Allows a function that is triggered once the input mask loses focus"),
|
|
58
|
+
/**
|
|
59
|
+
* Allows a function that is triggered once the input mask is pasted
|
|
60
|
+
*/
|
|
20
61
|
onPaste: PropTypes.func.description("Allows a function that is triggered once the input mask is pasted"),
|
|
62
|
+
/**
|
|
63
|
+
* Allows a function that is triggered once in the input mask a keyboard key is released
|
|
64
|
+
*/
|
|
21
65
|
onKeyUp: PropTypes.func.description(
|
|
22
66
|
"Allows a function that is triggered once in the input mask a keyboard key is released"
|
|
23
67
|
),
|
|
68
|
+
/**
|
|
69
|
+
* Default value once the component is initialized
|
|
70
|
+
*/
|
|
24
71
|
value: PropTypes.string.description("Default value once the component is initialized"),
|
|
72
|
+
/**
|
|
73
|
+
* Whether the input mask has error or not
|
|
74
|
+
*/
|
|
25
75
|
hasError: PropTypes.bool.description("Whether the input mask has error or not"),
|
|
76
|
+
/**
|
|
77
|
+
* Whether the input mask is read only or not
|
|
78
|
+
*/
|
|
26
79
|
readOnly: PropTypes.bool.description("Whether the input mask is read only or not"),
|
|
27
80
|
innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]).description(
|
|
28
81
|
"Whether the input mask is read only or not"
|
|
29
82
|
),
|
|
83
|
+
/**
|
|
84
|
+
* Type of input. Ex: 'text'
|
|
85
|
+
*/
|
|
30
86
|
type: PropTypes.string.description("Type of input. Ex: 'text'"),
|
|
87
|
+
/**
|
|
88
|
+
* Whether the input mask is clearable or not
|
|
89
|
+
*/
|
|
31
90
|
clearable: PropTypes.bool.description("Whether the input mask is clearable or not"),
|
|
91
|
+
/**
|
|
92
|
+
* Component to be added at the right side of the input
|
|
93
|
+
*/
|
|
32
94
|
leftComponent: PropTypes.node.description("Component to be added at the right side of the input"),
|
|
95
|
+
/**
|
|
96
|
+
* Component to be added at the right side of the input
|
|
97
|
+
*/
|
|
33
98
|
rightComponent: PropTypes.node.description("Component to be added at the right side of the input"),
|
|
99
|
+
/**
|
|
100
|
+
* Mask that has to match with the input information entered
|
|
101
|
+
* ['DATE', 'PHONE', 'PHONE_INTENATIONAL', 'SSN', 'US_ZIP_CODE', 'NUMBER', 'PERCENT']
|
|
102
|
+
*/
|
|
34
103
|
mask: PropTypes.oneOfType([PropTypes.array, PropTypes.string, PropTypes.func, PropTypes.object]).description(
|
|
35
104
|
"Mask that has to match with the input information entered. ['DATE', 'PHONE', 'PHONE_INTENATIONAL', 'SSN', 'US_ZIP_CODE', 'NUMBER', 'PERCENT', 'ZIP_CODE_SEARCH']"
|
|
36
105
|
),
|
|
106
|
+
/**
|
|
107
|
+
Expects pipe functions. i.e. autoCorrectedDatePipe
|
|
108
|
+
link a docu de text-mask
|
|
109
|
+
*/
|
|
37
110
|
pipe: PropTypes.func.description("Expects pipe functions. i.e. autoCorrectedDatePipe"),
|
|
111
|
+
/**
|
|
112
|
+
* Put a sufix after the input mask
|
|
113
|
+
*/
|
|
38
114
|
useSubfix: PropTypes.string.description("Put a sufix after the input mask"),
|
|
115
|
+
/**
|
|
116
|
+
* The placeholder character represents the fillable spot in the mask.
|
|
117
|
+
* The default placeholder character is underscore, _
|
|
118
|
+
*/
|
|
39
119
|
placeholderChar: PropTypes.string.description(
|
|
40
120
|
`The placeholder character represents the fillable spot in the mask.
|
|
41
121
|
The default placeholder character is underscore, _.`
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
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"],
|
|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Y,oDAAoD;AAAA;AAAA;AAAA;AAAA,EAIrF,WAAW,UAAU,OAAO,YAAY,kCAAkC;AAAA;AAAA;AAAA;AAAA;AAAA,EAK1E,iBAAiB,UAAU,OACxB;AAAA,IACC;AAAA;AAAA,EAEF,EACC,aAAa,GAAG;AACrB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -5,11 +5,11 @@ import { useDeprecateComponent } from "@elliemae/ds-utilities";
|
|
|
5
5
|
import { describe } from "@elliemae/ds-props-helpers";
|
|
6
6
|
import { LockUnlocked, LockLocked, VisibleView, InvisibleHide } from "@elliemae/ds-icons";
|
|
7
7
|
import { DSButton } from "@elliemae/ds-button";
|
|
8
|
-
import { DSInputGroup } from "../InputGroup";
|
|
9
|
-
import { DSInputMask } from "../InputMask";
|
|
10
|
-
import { inputProtectedProps } from "./props";
|
|
11
|
-
import { defaultProps } from "./defaultProps";
|
|
12
|
-
import { LEFT_ADDON_OPTIONS, RIGHT_ADDON_OPTIONS } from "./options";
|
|
8
|
+
import { DSInputGroup } from "../InputGroup/index.js";
|
|
9
|
+
import { DSInputMask } from "../InputMask/index.js";
|
|
10
|
+
import { inputProtectedProps } from "./props.js";
|
|
11
|
+
import { defaultProps } from "./defaultProps.js";
|
|
12
|
+
import { LEFT_ADDON_OPTIONS, RIGHT_ADDON_OPTIONS } from "./options.js";
|
|
13
13
|
const ADDON_ICON_OPTIONS = {
|
|
14
14
|
LockUnlocked: /* @__PURE__ */ jsx(LockUnlocked, {}),
|
|
15
15
|
LockLocked: /* @__PURE__ */ jsx(LockLocked, {}),
|