@elliemae/ds-form 3.16.0-next.2 → 3.16.0-next.21
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 +10 -6
- 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 +35 -13
- 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 +11 -5
- 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 +63 -17
- package/dist/cjs/DateInput/props.js.map +2 -2
- package/dist/cjs/DateInputV2/components/DSDateInput.js +9 -5
- package/dist/cjs/DateInputV2/components/DSDateInput.js.map +2 -2
- package/dist/cjs/DateInputV2/components/DateInputs.js +11 -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 +45 -11
- package/dist/cjs/DateInputV2/components/props.js.map +2 -2
- 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 +16 -8
- package/dist/cjs/FormItem/DSFormItemLayout.js.map +2 -2
- package/dist/cjs/FormItem/Error/DSError.js +10 -4
- package/dist/cjs/FormItem/Error/DSError.js.map +2 -2
- 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 +89 -45
- 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 +25 -16
- 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 +27 -8
- package/dist/cjs/InputGroup/props.js.map +2 -2
- package/dist/cjs/InputMask/DSInputMask.js +13 -7
- 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 +115 -31
- package/dist/cjs/InputMask/props.js.map +2 -2
- 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 +12 -6
- 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 +18 -10
- package/dist/cjs/InputProtected/props.js.map +2 -2
- package/dist/cjs/LargeInputText/DSLargeInputText.js +9 -3
- 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 +98 -28
- package/dist/cjs/LargeInputText/props.js.map +2 -2
- 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 +52 -16
- 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 +10 -6
- 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 +31 -11
- package/dist/cjs/RadioGroup/props.js.map +2 -2
- 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 +42 -15
- 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 +70 -29
- 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 +5 -5
- 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 +20 -2
- 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 +7 -5
- 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 +43 -1
- package/dist/esm/DateInput/props.js.map +2 -2
- package/dist/esm/DateInputV2/components/DSDateInput.js +4 -4
- package/dist/esm/DateInputV2/components/DSDateInput.js.map +1 -1
- package/dist/esm/DateInputV2/components/DateInputs.js +7 -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 +31 -1
- package/dist/esm/DateInputV2/components/props.js.map +2 -2
- 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 +12 -8
- package/dist/esm/FormItem/DSFormItemLayout.js.map +2 -2
- package/dist/esm/FormItem/Error/DSError.js +3 -1
- package/dist/esm/FormItem/Error/DSError.js.map +2 -2
- 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 +42 -2
- package/dist/esm/FormItem/props.js.map +2 -2
- package/dist/esm/InputGroup/DSInputGroup.js +21 -16
- 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 +16 -1
- package/dist/esm/InputGroup/props.js.map +2 -2
- package/dist/esm/InputMask/DSInputMask.js +9 -7
- 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 +81 -1
- package/dist/esm/InputMask/props.js.map +2 -2
- package/dist/esm/InputProtected/DSInputProtected.js +8 -6
- 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 +6 -2
- package/dist/esm/InputProtected/props.js.map +2 -2
- package/dist/esm/LargeInputText/DSLargeInputText.js +5 -3
- package/dist/esm/LargeInputText/DSLargeInputText.js.map +2 -2
- package/dist/esm/LargeInputText/index.js +1 -1
- package/dist/esm/LargeInputText/index.js.map +1 -1
- package/dist/esm/LargeInputText/props.js +67 -1
- package/dist/esm/LargeInputText/props.js.map +2 -2
- package/dist/esm/Radio/Circle.js.map +1 -1
- package/dist/esm/Radio/DSRadio.js +34 -2
- 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 +5 -5
- 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 +17 -1
- package/dist/esm/RadioGroup/props.js.map +2 -2
- package/dist/esm/RequiredMark/index.js +1 -1
- package/dist/esm/RequiredMark/index.js.map +1 -1
- package/dist/esm/TimeInput/DSTimeInput.js +26 -3
- 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 +55 -18
- 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 +19 -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
|
@@ -4,7 +4,7 @@ import { useRef, useMemo } from "react";
|
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
5
|
import Moment from "moment";
|
|
6
6
|
import { aggregatedClasses } from "@elliemae/ds-classnames";
|
|
7
|
-
import { DateInputs } from "./DateInputs";
|
|
7
|
+
import { DateInputs } from "./DateInputs.js";
|
|
8
8
|
const blockName = "input-time";
|
|
9
9
|
const DateInputContainer = aggregatedClasses("div")(blockName);
|
|
10
10
|
const getVisibleTimeByFormat = (format) => ({
|
|
@@ -25,6 +25,7 @@ const DateInputImpl = ({
|
|
|
25
25
|
yearMaxRange,
|
|
26
26
|
yearMinRange,
|
|
27
27
|
onFocus,
|
|
28
|
+
// eslint-disable-next-line react/prop-types
|
|
28
29
|
INTERNAL_V2_NO_MUTATION
|
|
29
30
|
}) => {
|
|
30
31
|
const inputContainerRef = useRef();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/DateInput/components/DateInputImpl.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useRef, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport Moment from 'moment';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { DateInputs } from './DateInputs';\n\nconst blockName = 'input-time';\n\nconst DateInputContainer = aggregatedClasses('div')(blockName);\n\nconst getVisibleTimeByFormat = (format) => ({\n showMonth: format.indexOf('MM') > -1 || format.indexOf('M') > -1,\n showDay: format.indexOf('DD') > -1 || format.indexOf('D') > -1,\n showYear: format.indexOf('YYYY') > -1,\n});\n\nconst DateInputImpl = ({\n format,\n innerRef,\n onBlur,\n onChange,\n onKeyDown,\n onError,\n className,\n value,\n disabled,\n yearMaxRange,\n yearMinRange,\n onFocus,\n // eslint-disable-next-line react/prop-types\n INTERNAL_V2_NO_MUTATION,\n}) => {\n const inputContainerRef = useRef();\n\n const handleFocus = (e) => {\n onFocus();\n if (!e.target.type) {\n inputContainerRef.current.querySelector('input').focus();\n }\n };\n\n const visibleInputs = useMemo(() => getVisibleTimeByFormat(format), [format]);\n\n return (\n <DateInputContainer className={className} disabled={disabled} innerRef={innerRef} onClick={handleFocus}>\n <DateInputs\n disabled={disabled}\n format={format}\n INTERNAL_V2_NO_MUTATION={INTERNAL_V2_NO_MUTATION}\n innerRef={inputContainerRef}\n onBlur={onBlur}\n onChange={onChange}\n onCustomKeyDown={onKeyDown}\n onError={onError}\n time={value}\n yearMaxRange={yearMaxRange}\n yearMinRange={yearMinRange}\n {...visibleInputs}\n />\n </DateInputContainer>\n );\n};\n\nDateInputImpl.propTypes = {\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]),\n onBlur: PropTypes.bool,\n onChange: PropTypes.func,\n onKeyDown: PropTypes.func,\n onError: PropTypes.func,\n format: PropTypes.string,\n showMonth: PropTypes.bool,\n className: PropTypes.string,\n showDay: PropTypes.bool,\n showYear: PropTypes.bool,\n step: PropTypes.number,\n onFocus: PropTypes.func,\n yearMaxRange: PropTypes.number,\n disabled: PropTypes.bool,\n yearMinRange: PropTypes.number,\n value: PropTypes.instanceOf(Moment),\n};\n\nexport { DateInputImpl };\nexport default DateInputImpl;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;AC6CjB;AA7CN,SAAgB,QAAQ,eAAe;AACvC,OAAO,eAAe;AACtB,OAAO,YAAY;AACnB,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAE3B,MAAM,YAAY;AAElB,MAAM,qBAAqB,kBAAkB,KAAK,EAAE,SAAS;AAE7D,MAAM,yBAAyB,CAAC,YAAY;AAAA,EAC1C,WAAW,OAAO,QAAQ,IAAI,IAAI,MAAM,OAAO,QAAQ,GAAG,IAAI;AAAA,EAC9D,SAAS,OAAO,QAAQ,IAAI,IAAI,MAAM,OAAO,QAAQ,GAAG,IAAI;AAAA,EAC5D,UAAU,OAAO,QAAQ,MAAM,IAAI;AACrC;AAEA,MAAM,gBAAgB,CAAC;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AACF,MAAM;AACJ,QAAM,oBAAoB,OAAO;AAEjC,QAAM,cAAc,CAAC,MAAM;AACzB,YAAQ;AACR,QAAI,CAAC,EAAE,OAAO,MAAM;AAClB,wBAAkB,QAAQ,cAAc,OAAO,EAAE,MAAM;AAAA,IACzD;AAAA,EACF;AAEA,QAAM,gBAAgB,QAAQ,MAAM,uBAAuB,MAAM,GAAG,CAAC,MAAM,CAAC;AAE5E,SACE,oBAAC,sBAAmB,WAAsB,UAAoB,UAAoB,SAAS,aACzF;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA,iBAAiB;AAAA,MACjB;AAAA,MACA,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACC,GAAG;AAAA;AAAA,EACN,GACF;AAEJ;AAEA,cAAc,YAAY;AAAA,EACxB,UAAU,UAAU,UAAU,CAAC,UAAU,MAAM,UAAU,MAAM,EAAE,SAAS,UAAU,IAAI,CAAC,CAAC,CAAC;AAAA,EAC3F,QAAQ,UAAU;AAAA,EAClB,UAAU,UAAU;AAAA,EACpB,WAAW,UAAU;AAAA,EACrB,SAAS,UAAU;AAAA,EACnB,QAAQ,UAAU;AAAA,EAClB,WAAW,UAAU;AAAA,EACrB,WAAW,UAAU;AAAA,EACrB,SAAS,UAAU;AAAA,EACnB,UAAU,UAAU;AAAA,EACpB,MAAM,UAAU;AAAA,EAChB,SAAS,UAAU;AAAA,EACnB,cAAc,UAAU;AAAA,EACxB,UAAU,UAAU;AAAA,EACpB,cAAc,UAAU;AAAA,EACxB,OAAO,UAAU,WAAW,MAAM;AACpC;AAGA,IAAO,wBAAQ;",
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useRef, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport Moment from 'moment';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { DateInputs } from './DateInputs.js';\n\nconst blockName = 'input-time';\n\nconst DateInputContainer = aggregatedClasses('div')(blockName);\n\nconst getVisibleTimeByFormat = (format) => ({\n showMonth: format.indexOf('MM') > -1 || format.indexOf('M') > -1,\n showDay: format.indexOf('DD') > -1 || format.indexOf('D') > -1,\n showYear: format.indexOf('YYYY') > -1,\n});\n\nconst DateInputImpl = ({\n format,\n innerRef,\n onBlur,\n onChange,\n onKeyDown,\n onError,\n className,\n value,\n disabled,\n yearMaxRange,\n yearMinRange,\n onFocus,\n // eslint-disable-next-line react/prop-types\n INTERNAL_V2_NO_MUTATION,\n}) => {\n const inputContainerRef = useRef();\n\n const handleFocus = (e) => {\n onFocus();\n if (!e.target.type) {\n inputContainerRef.current.querySelector('input').focus();\n }\n };\n\n const visibleInputs = useMemo(() => getVisibleTimeByFormat(format), [format]);\n\n return (\n <DateInputContainer className={className} disabled={disabled} innerRef={innerRef} onClick={handleFocus}>\n <DateInputs\n disabled={disabled}\n format={format}\n INTERNAL_V2_NO_MUTATION={INTERNAL_V2_NO_MUTATION}\n innerRef={inputContainerRef}\n onBlur={onBlur}\n onChange={onChange}\n onCustomKeyDown={onKeyDown}\n onError={onError}\n time={value}\n yearMaxRange={yearMaxRange}\n yearMinRange={yearMinRange}\n {...visibleInputs}\n />\n </DateInputContainer>\n );\n};\n\nDateInputImpl.propTypes = {\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]),\n onBlur: PropTypes.bool,\n onChange: PropTypes.func,\n onKeyDown: PropTypes.func,\n onError: PropTypes.func,\n format: PropTypes.string,\n showMonth: PropTypes.bool,\n className: PropTypes.string,\n showDay: PropTypes.bool,\n showYear: PropTypes.bool,\n step: PropTypes.number,\n onFocus: PropTypes.func,\n yearMaxRange: PropTypes.number,\n disabled: PropTypes.bool,\n yearMinRange: PropTypes.number,\n value: PropTypes.instanceOf(Moment),\n};\n\nexport { DateInputImpl };\nexport default DateInputImpl;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC6CjB;AA7CN,SAAgB,QAAQ,eAAe;AACvC,OAAO,eAAe;AACtB,OAAO,YAAY;AACnB,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAE3B,MAAM,YAAY;AAElB,MAAM,qBAAqB,kBAAkB,KAAK,E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UAAU;AAAA,EACrB,SAAS,UAAU;AAAA,EACnB,UAAU,UAAU;AAAA,EACpB,MAAM,UAAU;AAAA,EAChB,SAAS,UAAU;AAAA,EACnB,cAAc,UAAU;AAAA,EACxB,UAAU,UAAU;AAAA,EACpB,cAAc,UAAU;AAAA,EACxB,OAAO,UAAU,WAAW,MAAM;AACpC;AAGA,IAAO,wBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
handleCompletedDate,
|
|
23
23
|
triggerOnBlur,
|
|
24
24
|
isTimeCompletelySet
|
|
25
|
-
} from "./utils";
|
|
25
|
+
} from "./utils.js";
|
|
26
26
|
const blockName = "input-date-group";
|
|
27
27
|
const InputTimesGroup = aggregatedClasses("div")(blockName);
|
|
28
28
|
const MonthInput = aggregatedClasses("input")(blockName, "input input-month");
|
|
@@ -47,7 +47,9 @@ const DateInputs = ({
|
|
|
47
47
|
disabled,
|
|
48
48
|
yearMinRange,
|
|
49
49
|
time,
|
|
50
|
+
// TODO remove and keep `true` behavior ( PUI-4141 )
|
|
50
51
|
INTERNAL_V2_NO_MUTATION
|
|
52
|
+
// eslint-disable-line react/prop-types
|
|
51
53
|
}) => {
|
|
52
54
|
const [currentKey, setCurrentKey] = useState("ArrowUp");
|
|
53
55
|
const [month, setMonth] = useState("");
|
|
@@ -296,6 +298,7 @@ const DateInputs = ({
|
|
|
296
298
|
return [
|
|
297
299
|
inputsWithDividers,
|
|
298
300
|
React2.createElement("span", { key: "span" })
|
|
301
|
+
// hack for next/prev focus
|
|
299
302
|
];
|
|
300
303
|
};
|
|
301
304
|
return /* @__PURE__ */ jsx(InputTimesGroup, { innerRef, children: renderDateInputs() });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/DateInput/components/DateInputs.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable import/no-unresolved */\n/* eslint-disable indent */\n/* eslint-disable react/no-array-index-key */\n/* eslint-disable max-lines */\n/* eslint-disable max-statements */\nimport React, { useState, useEffect, useCallback } from 'react';\nimport PropTypes from 'prop-types';\nimport Moment from 'moment';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { usePrevious } from '@elliemae/ds-utilities';\nimport {\n formatMonth,\n formatDay,\n formatYear,\n getValidTimeNumber,\n setNativeValue,\n parseTimeNumberFromText,\n focusNextInput,\n focusPreviousInput,\n getDateValuesFromTime,\n getNextTimeValue,\n focusNextInputIfNeeded,\n commonInputProps,\n handleCompletedDate,\n triggerOnBlur,\n isTimeCompletelySet,\n} from './utils';\n\nconst blockName = 'input-date-group';\n\nconst InputTimesGroup = aggregatedClasses('div')(blockName);\nconst MonthInput = aggregatedClasses('input')(blockName, 'input input-month');\nconst DayInput = aggregatedClasses('input')(blockName, 'input input-day');\nconst YearInput = aggregatedClasses('input')(blockName, 'input input-year');\nconst Divider = aggregatedClasses('span')(blockName, 'divider', ({ value }) => ({\n value,\n}));\n\n// eslint-disable-next-line react/prop-types\nconst DateDivider = ({ content = ':', value = '' }) => <Divider value={!!value}>{content}</Divider>;\n\nconst DateInputs = ({\n innerRef,\n onBlur,\n onChange,\n onCustomKeyDown,\n onError,\n format = '',\n showMonth = true,\n showDay = true,\n showYear = true,\n step = 1,\n yearMaxRange,\n disabled,\n yearMinRange,\n time,\n // TODO remove and keep `true` behavior ( PUI-4141 )\n INTERNAL_V2_NO_MUTATION, // eslint-disable-line react/prop-types\n}) => {\n const [currentKey, setCurrentKey] = useState('ArrowUp');\n const [month, setMonth] = useState('');\n const [day, setDay] = useState('');\n const [year, setYear] = useState('');\n const prevTime = usePrevious(time);\n const prevFormat = usePrevious(format);\n\n let digits = 2;\n let placeholder = '';\n\n useEffect(() => {\n if (time) {\n const dateValues = getDateValuesFromTime(time, format);\n setMonth(dateValues.month);\n setDay(dateValues.day);\n setYear(dateValues.year);\n }\n }, [format, time]);\n\n useEffect(() => {\n if (!time && prevTime) {\n setMonth('');\n setDay('');\n setYear('');\n onChange('');\n }\n if (time && prevTime && time.format && time.format(format) !== prevTime.format(prevFormat)) {\n const dateValues = getDateValuesFromTime(time, format);\n\n setMonth(dateValues.month);\n setDay(dateValues.day);\n setYear(dateValues.year);\n }\n }, [time, prevTime, format, prevFormat, onChange]);\n\n const isCompletedDate = useCallback(\n () => isTimeCompletelySet({ year, month, day }, { showYear, showMonth, showDay }, { yearMinRange, yearMaxRange }),\n [day, month, showDay, showMonth, showYear, year, yearMaxRange, yearMinRange],\n );\n\n useEffect(() => {\n if (INTERNAL_V2_NO_MUTATION) {\n const dateValues = getDateValuesFromTime(time, format);\n\n if (dateValues.day !== day && isCompletedDate()) {\n onChange(\n handleCompletedDate(time, { year, month, day }, { showYear, showMonth, showDay }, INTERNAL_V2_NO_MUTATION),\n );\n } else if (dateValues.month !== month && isCompletedDate()) {\n onChange(\n handleCompletedDate(time, { year, month, day }, { showYear, showMonth, showDay }, INTERNAL_V2_NO_MUTATION),\n );\n } else if (dateValues.year !== year && isCompletedDate()) {\n onChange(\n handleCompletedDate(time, { year, month, day }, { showYear, showMonth, showDay }, INTERNAL_V2_NO_MUTATION),\n );\n }\n }\n }, [\n INTERNAL_V2_NO_MUTATION,\n day,\n format,\n isCompletedDate,\n month,\n onChange,\n showDay,\n showMonth,\n showYear,\n time,\n year,\n ]);\n\n const triggerChange = () =>\n handleCompletedDate(time, { year, month, day }, { showYear, showMonth, showDay }, INTERNAL_V2_NO_MUTATION);\n\n const handleYearChange = (e) => {\n const { value } = e.target;\n const yearValue = parseTimeNumberFromText(value);\n const yearRange = { min: 1, max: 9999 };\n const nextYear = getValidTimeNumber(yearRange, yearValue, value, onError);\n\n setYear(formatYear(format, nextYear));\n if (isCompletedDate() && !INTERNAL_V2_NO_MUTATION) {\n onChange(triggerChange());\n }\n focusNextInputIfNeeded(e.target, yearRange.max, nextYear, value, currentKey);\n };\n\n const handleMonthChange = (e) => {\n const { value } = e.target;\n const monthValue = parseTimeNumberFromText(value);\n const monthRange = { min: 1, max: 12 };\n const nextMonth = getValidTimeNumber(monthRange, monthValue, value, onError);\n setMonth(formatMonth(format, nextMonth));\n if (isCompletedDate() && !INTERNAL_V2_NO_MUTATION) {\n onChange(triggerChange());\n }\n focusNextInputIfNeeded(e.target, monthRange.max, nextMonth, value, currentKey);\n };\n\n const handleDayChange = (e) => {\n const { value } = e.target;\n const dayValue = parseTimeNumberFromText(value);\n const dayRange = { min: 1, max: 31 };\n const nextDay = getValidTimeNumber(dayRange, dayValue, value, onError);\n setDay(formatDay(format, nextDay));\n if (isCompletedDate() && !INTERNAL_V2_NO_MUTATION) {\n onChange(triggerChange());\n }\n if (value !== day) focusNextInputIfNeeded(e.target, dayRange.max, nextDay, value, currentKey);\n };\n\n // eslint-disable-next-line complexity\n const onKeyDown = (event, shouldIncrementDecrement = true) => {\n const { value, name } = event.target;\n const change = {\n day: (v) => handleDayChange({ target: { value: v } }),\n month: (v) => handleMonthChange({ target: { value: v } }),\n year: (v) => handleYearChange({ target: { value: v } }),\n };\n switch (event.key) {\n case 'ArrowLeft': {\n event.preventDefault();\n focusPreviousInput(event.target);\n break;\n }\n case 'ArrowUp': {\n if (shouldIncrementDecrement) {\n event.preventDefault();\n setCurrentKey(event.key);\n const incrementedValue = getNextTimeValue(value, name, yearMinRange, yearMaxRange, step, true);\n if (INTERNAL_V2_NO_MUTATION) {\n change[name](incrementedValue);\n } else {\n setNativeValue(event.target, incrementedValue);\n }\n }\n break;\n }\n case 'ArrowDown': {\n if (shouldIncrementDecrement) {\n event.preventDefault();\n setCurrentKey(event.key);\n const decrementedValue = getNextTimeValue(value, name, yearMinRange, yearMaxRange, step, false);\n if (INTERNAL_V2_NO_MUTATION) {\n change[name](decrementedValue);\n } else {\n setNativeValue(event.target, decrementedValue);\n }\n }\n break;\n }\n case 'ArrowRight': {\n event.preventDefault();\n focusNextInput(event.target);\n break;\n }\n case 'Backspace': {\n event.preventDefault();\n if (!value) {\n focusPreviousInput(event.target);\n } else {\n // eslint-disable-next-line no-lonely-if\n if (INTERNAL_V2_NO_MUTATION) {\n change[name]('');\n } else {\n setNativeValue(event.target, '');\n }\n }\n break;\n }\n case 'Enter': {\n if (onCustomKeyDown && isCompletedDate()) onCustomKeyDown(event, triggerChange());\n setCurrentKey(null);\n break;\n }\n default:\n if (onCustomKeyDown) onCustomKeyDown(event);\n setCurrentKey(null);\n }\n };\n\n const renderMonthInput = () => {\n if (!showMonth) return null;\n placeholder = 'MM';\n const onMonthInputBlur = (e) => {\n handleMonthChange(e);\n triggerOnBlur(e, onBlur);\n };\n return (\n <MonthInput\n {...commonInputProps(digits, onKeyDown, placeholder)}\n autocomplete=\"off\"\n key=\"month-input\"\n data-testid=\"month\"\n disabled={disabled}\n name=\"month\"\n onBlur={onMonthInputBlur}\n onChange={handleMonthChange}\n value={month}\n />\n );\n };\n const renderDayInput = () => {\n if (!showDay) return null;\n placeholder = 'DD';\n const onDayInputBlur = (e) => {\n handleDayChange(e);\n triggerOnBlur(e, onBlur);\n };\n return (\n <DayInput\n {...commonInputProps(digits, onKeyDown, placeholder)}\n autocomplete=\"off\"\n key=\"day-input\"\n data-testid=\"day\"\n disabled={disabled}\n name=\"day\"\n onBlur={onDayInputBlur}\n onChange={handleDayChange}\n value={day}\n />\n );\n };\n const renderYearInput = () => {\n if (!showYear) return null;\n placeholder = 'YY';\n digits = 4;\n const onYearInputBlur = (e) => {\n handleYearChange(e);\n triggerOnBlur(e, onBlur);\n };\n return (\n <YearInput\n {...commonInputProps(digits, onKeyDown, placeholder)}\n autocomplete=\"off\"\n key=\"seconds-input\"\n data-testid=\"year\"\n disabled={disabled}\n name=\"year\"\n onBlur={onYearInputBlur}\n onChange={handleYearChange}\n value={year}\n />\n );\n };\n\n const renderDateInputs = () => {\n const inputs = [renderMonthInput(), renderDayInput(), renderYearInput()];\n const inputsWithDividers = inputs.reduce(\n (acc, input, index) =>\n input\n ? acc.concat([index ? <DateDivider key={index} content=\" / \" value={input.props.value} /> : null, input])\n : acc,\n [],\n );\n\n return [\n inputsWithDividers,\n React.createElement('span', { key: 'span' }), // hack for next/prev focus\n ];\n };\n\n return <InputTimesGroup innerRef={innerRef}>{renderDateInputs()}</InputTimesGroup>;\n};\n\nDateInputs.propTypes = {\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]),\n onBlur: PropTypes.bool,\n onChange: PropTypes.func,\n onCustomKeyDown: PropTypes.func,\n onError: PropTypes.func,\n format: PropTypes.string,\n showMonth: PropTypes.bool,\n showDay: PropTypes.bool,\n showYear: PropTypes.bool,\n step: PropTypes.number,\n yearMaxRange: PropTypes.number,\n disabled: PropTypes.bool,\n yearMinRange: PropTypes.number,\n time: PropTypes.instanceOf(Moment),\n};\n\nexport { DateInputs };\nexport default DateInputs;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACuCgC;AAkNjD;AApPN,OAAOA,UAAS,UAAU,WAAW,mBAAmB;AACxD,OAAO,eAAe;AACtB,OAAO,YAAY;AACnB,SAAS,yBAAyB;AAClC,SAAS,mBAAmB;AAC5B;AAAA,EACE;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,OACK;AAEP,MAAM,YAAY;AAElB,MAAM,kBAAkB,kBAAkB,KAAK,EAAE,SAAS;AAC1D,MAAM,aAAa,kBAAkB,OAAO,EAAE,WAAW,mBAAmB;AAC5E,MAAM,WAAW,kBAAkB,OAAO,EAAE,WAAW,iBAAiB;AACxE,MAAM,YAAY,kBAAkB,OAAO,EAAE,WAAW,kBAAkB;AAC1E,MAAM,UAAU,kBAAkB,MAAM,EAAE,WAAW,WAAW,CAAC,EAAE,MAAM,OAAO;AAAA,EAC9E;AACF,EAA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AM,kBAAkB,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,CAAC;AAAA,MACxD,MAAM,CAAC,MAAM,iBAAiB,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,CAAC;AAAA,IACxD;AACA,YAAQ,MAAM,KAAK;AAAA,MACjB,KAAK,aAAa;AAChB,cAAM,eAAe;AACrB,2BAAmB,MAAM,MAAM;AAC/B;AAAA,MACF;AAAA,MACA,KAAK,WAAW;AACd,YAAI,0BAA0B;AAC5B,gBAAM,eAAe;AACrB,wBAAc,MAAM,GAAG;AACvB,gBAAM,mBAAmB,iBAAiB,OAAO,MAAM,cAAc,cAAc,MAAM,IAAI;AAC7F,cAAI,yBAAyB;AAC3B,mBAAO,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable import/no-unresolved */\n/* eslint-disable indent */\n/* eslint-disable react/no-array-index-key */\n/* eslint-disable max-lines */\n/* eslint-disable max-statements */\nimport React, { useState, useEffect, useCallback } from 'react';\nimport PropTypes from 'prop-types';\nimport Moment from 'moment';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { usePrevious } from '@elliemae/ds-utilities';\nimport {\n formatMonth,\n formatDay,\n formatYear,\n getValidTimeNumber,\n setNativeValue,\n parseTimeNumberFromText,\n focusNextInput,\n focusPreviousInput,\n getDateValuesFromTime,\n getNextTimeValue,\n focusNextInputIfNeeded,\n commonInputProps,\n handleCompletedDate,\n triggerOnBlur,\n isTimeCompletelySet,\n} from './utils.js';\n\nconst blockName = 'input-date-group';\n\nconst InputTimesGroup = aggregatedClasses('div')(blockName);\nconst MonthInput = aggregatedClasses('input')(blockName, 'input input-month');\nconst DayInput = aggregatedClasses('input')(blockName, 'input input-day');\nconst YearInput = aggregatedClasses('input')(blockName, 'input input-year');\nconst Divider = aggregatedClasses('span')(blockName, 'divider', ({ value }) => ({\n value,\n}));\n\n// eslint-disable-next-line react/prop-types\nconst DateDivider = ({ content = ':', value = '' }) => <Divider value={!!value}>{content}</Divider>;\n\nconst DateInputs = ({\n innerRef,\n onBlur,\n onChange,\n onCustomKeyDown,\n onError,\n format = '',\n showMonth = true,\n showDay = true,\n showYear = true,\n step = 1,\n yearMaxRange,\n disabled,\n yearMinRange,\n time,\n // TODO remove and keep `true` behavior ( PUI-4141 )\n INTERNAL_V2_NO_MUTATION, // eslint-disable-line react/prop-types\n}) => {\n const [currentKey, setCurrentKey] = useState('ArrowUp');\n const [month, setMonth] = useState('');\n const [day, setDay] = useState('');\n const [year, setYear] = useState('');\n const prevTime = usePrevious(time);\n const prevFormat = usePrevious(format);\n\n let digits = 2;\n let placeholder = '';\n\n useEffect(() => {\n if (time) {\n const dateValues = getDateValuesFromTime(time, format);\n setMonth(dateValues.month);\n setDay(dateValues.day);\n setYear(dateValues.year);\n }\n }, [format, time]);\n\n useEffect(() => {\n if (!time && prevTime) {\n setMonth('');\n setDay('');\n setYear('');\n onChange('');\n }\n if (time && prevTime && time.format && time.format(format) !== prevTime.format(prevFormat)) {\n const dateValues = getDateValuesFromTime(time, format);\n\n setMonth(dateValues.month);\n setDay(dateValues.day);\n setYear(dateValues.year);\n }\n }, [time, prevTime, format, prevFormat, onChange]);\n\n const isCompletedDate = useCallback(\n () => isTimeCompletelySet({ year, month, day }, { showYear, showMonth, showDay }, { yearMinRange, yearMaxRange }),\n [day, month, showDay, showMonth, showYear, year, yearMaxRange, yearMinRange],\n );\n\n useEffect(() => {\n if (INTERNAL_V2_NO_MUTATION) {\n const dateValues = getDateValuesFromTime(time, format);\n\n if (dateValues.day !== day && isCompletedDate()) {\n onChange(\n handleCompletedDate(time, { year, month, day }, { showYear, showMonth, showDay }, INTERNAL_V2_NO_MUTATION),\n );\n } else if (dateValues.month !== month && isCompletedDate()) {\n onChange(\n handleCompletedDate(time, { year, month, day }, { showYear, showMonth, showDay }, INTERNAL_V2_NO_MUTATION),\n );\n } else if (dateValues.year !== year && isCompletedDate()) {\n onChange(\n handleCompletedDate(time, { year, month, day }, { showYear, showMonth, showDay }, INTERNAL_V2_NO_MUTATION),\n );\n }\n }\n }, [\n INTERNAL_V2_NO_MUTATION,\n day,\n format,\n isCompletedDate,\n month,\n onChange,\n showDay,\n showMonth,\n showYear,\n time,\n year,\n ]);\n\n const triggerChange = () =>\n handleCompletedDate(time, { year, month, day }, { showYear, showMonth, showDay }, INTERNAL_V2_NO_MUTATION);\n\n const handleYearChange = (e) => {\n const { value } = e.target;\n const yearValue = parseTimeNumberFromText(value);\n const yearRange = { min: 1, max: 9999 };\n const nextYear = getValidTimeNumber(yearRange, yearValue, value, onError);\n\n setYear(formatYear(format, nextYear));\n if (isCompletedDate() && !INTERNAL_V2_NO_MUTATION) {\n onChange(triggerChange());\n }\n focusNextInputIfNeeded(e.target, yearRange.max, nextYear, value, currentKey);\n };\n\n const handleMonthChange = (e) => {\n const { value } = e.target;\n const monthValue = parseTimeNumberFromText(value);\n const monthRange = { min: 1, max: 12 };\n const nextMonth = getValidTimeNumber(monthRange, monthValue, value, onError);\n setMonth(formatMonth(format, nextMonth));\n if (isCompletedDate() && !INTERNAL_V2_NO_MUTATION) {\n onChange(triggerChange());\n }\n focusNextInputIfNeeded(e.target, monthRange.max, nextMonth, value, currentKey);\n };\n\n const handleDayChange = (e) => {\n const { value } = e.target;\n const dayValue = parseTimeNumberFromText(value);\n const dayRange = { min: 1, max: 31 };\n const nextDay = getValidTimeNumber(dayRange, dayValue, value, onError);\n setDay(formatDay(format, nextDay));\n if (isCompletedDate() && !INTERNAL_V2_NO_MUTATION) {\n onChange(triggerChange());\n }\n if (value !== day) focusNextInputIfNeeded(e.target, dayRange.max, nextDay, value, currentKey);\n };\n\n // eslint-disable-next-line complexity\n const onKeyDown = (event, shouldIncrementDecrement = true) => {\n const { value, name } = event.target;\n const change = {\n day: (v) => handleDayChange({ target: { value: v } }),\n month: (v) => handleMonthChange({ target: { value: v } }),\n year: (v) => handleYearChange({ target: { value: v } }),\n };\n switch (event.key) {\n case 'ArrowLeft': {\n event.preventDefault();\n focusPreviousInput(event.target);\n break;\n }\n case 'ArrowUp': {\n if (shouldIncrementDecrement) {\n event.preventDefault();\n setCurrentKey(event.key);\n const incrementedValue = getNextTimeValue(value, name, yearMinRange, yearMaxRange, step, true);\n if (INTERNAL_V2_NO_MUTATION) {\n change[name](incrementedValue);\n } else {\n setNativeValue(event.target, incrementedValue);\n }\n }\n break;\n }\n case 'ArrowDown': {\n if (shouldIncrementDecrement) {\n event.preventDefault();\n setCurrentKey(event.key);\n const decrementedValue = getNextTimeValue(value, name, yearMinRange, yearMaxRange, step, false);\n if (INTERNAL_V2_NO_MUTATION) {\n change[name](decrementedValue);\n } else {\n setNativeValue(event.target, decrementedValue);\n }\n }\n break;\n }\n case 'ArrowRight': {\n event.preventDefault();\n focusNextInput(event.target);\n break;\n }\n case 'Backspace': {\n event.preventDefault();\n if (!value) {\n focusPreviousInput(event.target);\n } else {\n // eslint-disable-next-line no-lonely-if\n if (INTERNAL_V2_NO_MUTATION) {\n change[name]('');\n } else {\n setNativeValue(event.target, '');\n }\n }\n break;\n }\n case 'Enter': {\n if (onCustomKeyDown && isCompletedDate()) onCustomKeyDown(event, triggerChange());\n setCurrentKey(null);\n break;\n }\n default:\n if (onCustomKeyDown) onCustomKeyDown(event);\n setCurrentKey(null);\n }\n };\n\n const renderMonthInput = () => {\n if (!showMonth) return null;\n placeholder = 'MM';\n const onMonthInputBlur = (e) => {\n handleMonthChange(e);\n triggerOnBlur(e, onBlur);\n };\n return (\n <MonthInput\n {...commonInputProps(digits, onKeyDown, placeholder)}\n autocomplete=\"off\"\n key=\"month-input\"\n data-testid=\"month\"\n disabled={disabled}\n name=\"month\"\n onBlur={onMonthInputBlur}\n onChange={handleMonthChange}\n value={month}\n />\n );\n };\n const renderDayInput = () => {\n if (!showDay) return null;\n placeholder = 'DD';\n const onDayInputBlur = (e) => {\n handleDayChange(e);\n triggerOnBlur(e, onBlur);\n };\n return (\n <DayInput\n {...commonInputProps(digits, onKeyDown, placeholder)}\n autocomplete=\"off\"\n key=\"day-input\"\n data-testid=\"day\"\n disabled={disabled}\n name=\"day\"\n onBlur={onDayInputBlur}\n onChange={handleDayChange}\n value={day}\n />\n );\n };\n const renderYearInput = () => {\n if (!showYear) return null;\n placeholder = 'YY';\n digits = 4;\n const onYearInputBlur = (e) => {\n handleYearChange(e);\n triggerOnBlur(e, onBlur);\n };\n return (\n <YearInput\n {...commonInputProps(digits, onKeyDown, placeholder)}\n autocomplete=\"off\"\n key=\"seconds-input\"\n data-testid=\"year\"\n disabled={disabled}\n name=\"year\"\n onBlur={onYearInputBlur}\n onChange={handleYearChange}\n value={year}\n />\n );\n };\n\n const renderDateInputs = () => {\n const inputs = [renderMonthInput(), renderDayInput(), renderYearInput()];\n const inputsWithDividers = inputs.reduce(\n (acc, input, index) =>\n input\n ? acc.concat([index ? <DateDivider key={index} content=\" / \" value={input.props.value} /> : null, input])\n : acc,\n [],\n );\n\n return [\n inputsWithDividers,\n React.createElement('span', { key: 'span' }), // hack for next/prev focus\n ];\n };\n\n return <InputTimesGroup innerRef={innerRef}>{renderDateInputs()}</InputTimesGroup>;\n};\n\nDateInputs.propTypes = {\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]),\n onBlur: PropTypes.bool,\n onChange: PropTypes.func,\n onCustomKeyDown: PropTypes.func,\n onError: PropTypes.func,\n format: PropTypes.string,\n showMonth: PropTypes.bool,\n showDay: PropTypes.bool,\n showYear: PropTypes.bool,\n step: PropTypes.number,\n yearMaxRange: PropTypes.number,\n disabled: PropTypes.bool,\n yearMinRange: PropTypes.number,\n time: PropTypes.instanceOf(Moment),\n};\n\nexport { DateInputs };\nexport default DateInputs;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACuCgC;AAkNjD;AApPN,OAAOA,UAAS,UAAU,WAAW,mBAAmB;AACxD,OAAO,eAAe;AACtB,OAAO,YAAY;AACnB,SAAS,yBAAyB;AAClC,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,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F,QAAQ,UAAU;AAAA,EAClB,UAAU,UAAU;AAAA,EACpB,iBAAiB,UAAU;AAAA,EAC3B,SAAS,UAAU;AAAA,EACnB,QAAQ,UAAU;AAAA,EAClB,WAAW,UAAU;AAAA,EACrB,SAAS,UAAU;AAAA,EACnB,UAAU,UAAU;AAAA,EACpB,MAAM,UAAU;AAAA,EAChB,cAAc,UAAU;AAAA,EACxB,UAAU,UAAU;AAAA,EACpB,cAAc,UAAU;AAAA,EACxB,MAAM,UAAU,WAAW,MAAM;AACnC;AAGA,IAAO,qBAAQ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { addLeadingZeros, parseInt, isNaN } from "@elliemae/ds-utilities";
|
|
3
3
|
import moment from "moment";
|
|
4
|
-
const currentYear = new Date().getFullYear();
|
|
4
|
+
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
5
5
|
const isArrowIncrementDecrement = (key) => key === "ArrowDown" || key === "ArrowUp";
|
|
6
6
|
const setNativeValue = (element, value) => {
|
|
7
7
|
if (!Object.getOwnPropertyDescriptor(element, "value"))
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/DateInput/components/utils.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\n/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport { addLeadingZeros, parseInt, isNaN } from '@elliemae/ds-utilities';\nimport moment from 'moment';\n\nconst currentYear = new Date().getFullYear();\n\nexport const isArrowIncrementDecrement = (key) => key === 'ArrowDown' || key === 'ArrowUp';\n\n// TODO remove and keep `true` behavior ( PUI-4141 )\nexport const setNativeValue = (element, value) => {\n if (!Object.getOwnPropertyDescriptor(element, 'value')) return;\n const valueSetter = Object.getOwnPropertyDescriptor(element, 'value').set;\n const prototype = Object.getPrototypeOf(element);\n const prototypeValueSetter = Object.getOwnPropertyDescriptor(prototype, 'value').set;\n\n if (valueSetter && valueSetter !== prototypeValueSetter) {\n prototypeValueSetter.call(element, value);\n } else {\n valueSetter.call(element, value);\n }\n element.dispatchEvent(new Event('input', { bubbles: true }));\n};\n\nconst formatTimeNumber = (value, shouldAddLeadingZeros, leadingZeros) => {\n if (value === null || value === undefined) return '';\n return shouldAddLeadingZeros ? addLeadingZeros(leadingZeros)(value) : String(value);\n};\n\nexport const formatDay = (format, value) => {\n const shouldAddLeadingZeros = format.indexOf('DD') > -1;\n return formatTimeNumber(value, shouldAddLeadingZeros, 2);\n};\nexport const formatYear = (format, value) => {\n const shouldAddLeadingZeros = format.indexOf('YYYY') > -1;\n return formatTimeNumber(value, shouldAddLeadingZeros, 4);\n};\nexport const formatMonth = (format, value) => {\n const shouldAddLeadingZeros = format.indexOf('MM') > -1;\n return formatTimeNumber(value, shouldAddLeadingZeros, 2);\n};\n\nexport const parseTimeNumberFromText = (stringValue) => {\n const parsedInt = parseInt(stringValue);\n\n if (isNaN(parsedInt)) return null;\n\n return parsedInt;\n};\n\n// trigger onBlur for entire DateInput control if focus is not in day, month, year\nexport const triggerOnBlur = (blurEvent, onBlur = () => {}) => {\n const { target: currentEl = {}, relatedTarget } = blurEvent || {};\n const nextElement = currentEl.nextElementSibling;\n const { nextElementSibling } = nextElement || {};\n // relatedTarget points to the element that is currently having focus\n if (!nextElementSibling || nextElementSibling !== relatedTarget) {\n onBlur(blurEvent);\n }\n};\n\nexport const focusNextInput = (currentEl) => {\n const nextElement = currentEl.nextElementSibling;\n if (nextElement && nextElement.nextElementSibling) {\n nextElement.nextElementSibling.focus();\n }\n};\n\nexport const focusPreviousInput = (currentEl) => {\n const previousElement = currentEl.previousElementSibling;\n if (previousElement && previousElement.previousElementSibling) {\n previousElement.previousElementSibling.focus();\n }\n};\n\nexport const getValidTimeNumber = ({ min, max }, number, valueString = '', onError = () => null) => {\n if (valueString === '0' || number === 0) return null;\n if (number === undefined || number === null) return null;\n if (number > max) {\n onError();\n return max;\n }\n if (number < min) {\n onError();\n return min;\n }\n return number;\n};\n\nexport const shouldFocusNextInput = (max, number = 0, stringValue) => {\n if (stringValue.length > 1 && !stringValue.startsWith('0')) return true;\n return number * 10 > max;\n};\n\nexport const getDateValuesFromTime = (time, format) => {\n if (!time || !time.format) return {};\n const month = time.format('MM');\n const day = time.format('DD');\n const year = time.format('YYYY');\n return {\n month: formatMonth(format, month),\n day: formatDay(format, day),\n year: formatYear(format, year),\n };\n};\n\nexport const resetTimeValues = () => ({\n month: '',\n day: '',\n year: '',\n});\n\nexport const onInputFocus = (e) => {\n e.preventDefault();\n e.stopPropagation();\n e.target.select();\n};\n\nexport const getNextTimeValue = (value, target, yearMinRange, yearMaxRange, step = 1, incrementing = true) => {\n const parsedValue = parseTimeNumberFromText(value);\n let result = incrementing ? parsedValue + step : parsedValue - step;\n if (target === 'year') {\n if (result < yearMinRange) result = currentYear;\n if (result > yearMaxRange) result = currentYear;\n }\n return result;\n};\n\nexport const focusNextInputIfNeeded = (currentEl, max, number, stringValue, currentKey) => {\n if (shouldFocusNextInput(max, number, stringValue) && !isArrowIncrementDecrement(currentKey)) {\n focusNextInput(currentEl);\n }\n};\n\nexport const commonInputProps = (digits = 2, onKeyDown, placeholder) => {\n const props = {\n pattern: '[0-9]*',\n placeholder,\n type: 'text',\n onKeyDown,\n onFocus: onInputFocus,\n };\n if (digits === 4) props.placeholder = 'YYYY';\n return props;\n};\n\nexport const handleCompletedDate = (time, date, show, INTERNAL_V2_NO_MUTATION) => {\n // clone time to avoid mutation when INTERNAL_V2_NO_MUTATION is true\n const newDate = INTERNAL_V2_NO_MUTATION ? (time && moment(time)) || moment() : time || moment();\n\n const { year, month, day } = date;\n const { showYear, showMonth, showDay } = show;\n\n if (time && !year && !month && !day) return '';\n\n newDate.value = `${year}-${month}-${day}`;\n\n if (showMonth && month) newDate.month(parseInt(month - 1, 10));\n if (showDay && day) newDate.date(parseInt(day, 10));\n if (showYear && year) newDate.year(parseInt(year, 10));\n\n return newDate;\n};\n\nexport const isTimeCompletelySet = (date, show, range) => {\n let neededValues = [];\n const { year, month, day } = date;\n if ((day && day.length < 1) || (month && month.length < 1)) return false;\n const { showYear, showMonth, showDay } = show;\n const { yearMinRange, yearMaxRange } = range;\n\n if (showMonth) neededValues = [...neededValues, month || null];\n if (showDay) neededValues = [...neededValues, day || null];\n if (showYear) neededValues = [...neededValues, year || null];\n\n const isValidYear = year < yearMaxRange && year > yearMinRange;\n\n return !neededValues.some((value) => !value) && isValidYear;\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,iBAAiB,UAAU,aAAa;AACjD,OAAO,YAAY;AAEnB,MAAM,
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,iBAAiB,UAAU,aAAa;AACjD,OAAO,YAAY;AAEnB,MAAM,eAAc,oBAAI,KAAK,GAAE,YAAY;AAEpC,MAAM,4BAA4B,CAAC,QAAQ,QAAQ,eAAe,QAAQ;AAG1E,MAAM,iBAAiB,CAAC,SAAS,UAAU;AAChD,MAAI,CAAC,OAAO,yBAAyB,SAAS,OAAO;AAAG;AACxD,QAAM,cAAc,OAAO,yBAAyB,SAAS,OAAO,EAAE;AACtE,QAAM,YAAY,OAAO,eAAe,OAAO;AAC/C,QAAM,uBAAuB,OAAO,yBAAyB,WAAW,OAAO,EAAE;AAEjF,MAAI,eAAe,gBAAgB,sBAAsB;AACvD,yBAAqB,KAAK,SAAS,KAAK;AAAA,EAC1C,OAAO;AACL,gBAAY,KAAK,SAAS,KAAK;AAAA,EACjC;AACA,UAAQ,cAAc,IAAI,MAAM,SAAS,EAAE,SAAS,KAAK,CAAC,CAAC;AAC7D;AAEA,MAAM,mBAAmB,CAAC,OAAO,uBAAuB,iBAAiB;AACvE,MAAI,UAAU,QAAQ,UAAU;AAAW,WAAO;AAClD,SAAO,wBAAwB,gBAAgB,YAAY,EA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D,QAAM,cAAc,OAAO,gBAAgB,OAAO;AAElD,SAAO,CAAC,aAAa,KAAK,CAAC,UAAU,CAAC,KAAK,KAAK;AAClD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/DateInput/defaultProps.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "const noop = () => null;\nconst currentYear = new Date().getFullYear();\n\nexport const defaultProps = {\n className: '',\n style: {},\n onFocus: noop,\n onBlur: noop,\n onClear: noop,\n onChange: noop,\n onKeyDown: noop,\n onError: noop,\n format: 'MM:DD:YYYY',\n value: '',\n clearable: true,\n disabled: false,\n yearMaxRange: currentYear + 100,\n yearMinRange: currentYear - 100,\n containerProps: {},\n INTERNAL_V2_NO_MUTATION: false,\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,MAAM,OAAO,MAAM;AACnB,MAAM,
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,MAAM,OAAO,MAAM;AACnB,MAAM,eAAc,oBAAI,KAAK,GAAE,YAAY;AAEpC,MAAM,eAAe;AAAA,EAC1B,WAAW;AAAA,EACX,OAAO,CAAC;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,UAAU;AAAA,EACV,WAAW;AAAA,EACX,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,WAAW;AAAA,EACX,UAAU;AAAA,EACV,cAAc,cAAc;AAAA,EAC5B,cAAc,cAAc;AAAA,EAC5B,gBAAgB,CAAC;AAAA,EACjB,yBAAyB;AAC3B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/DateInput/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSDateInput';\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSDateInput.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,23 +1,65 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { PropTypes } from "@elliemae/ds-
|
|
2
|
+
import { PropTypes } from "@elliemae/ds-props-helpers";
|
|
3
3
|
const props = {
|
|
4
|
+
/** props injected to date input wrapper node */
|
|
4
5
|
containerProps: PropTypes.object.description("props injected to date input wrapper node"),
|
|
6
|
+
/** inner ref for input wrapper */
|
|
5
7
|
innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]).description(
|
|
6
8
|
"inner ref for input wrapper"
|
|
7
9
|
),
|
|
10
|
+
/** class for input */
|
|
8
11
|
className: PropTypes.string.description("class for input"),
|
|
12
|
+
/**
|
|
13
|
+
* Set style for the date input
|
|
14
|
+
*/
|
|
9
15
|
style: PropTypes.object.description("Set style for the date input"),
|
|
16
|
+
/**
|
|
17
|
+
* Triggers the onBlur when focus moves out of date input
|
|
18
|
+
*/
|
|
10
19
|
onBlur: PropTypes.func.description("Triggers the onBlur when focus moves out of date input"),
|
|
20
|
+
/**
|
|
21
|
+
* Triggers the onFocus when the component gets the focus
|
|
22
|
+
*/
|
|
11
23
|
onFocus: PropTypes.func.description("Triggers the onFocus when the component gets the focus"),
|
|
24
|
+
/**
|
|
25
|
+
* Triggers the onClear
|
|
26
|
+
*/
|
|
12
27
|
onClear: PropTypes.func.description("Triggers the onClear"),
|
|
28
|
+
/**
|
|
29
|
+
* Triggers the onKeyDown
|
|
30
|
+
*/
|
|
13
31
|
onKeyDown: PropTypes.func.description("Triggers the onKeyDown"),
|
|
32
|
+
/**
|
|
33
|
+
* Allows a function that is triggered once the date input changes
|
|
34
|
+
*/
|
|
14
35
|
onChange: PropTypes.func.description("Allows a function that is triggered once the date input changes"),
|
|
36
|
+
/**
|
|
37
|
+
* Triggers the onError once one input date is wrong
|
|
38
|
+
*/
|
|
15
39
|
onError: PropTypes.func.description("Triggers the onError once one input date is wrong"),
|
|
40
|
+
/**
|
|
41
|
+
* Format type for date input
|
|
42
|
+
*/
|
|
16
43
|
format: PropTypes.string.description("Format type for date input"),
|
|
44
|
+
/**
|
|
45
|
+
* Default value once the component is initialized
|
|
46
|
+
*/
|
|
17
47
|
value: PropTypes.string.description("Default value once the component is initialized"),
|
|
48
|
+
/**
|
|
49
|
+
* Whether the date input is clearable or not
|
|
50
|
+
*/
|
|
18
51
|
clearable: PropTypes.bool.description("Whether the date input is clearable or not"),
|
|
52
|
+
/**
|
|
53
|
+
* Whether the date input is disabled or not
|
|
54
|
+
*/
|
|
19
55
|
disabled: PropTypes.bool.description("Whether the date input is disabled or not"),
|
|
56
|
+
/**
|
|
57
|
+
* Max year that can be accepted by the date input
|
|
58
|
+
*/
|
|
20
59
|
yearMaxRange: PropTypes.number.description("Max year that can be accepted by the date input"),
|
|
60
|
+
/**
|
|
61
|
+
* Min year that can be accepted by the date input
|
|
62
|
+
*/
|
|
21
63
|
yearMinRange: PropTypes.number.description("Min year that can be accepted by the date input")
|
|
22
64
|
};
|
|
23
65
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/DateInput/props.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from '@elliemae/ds-
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAEnB,MAAM,QAAQ;AAAA,EAEnB,gBAAgB,UAAU,OAAO,YAAY,2CAA2C;AAAA,EAExF,UAAU,UAAU,UAAU,CAAC,UAAU,MAAM,UAAU,MAAM,EAAE,SAAS,UAAU,IAAI,CAAC,CAAC,CAAC,EAAE;AAAA,IAC3F;AAAA,EACF;AAAA,EAEA,WAAW,UAAU,OAAO,YAAY,iBAAiB;AAAA,EAIzD,OAAO,UAAU,OAAO,YAAY,8BAA8B;AAAA,EAIlE,QAAQ,UAAU,KAAK,YAAY,wDAAwD;AAAA,EAI3F,SAAS,UAAU,KAAK,YAAY,wDAAwD;AAAA,EAI5F,SAAS,UAAU,KAAK,YAAY,sBAAsB;AAAA,EAI1D,WAAW,UAAU,KAAK,YAAY,wBAAwB;AAAA,EAI9D,UAAU,UAAU,KAAK,YAAY,iEAAiE;AAAA,EAItG,SAAS,UAAU,KAAK,YAAY,mDAAmD;AAAA,EAIvF,QAAQ,UAAU,OAAO,YAAY,4BAA4B;AAAA,EAIjE,OAAO,UAAU,OAAO,YAAY,iDAAiD;AAAA,EAIrF,WAAW,UAAU,KAAK,YAAY,4CAA4C;AAAA,EAIlF,UAAU,UAAU,KAAK,YAAY,2CAA2C;AAAA,EAIhF,cAAc,UAAU,OAAO,YAAY,iDAAiD;AAAA,EAI5F,cAAc,UAAU,OAAO,YAAY,iDAAiD;AAC9F;",
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from '@elliemae/ds-props-helpers';\n\nexport const props = {\n /** props injected to date input wrapper node */\n containerProps: PropTypes.object.description('props injected to date input wrapper node'),\n /** inner ref for input wrapper */\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]).description(\n 'inner ref for input wrapper',\n ),\n /** class for input */\n className: PropTypes.string.description('class for input'),\n /**\n * Set style for the date input\n */\n style: PropTypes.object.description('Set style for the date input'),\n /**\n * Triggers the onBlur when focus moves out of date input\n */\n onBlur: PropTypes.func.description('Triggers the onBlur when focus moves out of date input'),\n /**\n * Triggers the onFocus when the component gets the focus\n */\n onFocus: PropTypes.func.description('Triggers the onFocus when the component gets the focus'),\n /**\n * Triggers the onClear\n */\n onClear: PropTypes.func.description('Triggers the onClear'),\n /**\n * Triggers the onKeyDown\n */\n onKeyDown: PropTypes.func.description('Triggers the onKeyDown'),\n /**\n * Allows a function that is triggered once the date input changes\n */\n onChange: PropTypes.func.description('Allows a function that is triggered once the date input changes'),\n /**\n * Triggers the onError once one input date is wrong\n */\n onError: PropTypes.func.description('Triggers the onError once one input date is wrong'),\n /**\n * Format type for date input\n */\n format: PropTypes.string.description('Format type for date input'),\n /**\n * Default value once the component is initialized\n */\n value: PropTypes.string.description('Default value once the component is initialized'),\n /**\n * Whether the date input is clearable or not\n */\n clearable: PropTypes.bool.description('Whether the date input is clearable or not'),\n /**\n * Whether the date input is disabled or not\n */\n disabled: PropTypes.bool.description('Whether the date input is disabled or not'),\n /**\n * Max year that can be accepted by the date input\n */\n yearMaxRange: PropTypes.number.description('Max year that can be accepted by the date input'),\n /**\n * Min year that can be accepted by the date input\n */\n yearMinRange: PropTypes.number.description('Min year that can be accepted by the date input'),\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAEnB,MAAM,QAAQ;AAAA;AAAA,EAEnB,gBAAgB,UAAU,OAAO,YAAY,2CAA2C;AAAA;AAAA,EAExF,UAAU,UAAU,UAAU,CAAC,UAAU,MAAM,UAAU,MAAM,EAAE,SAAS,UAAU,IAAI,CAAC,CAAC,CAAC,EAAE;AAAA,IAC3F;AAAA,EACF;AAAA;AAAA,EAEA,WAAW,UAAU,OAAO,YAAY,iBAAiB;AAAA;AAAA;AAAA;AAAA,EAIzD,OAAO,UAAU,OAAO,YAAY,8BAA8B;AAAA;AAAA;AAAA;AAAA,EAIlE,QAAQ,UAAU,KAAK,YAAY,wDAAwD;AAAA;AAAA;AAAA;AAAA,EAI3F,SAAS,UAAU,KAAK,YAAY,wDAAwD;AAAA;AAAA;AAAA;AAAA,EAI5F,SAAS,UAAU,KAAK,YAAY,sBAAsB;AAAA;AAAA;AAAA;AAAA,EAI1D,WAAW,UAAU,KAAK,YAAY,wBAAwB;AAAA;AAAA;AAAA;AAAA,EAI9D,UAAU,UAAU,KAAK,YAAY,iEAAiE;AAAA;AAAA;AAAA;AAAA,EAItG,SAAS,UAAU,KAAK,YAAY,mDAAmD;AAAA;AAAA;AAAA;AAAA,EAIvF,QAAQ,UAAU,OAAO,YAAY,4BAA4B;AAAA;AAAA;AAAA;AAAA,EAIjE,OAAO,UAAU,OAAO,YAAY,iDAAiD;AAAA;AAAA;AAAA;AAAA,EAIrF,WAAW,UAAU,KAAK,YAAY,4CAA4C;AAAA;AAAA;AAAA;AAAA,EAIlF,UAAU,UAAU,KAAK,YAAY,2CAA2C;AAAA;AAAA;AAAA;AAAA,EAIhF,cAAc,UAAU,OAAO,YAAY,iDAAiD;AAAA;AAAA;AAAA;AAAA,EAI5F,cAAc,UAAU,OAAO,YAAY,iDAAiD;AAC9F;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { describe } from "@elliemae/ds-
|
|
4
|
-
import { DSInput } from "../../Input";
|
|
5
|
-
import { DateInputs } from "./DateInputs";
|
|
6
|
-
import { props, defaultProps } from "./props";
|
|
3
|
+
import { describe } from "@elliemae/ds-props-helpers";
|
|
4
|
+
import { DSInput } from "../../Input/index.js";
|
|
5
|
+
import { DateInputs } from "./DateInputs.js";
|
|
6
|
+
import { props, defaultProps } from "./props.js";
|
|
7
7
|
const DSDateInputV2 = ({
|
|
8
8
|
onFocus,
|
|
9
9
|
onBlur,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/DateInputV2/components/DSDateInput.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { DSInput } from '../../Input/index.js';\nimport { DateInputs } from './DateInputs.js';\nimport { props, defaultProps } from './props.js';\n\nconst DSDateInputV2 = ({\n onFocus,\n onBlur,\n onChange,\n onDateChange,\n onKeyDown,\n onError,\n value,\n disabled,\n containerProps,\n tabIndex,\n innerRef,\n}) => (\n <DSInput\n innerRef={innerRef}\n containerProps={containerProps}\n customInputType={({ innerRef: ir }) => (\n <DateInputs\n disabled={disabled}\n innerRef={ir}\n onBlur={onBlur}\n onChange={onChange}\n onDateChange={onDateChange}\n onCustomKeyDown={onKeyDown}\n onError={onError}\n time={value}\n tabIndex={tabIndex}\n />\n )}\n disableTooltip={false}\n disabled={disabled}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n tabIndex={tabIndex}\n />\n);\n\nDSDateInputV2.defaultProps = defaultProps;\n\nDSDateInputV2.propTypes = props;\nDSDateInputV2.displayName = 'DSDateInputV2';\nconst DSDateInputV2WithSchema = describe(DSDateInputV2);\nDSDateInputV2WithSchema.propTypes = props;\n\nexport { DSDateInputV2, DSDateInputV2WithSchema };\nexport default DSDateInputV2;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACuBjB;AAtBN,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,kBAAkB;AAC3B,SAAS,OAAO,oBAAoB;AAEpC,MAAM,gBAAgB,CAAC;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MACE;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA;AAAA,IACA,iBAAiB,CAAC,EAAE,UAAU,GAAG,MAC/B;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA,iBAAiB;AAAA,QACjB;AAAA,QACA,MAAM;AAAA,QACN;AAAA;AAAA,IACF;AAAA,IAEF,gBAAgB;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AACF;AAGF,cAAc,eAAe;AAE7B,cAAc,YAAY;AAC1B,cAAc,cAAc;AAC5B,MAAM,0BAA0B,SAAS,aAAa;AACtD,wBAAwB,YAAY;AAGpC,IAAO,sBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,6 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { createElement } from "react";
|
|
4
4
|
import React2, { useState, useEffect } from "react";
|
|
5
5
|
import moment from "moment";
|
|
6
|
+
import { useDeprecateComponent } from "@elliemae/ds-utilities";
|
|
6
7
|
import {
|
|
7
8
|
commonInputProps,
|
|
8
9
|
triggerOnBlur,
|
|
@@ -12,12 +13,13 @@ import {
|
|
|
12
13
|
getFormattedMonth,
|
|
13
14
|
getShouldShortcircuitMonth,
|
|
14
15
|
getFormattedYear
|
|
15
|
-
} from "./utils";
|
|
16
|
-
import { onKeyDownHelper } from "./helpers";
|
|
17
|
-
import { DateInputDivider, DateInputWrapper, DateInputInput, DateInputFluidContainer } from "./styled";
|
|
18
|
-
import { DateInputsPropTypes } from "./propsTypes";
|
|
16
|
+
} from "./utils.js";
|
|
17
|
+
import { onKeyDownHelper } from "./helpers.js";
|
|
18
|
+
import { DateInputDivider, DateInputWrapper, DateInputInput, DateInputFluidContainer } from "./styled.js";
|
|
19
|
+
import { DateInputsPropTypes } from "./propsTypes.js";
|
|
19
20
|
const FORMAT = "MMDDYYYY";
|
|
20
21
|
const DateInputs = ({ onBlur, onChange, onDateChange, disabled, onCustomKeyDown, time, tabIndex, innerRef }) => {
|
|
22
|
+
useDeprecateComponent({ componentName: "ds-form/DateInputV2", version: "3.x Date: 2023 Q1" });
|
|
21
23
|
const [month, setMonth] = useState("");
|
|
22
24
|
const [day, setDay] = useState("");
|
|
23
25
|
const [year, setYear] = useState("");
|
|
@@ -177,6 +179,7 @@ const DateInputs = ({ onBlur, onChange, onDateChange, disabled, onCustomKeyDown,
|
|
|
177
179
|
return [
|
|
178
180
|
inputsWithDividers,
|
|
179
181
|
React2.createElement("span", { key: "span" })
|
|
182
|
+
// hack for next/prev focus
|
|
180
183
|
];
|
|
181
184
|
};
|
|
182
185
|
return /* @__PURE__ */ jsx(DateInputFluidContainer, { onClick: handleFluidClick, "data-testid": "date-input-fluidContainer", children: /* @__PURE__ */ jsx(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/DateInputV2/components/DateInputs.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useState, useEffect } from 'react';\nimport moment from 'moment';\nimport {\n commonInputProps,\n triggerOnBlur,\n focusNextInput,\n getFormattedDay,\n getShouldShortcircuitDay,\n getFormattedMonth,\n getShouldShortcircuitMonth,\n getFormattedYear,\n} from './utils';\nimport { onKeyDownHelper } from './helpers';\nimport { DateInputDivider, DateInputWrapper, DateInputInput, DateInputFluidContainer } from './styled';\nimport { DateInputsPropTypes } from './propsTypes';\n\nconst FORMAT = 'MMDDYYYY';\n\nexport const DateInputs = ({ onBlur, onChange, onDateChange, disabled, onCustomKeyDown, time, tabIndex, innerRef }) => {\n const [month, setMonth] = useState('');\n const [day, setDay] = useState('');\n const [year, setYear] = useState('');\n const [onChangeDateTrigger, setOnChangeDateTrigger] = useState({});\n const dayRef = React.useRef<HTMLInputElement>();\n const [haveInputsOnChangeTriggered, setHaveInputsOnChangeTriggered] = useState(false);\n\n let digits = 2;\n let placeholder = '';\n\n const handleFluidClick = React.useCallback(\n (e: React.MouseEvent<Element, MouseEvent>) => {\n if (!(e.target as HTMLInputElement).type && dayRef.current) {\n dayRef.current.focus();\n }\n },\n [dayRef.current],\n );\n\n const triggerOnDateChange = React.useCallback(() => {\n if (month && day && year && haveInputsOnChangeTriggered) {\n const momentValue = moment(`${month}${day}${year}`, 'MMDDYYYY', true);\n if (momentValue.isValid()) {\n onDateChange(momentValue);\n }\n setHaveInputsOnChangeTriggered(false);\n }\n }, [day, month, year, haveInputsOnChangeTriggered]);\n\n // isArrowChange is coming from the onKeyDown handler in helpers\n const onMonthChange = React.useCallback((e, isArrowChange) => {\n const value = getFormattedMonth(e.target.value);\n const shouldAdvance = getShouldShortcircuitMonth(e.target.value);\n setMonth(value);\n setHaveInputsOnChangeTriggered(true);\n if (e.target.value.length > 1 || shouldAdvance) {\n if (!isArrowChange) focusNextInput(e.target);\n setOnChangeDateTrigger({});\n }\n }, []);\n\n // isArrowChange is coming from the onKeyDown handler in helpers\n const onDayChange = React.useCallback((e, isArrowChange) => {\n const value = getFormattedDay(e.target.value);\n const shouldAdvance = getShouldShortcircuitDay(e.target.value);\n setDay(value);\n setHaveInputsOnChangeTriggered(true);\n if (e.target.value.length > 1 || shouldAdvance) {\n if (!isArrowChange) focusNextInput(e.target);\n setOnChangeDateTrigger({});\n }\n }, []);\n\n const onYearChange = React.useCallback((e) => {\n const value = getFormattedYear(e.target.value);\n setYear(value);\n setHaveInputsOnChangeTriggered(true);\n setOnChangeDateTrigger({});\n }, []);\n\n useEffect(() => {\n // When component mounts haveInputsOnChangeTriggered is set to false\n // so this is not triggered on mount but is triggered with all other changes\n if (haveInputsOnChangeTriggered) {\n const momentValue = moment(`${month}${day}${year}`, FORMAT, true);\n onChange(`${month}${day}${year}`, momentValue.isValid() ? momentValue : null);\n }\n }, [day, month, year]);\n\n useEffect(() => {\n triggerOnDateChange();\n }, [onChangeDateTrigger]);\n\n useEffect(() => {\n if (time && time !== `${month}${day}${year}` && moment(time, 'MMDDYYYY').isValid()) {\n const values = String(time || '');\n if (values.slice(0, 2)) setMonth(values.slice(0, 2));\n if (values.slice(2, 4)) setDay(values.slice(2, 4));\n if (values.slice(4, 8)) setYear(values.slice(4, 8));\n } else if (!time && (month || day || year)) {\n setMonth('');\n setDay('');\n setYear('');\n }\n }, [time]);\n\n const onKeyDown = (event) =>\n onKeyDownHelper(event, {\n onDayChange,\n onMonthChange,\n onYearChange,\n });\n\n const renderMonthInput = () => {\n placeholder = 'MM';\n const onMonthInputBlur = (e) => {\n setOnChangeDateTrigger({});\n triggerOnBlur(e, onBlur);\n };\n return (\n <DateInputInput\n {...commonInputProps(digits, onKeyDown, placeholder)}\n autoComplete=\"off\"\n key=\"month-input\"\n data-testid=\"month\"\n disabled={disabled}\n name=\"month\"\n onBlur={onMonthInputBlur}\n onChange={onMonthChange}\n value={month}\n tabIndex={tabIndex}\n ref={dayRef}\n />\n );\n };\n const renderDayInput = () => {\n placeholder = 'DD';\n const onDayInputBlur = (e) => {\n setOnChangeDateTrigger({});\n triggerOnBlur(e, onBlur);\n };\n return (\n <DateInputInput\n {...commonInputProps(digits, onKeyDown, placeholder)}\n autoComplete=\"off\"\n key=\"day-input\"\n data-testid=\"day\"\n disabled={disabled}\n name=\"day\"\n onBlur={onDayInputBlur}\n onChange={onDayChange}\n value={day}\n tabIndex={tabIndex}\n />\n );\n };\n const renderYearInput = () => {\n placeholder = 'YY';\n digits = 4;\n const onYearInputBlur = (e) => {\n triggerOnBlur(e, onBlur);\n };\n return (\n <DateInputInput\n {...commonInputProps(digits, onKeyDown, placeholder)}\n autoComplete=\"off\"\n key=\"year-input\"\n data-testid=\"year\"\n disabled={disabled}\n name=\"year\"\n onBlur={onYearInputBlur}\n onChange={onYearChange}\n value={year}\n size=\"l\"\n tabIndex={tabIndex}\n />\n );\n };\n\n const renderDateInputs = () => {\n const inputs = [renderMonthInput(), renderDayInput(), renderYearInput()];\n const inputsWithDividers = inputs.reduce(\n (acc, input, index) => (input ? acc.concat([index ? <DateInputDivider>/</DateInputDivider> : null, input]) : acc),\n [],\n );\n\n return [\n inputsWithDividers,\n React.createElement('span', { key: 'span' }), // hack for next/prev focus\n ];\n };\n\n return (\n <DateInputFluidContainer onClick={handleFluidClick} data-testid=\"date-input-fluidContainer\">\n <DateInputWrapper\n disabled={disabled}\n ref={innerRef}\n onKeyDown={onCustomKeyDown}\n tabIndex={-1}\n cols={['auto', '6px', 'auto', '6px', 'auto']}\n >\n {renderDateInputs()}\n </DateInputWrapper>\n </DateInputFluidContainer>\n );\n};\n\nDateInputs.propTypes = DateInputsPropTypes;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport React, { useState, useEffect } from 'react';\nimport moment from 'moment';\nimport { useDeprecateComponent } from '@elliemae/ds-utilities';\n\nimport {\n commonInputProps,\n triggerOnBlur,\n focusNextInput,\n getFormattedDay,\n getShouldShortcircuitDay,\n getFormattedMonth,\n getShouldShortcircuitMonth,\n getFormattedYear,\n} from './utils.js';\nimport { onKeyDownHelper } from './helpers.js';\nimport { DateInputDivider, DateInputWrapper, DateInputInput, DateInputFluidContainer } from './styled.js';\nimport { DateInputsPropTypes } from './propsTypes.js';\n\nconst FORMAT = 'MMDDYYYY';\n\nexport const DateInputs = ({ onBlur, onChange, onDateChange, disabled, onCustomKeyDown, time, tabIndex, innerRef }) => {\n useDeprecateComponent({ componentName: 'ds-form/DateInputV2', version: '3.x Date: 2023 Q1' });\n\n const [month, setMonth] = useState('');\n const [day, setDay] = useState('');\n const [year, setYear] = useState('');\n const [onChangeDateTrigger, setOnChangeDateTrigger] = useState({});\n const dayRef = React.useRef<HTMLInputElement>();\n const [haveInputsOnChangeTriggered, setHaveInputsOnChangeTriggered] = useState(false);\n\n let digits = 2;\n let placeholder = '';\n\n const handleFluidClick = React.useCallback(\n (e: React.MouseEvent<Element, MouseEvent>) => {\n if (!(e.target as HTMLInputElement).type && dayRef.current) {\n dayRef.current.focus();\n }\n },\n [dayRef.current],\n );\n\n const triggerOnDateChange = React.useCallback(() => {\n if (month && day && year && haveInputsOnChangeTriggered) {\n const momentValue = moment(`${month}${day}${year}`, 'MMDDYYYY', true);\n if (momentValue.isValid()) {\n onDateChange(momentValue);\n }\n setHaveInputsOnChangeTriggered(false);\n }\n }, [day, month, year, haveInputsOnChangeTriggered]);\n\n // isArrowChange is coming from the onKeyDown handler in helpers\n const onMonthChange = React.useCallback((e, isArrowChange) => {\n const value = getFormattedMonth(e.target.value);\n const shouldAdvance = getShouldShortcircuitMonth(e.target.value);\n setMonth(value);\n setHaveInputsOnChangeTriggered(true);\n if (e.target.value.length > 1 || shouldAdvance) {\n if (!isArrowChange) focusNextInput(e.target);\n setOnChangeDateTrigger({});\n }\n }, []);\n\n // isArrowChange is coming from the onKeyDown handler in helpers\n const onDayChange = React.useCallback((e, isArrowChange) => {\n const value = getFormattedDay(e.target.value);\n const shouldAdvance = getShouldShortcircuitDay(e.target.value);\n setDay(value);\n setHaveInputsOnChangeTriggered(true);\n if (e.target.value.length > 1 || shouldAdvance) {\n if (!isArrowChange) focusNextInput(e.target);\n setOnChangeDateTrigger({});\n }\n }, []);\n\n const onYearChange = React.useCallback((e) => {\n const value = getFormattedYear(e.target.value);\n setYear(value);\n setHaveInputsOnChangeTriggered(true);\n setOnChangeDateTrigger({});\n }, []);\n\n useEffect(() => {\n // When component mounts haveInputsOnChangeTriggered is set to false\n // so this is not triggered on mount but is triggered with all other changes\n if (haveInputsOnChangeTriggered) {\n const momentValue = moment(`${month}${day}${year}`, FORMAT, true);\n onChange(`${month}${day}${year}`, momentValue.isValid() ? momentValue : null);\n }\n }, [day, month, year]);\n\n useEffect(() => {\n triggerOnDateChange();\n }, [onChangeDateTrigger]);\n\n useEffect(() => {\n if (time && time !== `${month}${day}${year}` && moment(time, 'MMDDYYYY').isValid()) {\n const values = String(time || '');\n if (values.slice(0, 2)) setMonth(values.slice(0, 2));\n if (values.slice(2, 4)) setDay(values.slice(2, 4));\n if (values.slice(4, 8)) setYear(values.slice(4, 8));\n } else if (!time && (month || day || year)) {\n setMonth('');\n setDay('');\n setYear('');\n }\n }, [time]);\n\n const onKeyDown = (event) =>\n onKeyDownHelper(event, {\n onDayChange,\n onMonthChange,\n onYearChange,\n });\n\n const renderMonthInput = () => {\n placeholder = 'MM';\n const onMonthInputBlur = (e) => {\n setOnChangeDateTrigger({});\n triggerOnBlur(e, onBlur);\n };\n return (\n <DateInputInput\n {...commonInputProps(digits, onKeyDown, placeholder)}\n autoComplete=\"off\"\n key=\"month-input\"\n data-testid=\"month\"\n disabled={disabled}\n name=\"month\"\n onBlur={onMonthInputBlur}\n onChange={onMonthChange}\n value={month}\n tabIndex={tabIndex}\n ref={dayRef}\n />\n );\n };\n const renderDayInput = () => {\n placeholder = 'DD';\n const onDayInputBlur = (e) => {\n setOnChangeDateTrigger({});\n triggerOnBlur(e, onBlur);\n };\n return (\n <DateInputInput\n {...commonInputProps(digits, onKeyDown, placeholder)}\n autoComplete=\"off\"\n key=\"day-input\"\n data-testid=\"day\"\n disabled={disabled}\n name=\"day\"\n onBlur={onDayInputBlur}\n onChange={onDayChange}\n value={day}\n tabIndex={tabIndex}\n />\n );\n };\n const renderYearInput = () => {\n placeholder = 'YY';\n digits = 4;\n const onYearInputBlur = (e) => {\n triggerOnBlur(e, onBlur);\n };\n return (\n <DateInputInput\n {...commonInputProps(digits, onKeyDown, placeholder)}\n autoComplete=\"off\"\n key=\"year-input\"\n data-testid=\"year\"\n disabled={disabled}\n name=\"year\"\n onBlur={onYearInputBlur}\n onChange={onYearChange}\n value={year}\n size=\"l\"\n tabIndex={tabIndex}\n />\n );\n };\n\n const renderDateInputs = () => {\n const inputs = [renderMonthInput(), renderDayInput(), renderYearInput()];\n const inputsWithDividers = inputs.reduce(\n (acc, input, index) => (input ? acc.concat([index ? <DateInputDivider>/</DateInputDivider> : null, input]) : acc),\n [],\n );\n\n return [\n inputsWithDividers,\n React.createElement('span', { key: 'span' }), // hack for next/prev focus\n ];\n };\n\n return (\n <DateInputFluidContainer onClick={handleFluidClick} data-testid=\"date-input-fluidContainer\">\n <DateInputWrapper\n disabled={disabled}\n ref={innerRef}\n onKeyDown={onCustomKeyDown}\n tabIndex={-1}\n cols={['auto', '6px', 'auto', '6px', 'auto']}\n >\n {renderDateInputs()}\n </DateInputWrapper>\n </DateInputFluidContainer>\n );\n};\n\nDateInputs.propTypes = DateInputsPropTypes;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC6LmC;AA9DpD;AA3HN,OAAOA,UAAS,UAAU,iBAAiB;AAC3C,OAAO,YAAY;AACnB,SAAS,6BAA6B;AAEtC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,uBAAuB;AAChC,SAAS,kBAAkB,kBAAkB,gBAAgB,+BAA+B;AAC5F,SAAS,2BAA2B;AAEpC,MAAM,SAAS;AAER,MAAM,aAAa,CAAC,EAAE,QAAQ,UAAU,cAAc,UAAU,iBAAiB,MAAM,UAAU,SAAS,MAAM;AACrH,wBAAsB,EAAE,eAAe,uBAAuB,SAAS,oBAAoB,CAAC;AAE5F,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,EAAE;AACrC,QAAM,CAAC,KAAK,MAAM,IAAI,SAAS,EAAE;AACjC,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,EAAE;AACnC,QAAM,CAAC,qBAAqB,sBAAsB,IAAI,SAAS,CAAC,CAAC;AACjE,QAAM,SAASA,OAAM,OAAyB;AAC9C,QAAM,CAAC,6BAA6B,8BAA8B,IAAI,SAAS,KAAK;AAEpF,MAAI,SAAS;AACb,MAAI,cAAc;AAElB,QAAM,mBAAmBA,OAAM;AAAA,IAC7B,CAAC,MAA6C;AAC5C,UAAI,CAAE,EAAE,OAA4B,QAA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,QAAQ,EAAE,KAAK,OAAO,CAAC;AAAA;AAAA,IAC7C;AAAA,EACF;AAEA,SACE,oBAAC,2BAAwB,SAAS,kBAAkB,eAAY,6BAC9D;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,KAAK;AAAA,MACL,WAAW;AAAA,MACX,UAAU;AAAA,MACV,MAAM,CAAC,QAAQ,OAAO,QAAQ,OAAO,MAAM;AAAA,MAE1C,2BAAiB;AAAA;AAAA,EACpB,GACF;AAEJ;AAEA,WAAW,YAAY;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { cloneDeep } from "lodash";
|
|
3
|
-
import { focusNextInput, focusPreviousInput } from "./utils";
|
|
3
|
+
import { focusNextInput, focusPreviousInput } from "./utils.js";
|
|
4
4
|
const callChange = (event, handlers, isArrowChange) => {
|
|
5
5
|
if (event.target.name === "day")
|
|
6
6
|
handlers.onDayChange(event, isArrowChange);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/DateInputV2/components/helpers.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { cloneDeep } from 'lodash';\nimport { focusNextInput, focusPreviousInput } from './utils';\n\nconst callChange = (event, handlers, isArrowChange) => {\n if (event.target.name === 'day') handlers.onDayChange(event, isArrowChange);\n if (event.target.name === 'month') handlers.onMonthChange(event, isArrowChange);\n if (event.target.name === 'year') handlers.onYearChange(event, isArrowChange);\n};\n\nconst setTarget = (event, v) => {\n const n = cloneDeep(event);\n let newValue = parseInt(n.target.value || 0, 10) + v;\n if (newValue < 1) newValue = '01';\n if (event.target.name === 'day' && newValue > 31) newValue = 31;\n if (event.target.name === 'month' && newValue > 12) newValue = 12;\n n.target.value = newValue;\n return n;\n};\n\n// eslint-disable-next-line max-statements, complexity\nexport const onKeyDownHelper = (event, handlers) => {\n switch (event.key) {\n case 'ArrowLeft': {\n event.preventDefault();\n focusPreviousInput(event.target);\n break;\n }\n case 'ArrowUp': {\n event.preventDefault();\n const n = setTarget(event, 1);\n callChange(n, handlers, true);\n break;\n }\n case 'ArrowDown': {\n event.preventDefault();\n const n = setTarget(event, -1);\n callChange(n, handlers, true);\n break;\n }\n case 'ArrowRight': {\n event.preventDefault();\n focusNextInput(event.target);\n break;\n }\n case 'Tab': {\n if (event.shiftKey) break;\n if (event.target.value.length > 0 && event.target.name !== 'year') event.preventDefault();\n callChange(event, handlers);\n break;\n }\n case 'Backspace': {\n // HTML Date input behavior, clear everything when deleting\n event.preventDefault();\n const n = cloneDeep(event);\n n.target.value = '';\n callChange(n, handlers, true);\n break;\n }\n case 'Enter': {\n break;\n }\n default:\n break;\n }\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { cloneDeep } from 'lodash';\nimport { focusNextInput, focusPreviousInput } from './utils.js';\n\nconst callChange = (event, handlers, isArrowChange) => {\n if (event.target.name === 'day') handlers.onDayChange(event, isArrowChange);\n if (event.target.name === 'month') handlers.onMonthChange(event, isArrowChange);\n if (event.target.name === 'year') handlers.onYearChange(event, isArrowChange);\n};\n\nconst setTarget = (event, v) => {\n const n = cloneDeep(event);\n let newValue = parseInt(n.target.value || 0, 10) + v;\n if (newValue < 1) newValue = '01';\n if (event.target.name === 'day' && newValue > 31) newValue = 31;\n if (event.target.name === 'month' && newValue > 12) newValue = 12;\n n.target.value = newValue;\n return n;\n};\n\n// eslint-disable-next-line max-statements, complexity\nexport const onKeyDownHelper = (event, handlers) => {\n switch (event.key) {\n case 'ArrowLeft': {\n event.preventDefault();\n focusPreviousInput(event.target);\n break;\n }\n case 'ArrowUp': {\n event.preventDefault();\n const n = setTarget(event, 1);\n callChange(n, handlers, true);\n break;\n }\n case 'ArrowDown': {\n event.preventDefault();\n const n = setTarget(event, -1);\n callChange(n, handlers, true);\n break;\n }\n case 'ArrowRight': {\n event.preventDefault();\n focusNextInput(event.target);\n break;\n }\n case 'Tab': {\n if (event.shiftKey) break;\n if (event.target.value.length > 0 && event.target.name !== 'year') event.preventDefault();\n callChange(event, handlers);\n break;\n }\n case 'Backspace': {\n // HTML Date input behavior, clear everything when deleting\n event.preventDefault();\n const n = cloneDeep(event);\n n.target.value = '';\n callChange(n, handlers, true);\n break;\n }\n case 'Enter': {\n break;\n }\n default:\n break;\n }\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB,0BAA0B;AAEnD,MAAM,aAAa,CAAC,OAAO,UAAU,kBAAkB;AACrD,MAAI,MAAM,OAAO,SAAS;AAAO,aAAS,YAAY,OAAO,aAAa;AAC1E,MAAI,MAAM,OAAO,SAAS;AAAS,aAAS,cAAc,OAAO,aAAa;AAC9E,MAAI,MAAM,OAAO,SAAS;AAAQ,aAAS,aAAa,OAAO,aAAa;AAC9E;AAEA,MAAM,YAAY,CAAC,OAAO,MAAM;AAC9B,QAAM,IAAI,UAAU,KAAK;AACzB,MAAI,WAAW,SAAS,EAAE,OAAO,SAAS,GAAG,EAAE,IAAI;AACnD,MAAI,WAAW;AAAG,eAAW;AAC7B,MAAI,MAAM,OAAO,SAAS,SAAS,WAAW;AAAI,eAAW;AAC7D,MAAI,MAAM,OAAO,SAAS,WAAW,WAAW;AAAI,eAAW;AAC/D,IAAE,OAAO,QAAQ;AACjB,SAAO;AACT;AAGO,MAAM,kBAAkB,CAAC,OAAO,aAAa;AAClD,UAAQ,MAAM,KAAK;AAAA,IACjB,KAAK,aAAa;AAChB,YAAM,eAAe;AACrB,yBAAmB,MAAM,MAAM;AAC/B;AAAA,IACF;AAAA,IACA,KAAK,WAAW;AACd,YAAM,eAAe;AACrB,YAAM,IAAI,UAAU,OAAO,CAAC;AAC5B,iBAAW,GAAG,UAAU,IAAI;AAC5B;AAAA,IACF;AAAA,IACA,KAAK,aAAa;AAChB,YAAM,eAAe;AACrB,YAAM,IAAI,UAAU,OAAO,EAAE;AAC7B,iBAAW,GAAG,UAAU,IAAI;AAC5B;AAAA,IACF;AAAA,IACA,KAAK,cAAc;AACjB,YAAM,eAAe;AACrB,qBAAe,MAAM,MAAM;AAC3B;AAAA,IACF;AAAA,IACA,KAAK,OAAO;AACV,UAAI,MAAM;AAAU;AACpB,UAAI,MAAM,OAAO,MAAM,SAAS,KAAK,MAAM,OAAO,SAAS;AAAQ,cAAM,eAAe;AACxF,iBAAW,OAAO,QAAQ;AAC1B;AAAA,IACF;AAAA,IACA,KAAK,aAAa;AAEhB,YAAM,eAAe;AACrB,YAAM,IAAI,UAAU,KAAK;AACzB,QAAE,OAAO,QAAQ;AACjB,iBAAW,GAAG,UAAU,IAAI;AAC5B;AAAA,IACF;AAAA,IACA,KAAK,SAAS;AACZ;AAAA,IACF;AAAA,IACA;AACE;AAAA,EACJ;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,18 +1,48 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { PropTypes } from "@elliemae/ds-
|
|
2
|
+
import { PropTypes } from "@elliemae/ds-props-helpers";
|
|
3
3
|
import { noop } from "lodash";
|
|
4
4
|
const props = {
|
|
5
|
+
/** Props to inject to date input wrapper */
|
|
5
6
|
containerProps: PropTypes.object.description("Props to inject to date input wrapper"),
|
|
7
|
+
/**
|
|
8
|
+
* Triggers the onBlur when focus moves out of date input
|
|
9
|
+
*/
|
|
6
10
|
onBlur: PropTypes.func.description("Triggers the onBlur when focus moves out of date input"),
|
|
11
|
+
/**
|
|
12
|
+
* Triggers the onFocus when the component gets the focus
|
|
13
|
+
*/
|
|
7
14
|
onFocus: PropTypes.func.description("Triggers the onFocus when the component gets the focus"),
|
|
15
|
+
/**
|
|
16
|
+
* Triggers the onKeyDown
|
|
17
|
+
*/
|
|
8
18
|
onKeyDown: PropTypes.func.description("Triggers the onKeyDown"),
|
|
19
|
+
/**
|
|
20
|
+
* Allows a function that is triggered once the date input changes
|
|
21
|
+
*/
|
|
9
22
|
onChange: PropTypes.func.description("Allows a function that is triggered once the date input changes"),
|
|
23
|
+
/**
|
|
24
|
+
* Triggers when the date is completely set and only once you have blurred the
|
|
25
|
+
* corresponding input. For example if you are editing the day and the year and month
|
|
26
|
+
* are already set, once you completely set the day it will trigger.
|
|
27
|
+
*/
|
|
10
28
|
onDateChange: PropTypes.func.description(
|
|
11
29
|
" Triggers when the date is completely set and only once you have blurred the corresponding input. For example if you are editing the day and the year and month are already set, once you completely set the day it will trigger."
|
|
12
30
|
),
|
|
31
|
+
/**
|
|
32
|
+
* Triggers the onError once one input date is wrong
|
|
33
|
+
*/
|
|
13
34
|
onError: PropTypes.func.description("Triggers the onError once one input date is wrong"),
|
|
35
|
+
/**
|
|
36
|
+
* Default value once the component is initialized MMDDYYYY
|
|
37
|
+
*/
|
|
14
38
|
value: PropTypes.string.description("Default value once the component is initialized MMDDYYYY"),
|
|
39
|
+
/**
|
|
40
|
+
* Whether the date input is disabled or not
|
|
41
|
+
*/
|
|
15
42
|
disabled: PropTypes.bool.description("Whether the date input is disabled or not"),
|
|
43
|
+
/**
|
|
44
|
+
* tab index
|
|
45
|
+
*/
|
|
16
46
|
tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("tab index")
|
|
17
47
|
};
|
|
18
48
|
const defaultProps = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/DateInputV2/components/props.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from '@elliemae/ds-
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAC1B,SAAS,YAAY;AAEd,MAAM,QAAQ;AAAA,EAEnB,gBAAgB,UAAU,OAAO,YAAY,uCAAuC;AAAA,EAIpF,QAAQ,UAAU,KAAK,YAAY,wDAAwD;AAAA,EAI3F,SAAS,UAAU,KAAK,YAAY,wDAAwD;AAAA,EAI5F,WAAW,UAAU,KAAK,YAAY,wBAAwB;AAAA,EAI9D,UAAU,UAAU,KAAK,YAAY,iEAAiE;AAAA,EAMtG,cAAc,UAAU,KAAK;AAAA,IAC3B;AAAA,EACF;AAAA,EAIA,SAAS,UAAU,KAAK,YAAY,mDAAmD;AAAA,EAIvF,OAAO,UAAU,OAAO,YAAY,0DAA0D;AAAA,EAI9F,UAAU,UAAU,KAAK,YAAY,2CAA2C;AAAA,EAIhF,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE,YAAY,WAAW;AAC7F;AAEO,MAAM,eAAe;AAAA,EAC1B,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,cAAc;AAAA,EACd,WAAW;AAAA,EACX,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,EACV,gBAAgB,CAAC;AACnB;",
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from '@elliemae/ds-props-helpers';\nimport { noop } from 'lodash';\n\nexport const props = {\n /** Props to inject to date input wrapper */\n containerProps: PropTypes.object.description('Props to inject to date input wrapper'),\n /**\n * Triggers the onBlur when focus moves out of date input\n */\n onBlur: PropTypes.func.description('Triggers the onBlur when focus moves out of date input'),\n /**\n * Triggers the onFocus when the component gets the focus\n */\n onFocus: PropTypes.func.description('Triggers the onFocus when the component gets the focus'),\n /**\n * Triggers the onKeyDown\n */\n onKeyDown: PropTypes.func.description('Triggers the onKeyDown'),\n /**\n * Allows a function that is triggered once the date input changes\n */\n onChange: PropTypes.func.description('Allows a function that is triggered once the date input changes'),\n /**\n * Triggers when the date is completely set and only once you have blurred the\n * corresponding input. For example if you are editing the day and the year and month\n * are already set, once you completely set the day it will trigger.\n */\n onDateChange: PropTypes.func.description(\n ' Triggers when the date is completely set and only once you have blurred the corresponding input. For example if you are editing the day and the year and month are already set, once you completely set the day it will trigger.',\n ),\n /**\n * Triggers the onError once one input date is wrong\n */\n onError: PropTypes.func.description('Triggers the onError once one input date is wrong'),\n /**\n * Default value once the component is initialized MMDDYYYY\n */\n value: PropTypes.string.description('Default value once the component is initialized MMDDYYYY'),\n /**\n * Whether the date input is disabled or not\n */\n disabled: PropTypes.bool.description('Whether the date input is disabled or not'),\n /**\n * tab index\n */\n tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('tab index'),\n};\n\nexport const defaultProps = {\n onFocus: noop,\n onBlur: noop,\n onChange: noop,\n onDateChange: noop,\n onKeyDown: noop,\n onError: noop,\n value: '',\n disabled: false,\n containerProps: {},\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAC1B,SAAS,YAAY;AAEd,MAAM,QAAQ;AAAA;AAAA,EAEnB,gBAAgB,UAAU,OAAO,YAAY,uCAAuC;AAAA;AAAA;AAAA;AAAA,EAIpF,QAAQ,UAAU,KAAK,YAAY,wDAAwD;AAAA;AAAA;AAAA;AAAA,EAI3F,SAAS,UAAU,KAAK,YAAY,wDAAwD;AAAA;AAAA;AAAA;AAAA,EAI5F,WAAW,UAAU,KAAK,YAAY,wBAAwB;AAAA;AAAA;AAAA;AAAA,EAI9D,UAAU,UAAU,KAAK,YAAY,iEAAiE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMtG,cAAc,UAAU,KAAK;AAAA,IAC3B;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAIA,SAAS,UAAU,KAAK,YAAY,mDAAmD;AAAA;AAAA;AAAA;AAAA,EAIvF,OAAO,UAAU,OAAO,YAAY,0DAA0D;AAAA;AAAA;AAAA;AAAA,EAI9F,UAAU,UAAU,KAAK,YAAY,2CAA2C;AAAA;AAAA;AAAA;AAAA,EAIhF,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE,YAAY,WAAW;AAC7F;AAEO,MAAM,eAAe;AAAA,EAC1B,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,cAAc;AAAA,EACd,WAAW;AAAA,EACX,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,EACV,gBAAgB,CAAC;AACnB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/DateInputV2/components/styled.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\n\nexport const DateInputFluidContainer = styled(Grid)`\n width: 100%;\n height: 100%;\n align-items: center;\n`;\n\nexport const DateInputWrapper = styled(Grid)`\n align-items: center;\n align-content: center;\n ${({ disabled, theme }) =>\n disabled\n ? `\n background: ${theme.colors.neutral[100]};\n color: ${theme.colors.neutral[500]};\n `\n : ''}\n width: 102px;\n\n &:focus {\n outline-style: none;\n box-shadow: none;\n border-color: transparent;\n }\n`;\n\nexport const DateInputInput = styled.input`\n outline: none;\n border: none;\n border-radius: 0;\n width: ${(props) => (props.size === 'l' ? '38px' : '25px')};\n height: ${(props) => props.theme.space.xs};\n ${({ disabled, theme }) =>\n disabled\n ? `\n background: ${theme.colors.neutral[100]};\n color: ${theme.colors.neutral[500]};\n `\n : ''}\n padding-left: 4px;\n padding-right: 0px;\n &::placeholder {\n font-size: 95%;\n font-style: italic;\n }\n :-moz-placeholder {\n font-size: 95%;\n font-style: italic;\n }\n\n ::-moz-placeholder {\n font-size: 95%;\n font-style: italic;\n }\n &:focus {\n background: ${({ theme }) => theme.colors.brand['300']};\n background-clip: content-box;\n }\n ::-moz-selection {\n background: transparent;\n }\n ::selection {\n background: transparent;\n }\n`;\n\nexport const DateInputDivider = styled.div`\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