@elliemae/ds-form 3.16.0 → 3.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Checkbox/index.js +4 -0
- package/dist/cjs/Checkbox/index.js.map +1 -1
- package/dist/cjs/CheckboxGroup/DSCheckboxGroup.js +8 -4
- package/dist/cjs/CheckboxGroup/DSCheckboxGroup.js.map +2 -2
- package/dist/cjs/CheckboxGroup/defaultProps.js +4 -0
- package/dist/cjs/CheckboxGroup/defaultProps.js.map +1 -1
- package/dist/cjs/CheckboxGroup/index.js +5 -1
- package/dist/cjs/CheckboxGroup/index.js.map +2 -2
- package/dist/cjs/CheckboxGroup/props.js +23 -1
- package/dist/cjs/CheckboxGroup/props.js.map +2 -2
- package/dist/cjs/ComboBox/index.js +4 -0
- package/dist/cjs/ComboBox/index.js.map +1 -1
- package/dist/cjs/ComboBoxFreeSolo/ComboBoxFreeSolo.js +52 -5
- package/dist/cjs/ComboBoxFreeSolo/ComboBoxFreeSolo.js.map +2 -2
- package/dist/cjs/ComboBoxFreeSolo/components/MultiValueLabel.js +4 -0
- package/dist/cjs/ComboBoxFreeSolo/components/MultiValueLabel.js.map +1 -1
- package/dist/cjs/ComboBoxFreeSolo/components/MultiValueRemove.js +4 -0
- package/dist/cjs/ComboBoxFreeSolo/components/MultiValueRemove.js.map +1 -1
- package/dist/cjs/ComboBoxFreeSolo/components/SingleValue.js +6 -2
- package/dist/cjs/ComboBoxFreeSolo/components/SingleValue.js.map +2 -2
- package/dist/cjs/ComboBoxFreeSolo/components/SingleValueRemove.js +4 -0
- package/dist/cjs/ComboBoxFreeSolo/components/SingleValueRemove.js.map +1 -1
- package/dist/cjs/ComboBoxFreeSolo/index.js +5 -1
- package/dist/cjs/ComboBoxFreeSolo/index.js.map +2 -2
- package/dist/cjs/DateInput/DSDateInput.js +9 -4
- package/dist/cjs/DateInput/DSDateInput.js.map +2 -2
- package/dist/cjs/DateInput/components/DateInputImpl.js +6 -1
- package/dist/cjs/DateInput/components/DateInputImpl.js.map +2 -2
- package/dist/cjs/DateInput/components/DateInputs.js +8 -1
- package/dist/cjs/DateInput/components/DateInputs.js.map +2 -2
- package/dist/cjs/DateInput/components/utils.js +5 -1
- package/dist/cjs/DateInput/components/utils.js.map +1 -1
- package/dist/cjs/DateInput/defaultProps.js +5 -1
- package/dist/cjs/DateInput/defaultProps.js.map +1 -1
- package/dist/cjs/DateInput/index.js +5 -1
- package/dist/cjs/DateInput/index.js.map +2 -2
- package/dist/cjs/DateInput/props.js +46 -0
- package/dist/cjs/DateInput/props.js.map +1 -1
- package/dist/cjs/DateInputV2/components/DSDateInput.js +7 -3
- package/dist/cjs/DateInputV2/components/DSDateInput.js.map +2 -2
- package/dist/cjs/DateInputV2/components/DateInputs.js +9 -4
- package/dist/cjs/DateInputV2/components/DateInputs.js.map +2 -2
- package/dist/cjs/DateInputV2/components/helpers.js +5 -1
- package/dist/cjs/DateInputV2/components/helpers.js.map +2 -2
- package/dist/cjs/DateInputV2/components/props.js +34 -0
- package/dist/cjs/DateInputV2/components/props.js.map +1 -1
- package/dist/cjs/DateInputV2/components/propsTypes.js +4 -0
- package/dist/cjs/DateInputV2/components/propsTypes.js.map +1 -1
- package/dist/cjs/DateInputV2/components/styled.js +4 -0
- package/dist/cjs/DateInputV2/components/styled.js.map +1 -1
- package/dist/cjs/DateInputV2/components/utils.js +5 -1
- package/dist/cjs/DateInputV2/components/utils.js.map +1 -1
- package/dist/cjs/DateInputV2/index.js +6 -2
- package/dist/cjs/DateInputV2/index.js.map +2 -2
- package/dist/cjs/ExpandableInput/DSExpandableInput.js +5 -1
- package/dist/cjs/ExpandableInput/DSExpandableInput.js.map +2 -2
- package/dist/cjs/ExpandableInput/ExpandableInputImpl.js +5 -1
- package/dist/cjs/ExpandableInput/ExpandableInputImpl.js.map +2 -2
- package/dist/cjs/ExpandableInput/index.js +5 -1
- package/dist/cjs/ExpandableInput/index.js.map +2 -2
- package/dist/cjs/FloatingLabelInput/DSFloatingLabelInput.js +70 -3
- package/dist/cjs/FloatingLabelInput/DSFloatingLabelInput.js.map +2 -2
- package/dist/cjs/FloatingLabelInput/FloatingLabelInputImpl.js +6 -2
- package/dist/cjs/FloatingLabelInput/FloatingLabelInputImpl.js.map +2 -2
- package/dist/cjs/FloatingLabelInput/getSvgPath.js +7 -1
- package/dist/cjs/FloatingLabelInput/getSvgPath.js.map +1 -1
- package/dist/cjs/FloatingLabelInput/index.js +5 -1
- package/dist/cjs/FloatingLabelInput/index.js.map +2 -2
- package/dist/cjs/FormItem/DSFormItemLayout.js +13 -7
- package/dist/cjs/FormItem/DSFormItemLayout.js.map +2 -2
- package/dist/cjs/FormItem/Error/DSError.js +6 -0
- package/dist/cjs/FormItem/Error/DSError.js.map +1 -1
- package/dist/cjs/FormItem/Feedback.js +4 -0
- package/dist/cjs/FormItem/Feedback.js.map +1 -1
- package/dist/cjs/FormItem/Label/DSLabel.js +5 -1
- package/dist/cjs/FormItem/Label/DSLabel.js.map +2 -2
- package/dist/cjs/FormItem/Suffix/Suffix.js +4 -0
- package/dist/cjs/FormItem/Suffix/Suffix.js.map +1 -1
- package/dist/cjs/FormItem/ValidationFieldWrapper.js +5 -0
- package/dist/cjs/FormItem/ValidationFieldWrapper.js.map +1 -1
- package/dist/cjs/FormItem/defaultProps.js +8 -4
- package/dist/cjs/FormItem/defaultProps.js.map +2 -2
- package/dist/cjs/FormItem/index.js +6 -2
- package/dist/cjs/FormItem/index.js.map +2 -2
- package/dist/cjs/FormItem/props.js +45 -1
- package/dist/cjs/FormItem/props.js.map +2 -2
- package/dist/cjs/FormItem/variants.js +4 -0
- package/dist/cjs/FormItem/variants.js.map +1 -1
- package/dist/cjs/Input/DSInput.js +4 -0
- package/dist/cjs/Input/DSInput.js.map +1 -1
- package/dist/cjs/Input/InputAddonWrapper.js +4 -0
- package/dist/cjs/Input/InputAddonWrapper.js.map +1 -1
- package/dist/cjs/Input/InputImpl.js +4 -0
- package/dist/cjs/Input/InputImpl.js.map +1 -1
- package/dist/cjs/Input/index.js +4 -0
- package/dist/cjs/Input/index.js.map +1 -1
- package/dist/cjs/InputGroup/AddonWrapper.js +4 -0
- package/dist/cjs/InputGroup/AddonWrapper.js.map +1 -1
- package/dist/cjs/InputGroup/DSInputGroup.js +8 -3
- package/dist/cjs/InputGroup/DSInputGroup.js.map +2 -2
- package/dist/cjs/InputGroup/defaultProps.js +4 -0
- package/dist/cjs/InputGroup/defaultProps.js.map +1 -1
- package/dist/cjs/InputGroup/index.js +5 -1
- package/dist/cjs/InputGroup/index.js.map +2 -2
- package/dist/cjs/InputGroup/props.js +19 -0
- package/dist/cjs/InputGroup/props.js.map +1 -1
- package/dist/cjs/InputMask/DSInputMask.js +10 -6
- package/dist/cjs/InputMask/DSInputMask.js.map +2 -2
- package/dist/cjs/InputMask/DSInputMaskDeprecated.js +13 -2
- package/dist/cjs/InputMask/DSInputMaskDeprecated.js.map +2 -2
- package/dist/cjs/InputMask/InputMaskContext.js +4 -0
- package/dist/cjs/InputMask/InputMaskContext.js.map +2 -2
- package/dist/cjs/InputMask/MaskPipes.js +5 -1
- package/dist/cjs/InputMask/MaskPipes.js.map +2 -2
- package/dist/cjs/InputMask/MaskTypes.js +4 -0
- package/dist/cjs/InputMask/MaskTypes.js.map +1 -1
- package/dist/cjs/InputMask/addons/AutoCorrectedDatePipe.js +4 -0
- package/dist/cjs/InputMask/addons/AutoCorrectedDatePipe.js.map +1 -1
- package/dist/cjs/InputMask/defaultProps.js +5 -1
- package/dist/cjs/InputMask/defaultProps.js.map +2 -2
- package/dist/cjs/InputMask/index.js +5 -1
- package/dist/cjs/InputMask/index.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/DateInputMask.js +6 -2
- package/dist/cjs/InputMask/mask_types/DateInputMask.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/DateTimeInputMask.js +6 -2
- package/dist/cjs/InputMask/mask_types/DateTimeInputMask.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/DictionaryInputMask.js +6 -2
- package/dist/cjs/InputMask/mask_types/DictionaryInputMask.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/NumberInputMask.js +6 -2
- package/dist/cjs/InputMask/mask_types/NumberInputMask.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/PhoneInputMask.js +6 -2
- package/dist/cjs/InputMask/mask_types/PhoneInputMask.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/PhoneInternationalInputMask.js +6 -2
- package/dist/cjs/InputMask/mask_types/PhoneInternationalInputMask.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/SsnInputMask.js +6 -2
- package/dist/cjs/InputMask/mask_types/SsnInputMask.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/UsZipCodeInputMask.js +6 -2
- package/dist/cjs/InputMask/mask_types/UsZipCodeInputMask.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/ZipCodeSearchInputMask.js +6 -2
- package/dist/cjs/InputMask/mask_types/ZipCodeSearchInputMask.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/index.js +13 -9
- package/dist/cjs/InputMask/mask_types/index.js.map +2 -2
- package/dist/cjs/InputMask/props.js +84 -0
- package/dist/cjs/InputMask/props.js.map +1 -1
- package/dist/cjs/InputMask/types/index.js +4 -0
- package/dist/cjs/InputMask/types/index.js.map +1 -1
- package/dist/cjs/InputMask/utils/setCaretPosition.js +4 -0
- package/dist/cjs/InputMask/utils/setCaretPosition.js.map +1 -1
- package/dist/cjs/InputProtected/DSInputProtected.js +9 -5
- package/dist/cjs/InputProtected/DSInputProtected.js.map +2 -2
- package/dist/cjs/InputProtected/defaultProps.js +5 -1
- package/dist/cjs/InputProtected/defaultProps.js.map +2 -2
- package/dist/cjs/InputProtected/index.js +6 -2
- package/dist/cjs/InputProtected/index.js.map +2 -2
- package/dist/cjs/InputProtected/options.js +4 -0
- package/dist/cjs/InputProtected/options.js.map +1 -1
- package/dist/cjs/InputProtected/props.js +9 -1
- package/dist/cjs/InputProtected/props.js.map +2 -2
- package/dist/cjs/LargeInputText/DSLargeInputText.js +6 -2
- package/dist/cjs/LargeInputText/DSLargeInputText.js.map +2 -2
- package/dist/cjs/LargeInputText/defaultProps.js +4 -0
- package/dist/cjs/LargeInputText/defaultProps.js.map +1 -1
- package/dist/cjs/LargeInputText/index.js +5 -1
- package/dist/cjs/LargeInputText/index.js.map +2 -2
- package/dist/cjs/LargeInputText/props.js +70 -0
- package/dist/cjs/LargeInputText/props.js.map +1 -1
- package/dist/cjs/MenuItem/components/MenuItem/index.js +4 -0
- package/dist/cjs/MenuItem/components/MenuItem/index.js.map +1 -1
- package/dist/cjs/MenuItem/components/MenuItem/styled.js +4 -0
- package/dist/cjs/MenuItem/components/MenuItem/styled.js.map +1 -1
- package/dist/cjs/MenuItem/components/MultiMenuItem/MultiMenuItem.js +4 -0
- package/dist/cjs/MenuItem/components/MultiMenuItem/MultiMenuItem.js.map +1 -1
- package/dist/cjs/MenuItem/components/MultiMenuItem/styled.js +4 -0
- package/dist/cjs/MenuItem/components/MultiMenuItem/styled.js.map +1 -1
- package/dist/cjs/MenuItem/components/Section/index.js +4 -0
- package/dist/cjs/MenuItem/components/Section/index.js.map +1 -1
- package/dist/cjs/MenuItem/components/Section/props.js +4 -0
- package/dist/cjs/MenuItem/components/Section/props.js.map +1 -1
- package/dist/cjs/MenuItem/components/Section/styled.js +4 -0
- package/dist/cjs/MenuItem/components/Section/styled.js.map +1 -1
- package/dist/cjs/MenuItem/components/Separator/index.js +4 -0
- package/dist/cjs/MenuItem/components/Separator/index.js.map +1 -1
- package/dist/cjs/MenuItem/components/Separator/styled.js +4 -0
- package/dist/cjs/MenuItem/components/Separator/styled.js.map +1 -1
- package/dist/cjs/MenuItem/components/SingleMenuItem/SingleMenuItem.js +4 -0
- package/dist/cjs/MenuItem/components/SingleMenuItem/SingleMenuItem.js.map +1 -1
- package/dist/cjs/MenuItem/components/SubmenuItem/index.js +4 -0
- package/dist/cjs/MenuItem/components/SubmenuItem/index.js.map +1 -1
- package/dist/cjs/MenuItem/components/SubmenuItem/styled.js +4 -0
- package/dist/cjs/MenuItem/components/SubmenuItem/styled.js.map +1 -1
- package/dist/cjs/MenuItem/components/index.js +4 -0
- package/dist/cjs/MenuItem/components/index.js.map +1 -1
- package/dist/cjs/MenuItem/components/styled.js +4 -0
- package/dist/cjs/MenuItem/components/styled.js.map +1 -1
- package/dist/cjs/MenuItem/index.js +4 -0
- package/dist/cjs/MenuItem/index.js.map +1 -1
- package/dist/cjs/MenuItem/props.js +4 -0
- package/dist/cjs/MenuItem/props.js.map +1 -1
- package/dist/cjs/Radio/Circle.js +4 -0
- package/dist/cjs/Radio/Circle.js.map +1 -1
- package/dist/cjs/Radio/DSRadio.js +35 -1
- package/dist/cjs/Radio/DSRadio.js.map +2 -2
- package/dist/cjs/Radio/index.js +5 -1
- package/dist/cjs/Radio/index.js.map +2 -2
- package/dist/cjs/RadioGroup/DSRadioGroup.js +8 -4
- package/dist/cjs/RadioGroup/DSRadioGroup.js.map +2 -2
- package/dist/cjs/RadioGroup/defaultProps.js +4 -0
- package/dist/cjs/RadioGroup/defaultProps.js.map +1 -1
- package/dist/cjs/RadioGroup/index.js +5 -1
- package/dist/cjs/RadioGroup/index.js.map +2 -2
- package/dist/cjs/RadioGroup/props.js +20 -0
- package/dist/cjs/RadioGroup/props.js.map +1 -1
- package/dist/cjs/RequiredMark/RequiredMark.js +4 -0
- package/dist/cjs/RequiredMark/RequiredMark.js.map +1 -1
- package/dist/cjs/RequiredMark/index.js +5 -1
- package/dist/cjs/RequiredMark/index.js.map +2 -2
- package/dist/cjs/SearchBox/index.js +4 -0
- package/dist/cjs/SearchBox/index.js.map +1 -1
- package/dist/cjs/TextBox/index.js +4 -0
- package/dist/cjs/TextBox/index.js.map +1 -1
- package/dist/cjs/TimeInput/DSTimeInput.js +29 -2
- package/dist/cjs/TimeInput/DSTimeInput.js.map +2 -2
- package/dist/cjs/TimeInput/TimeInputImpl.js +32 -1
- package/dist/cjs/TimeInput/TimeInputImpl.js.map +2 -2
- package/dist/cjs/TimeInput/TimeInputs.js +6 -1
- package/dist/cjs/TimeInput/TimeInputs.js.map +2 -2
- package/dist/cjs/TimeInput/index.js +5 -1
- package/dist/cjs/TimeInput/index.js.map +2 -2
- package/dist/cjs/TimeInput/utils.js +4 -0
- package/dist/cjs/TimeInput/utils.js.map +1 -1
- package/dist/cjs/Toggle/DSToggle.js +38 -1
- package/dist/cjs/Toggle/DSToggle.js.map +2 -2
- package/dist/cjs/Toggle/DSToggleImpl.js +40 -3
- package/dist/cjs/Toggle/DSToggleImpl.js.map +2 -2
- package/dist/cjs/Toggle/DSToggleRender.js +4 -0
- package/dist/cjs/Toggle/DSToggleRender.js.map +1 -1
- package/dist/cjs/Toggle/index.js +5 -1
- package/dist/cjs/Toggle/index.js.map +2 -2
- package/dist/cjs/Toggle/props.js +37 -0
- package/dist/cjs/Toggle/props.js.map +1 -1
- package/dist/cjs/Toggle/toggleHelper.js +4 -0
- package/dist/cjs/Toggle/toggleHelper.js.map +1 -1
- package/dist/cjs/index.js +25 -21
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/package.json +7 -0
- package/dist/esm/CheckboxGroup/DSCheckboxGroup.js +4 -4
- package/dist/esm/CheckboxGroup/DSCheckboxGroup.js.map +2 -2
- package/dist/esm/CheckboxGroup/index.js +1 -1
- package/dist/esm/CheckboxGroup/index.js.map +1 -1
- package/dist/esm/CheckboxGroup/props.js +19 -1
- package/dist/esm/CheckboxGroup/props.js.map +2 -2
- package/dist/esm/ComboBoxFreeSolo/ComboBoxFreeSolo.js +48 -5
- package/dist/esm/ComboBoxFreeSolo/ComboBoxFreeSolo.js.map +2 -2
- package/dist/esm/ComboBoxFreeSolo/components/MultiValueLabel.js.map +1 -1
- package/dist/esm/ComboBoxFreeSolo/components/SingleValue.js +2 -2
- package/dist/esm/ComboBoxFreeSolo/components/SingleValue.js.map +1 -1
- package/dist/esm/ComboBoxFreeSolo/index.js +1 -1
- package/dist/esm/ComboBoxFreeSolo/index.js.map +1 -1
- package/dist/esm/DateInput/DSDateInput.js +5 -4
- package/dist/esm/DateInput/DSDateInput.js.map +2 -2
- package/dist/esm/DateInput/components/DateInputImpl.js +2 -1
- package/dist/esm/DateInput/components/DateInputImpl.js.map +2 -2
- package/dist/esm/DateInput/components/DateInputs.js +4 -1
- package/dist/esm/DateInput/components/DateInputs.js.map +2 -2
- package/dist/esm/DateInput/components/utils.js +1 -1
- package/dist/esm/DateInput/components/utils.js.map +1 -1
- package/dist/esm/DateInput/defaultProps.js +1 -1
- package/dist/esm/DateInput/defaultProps.js.map +1 -1
- package/dist/esm/DateInput/index.js +1 -1
- package/dist/esm/DateInput/index.js.map +1 -1
- package/dist/esm/DateInput/props.js +42 -0
- package/dist/esm/DateInput/props.js.map +1 -1
- package/dist/esm/DateInputV2/components/DSDateInput.js +3 -3
- package/dist/esm/DateInputV2/components/DSDateInput.js.map +1 -1
- package/dist/esm/DateInputV2/components/DateInputs.js +5 -4
- package/dist/esm/DateInputV2/components/DateInputs.js.map +2 -2
- package/dist/esm/DateInputV2/components/helpers.js +1 -1
- package/dist/esm/DateInputV2/components/helpers.js.map +1 -1
- package/dist/esm/DateInputV2/components/props.js +30 -0
- package/dist/esm/DateInputV2/components/props.js.map +1 -1
- package/dist/esm/DateInputV2/components/styled.js.map +1 -1
- package/dist/esm/DateInputV2/components/utils.js +1 -1
- package/dist/esm/DateInputV2/components/utils.js.map +1 -1
- package/dist/esm/DateInputV2/index.js +2 -2
- package/dist/esm/DateInputV2/index.js.map +1 -1
- package/dist/esm/ExpandableInput/DSExpandableInput.js +1 -1
- package/dist/esm/ExpandableInput/DSExpandableInput.js.map +1 -1
- package/dist/esm/ExpandableInput/ExpandableInputImpl.js +1 -1
- package/dist/esm/ExpandableInput/ExpandableInputImpl.js.map +1 -1
- package/dist/esm/ExpandableInput/index.js +1 -1
- package/dist/esm/ExpandableInput/index.js.map +1 -1
- package/dist/esm/FloatingLabelInput/DSFloatingLabelInput.js +66 -3
- package/dist/esm/FloatingLabelInput/DSFloatingLabelInput.js.map +2 -2
- package/dist/esm/FloatingLabelInput/FloatingLabelInputImpl.js +2 -2
- package/dist/esm/FloatingLabelInput/FloatingLabelInputImpl.js.map +1 -1
- package/dist/esm/FloatingLabelInput/getSvgPath.js +3 -1
- package/dist/esm/FloatingLabelInput/getSvgPath.js.map +1 -1
- package/dist/esm/FloatingLabelInput/index.js +1 -1
- package/dist/esm/FloatingLabelInput/index.js.map +1 -1
- package/dist/esm/FormItem/DSFormItemLayout.js +9 -7
- package/dist/esm/FormItem/DSFormItemLayout.js.map +2 -2
- package/dist/esm/FormItem/Error/DSError.js +2 -0
- package/dist/esm/FormItem/Error/DSError.js.map +1 -1
- package/dist/esm/FormItem/Label/DSLabel.js +1 -1
- package/dist/esm/FormItem/Label/DSLabel.js.map +1 -1
- package/dist/esm/FormItem/ValidationFieldWrapper.js +1 -0
- package/dist/esm/FormItem/ValidationFieldWrapper.js.map +1 -1
- package/dist/esm/FormItem/defaultProps.js +4 -4
- package/dist/esm/FormItem/defaultProps.js.map +1 -1
- package/dist/esm/FormItem/index.js +2 -2
- package/dist/esm/FormItem/index.js.map +1 -1
- package/dist/esm/FormItem/props.js +41 -1
- package/dist/esm/FormItem/props.js.map +2 -2
- package/dist/esm/InputGroup/DSInputGroup.js +4 -3
- package/dist/esm/InputGroup/DSInputGroup.js.map +2 -2
- package/dist/esm/InputGroup/index.js +1 -1
- package/dist/esm/InputGroup/index.js.map +1 -1
- package/dist/esm/InputGroup/props.js +15 -0
- package/dist/esm/InputGroup/props.js.map +1 -1
- package/dist/esm/InputMask/DSInputMask.js +6 -6
- package/dist/esm/InputMask/DSInputMask.js.map +2 -2
- package/dist/esm/InputMask/DSInputMaskDeprecated.js +9 -2
- package/dist/esm/InputMask/DSInputMaskDeprecated.js.map +2 -2
- package/dist/esm/InputMask/InputMaskContext.js.map +1 -1
- package/dist/esm/InputMask/MaskPipes.js +1 -1
- package/dist/esm/InputMask/MaskPipes.js.map +1 -1
- package/dist/esm/InputMask/addons/AutoCorrectedDatePipe.js.map +1 -1
- package/dist/esm/InputMask/defaultProps.js +1 -1
- package/dist/esm/InputMask/defaultProps.js.map +1 -1
- package/dist/esm/InputMask/index.js +1 -1
- package/dist/esm/InputMask/index.js.map +1 -1
- package/dist/esm/InputMask/mask_types/DateInputMask.js +2 -2
- package/dist/esm/InputMask/mask_types/DateInputMask.js.map +2 -2
- package/dist/esm/InputMask/mask_types/DateTimeInputMask.js +2 -2
- package/dist/esm/InputMask/mask_types/DateTimeInputMask.js.map +2 -2
- package/dist/esm/InputMask/mask_types/DictionaryInputMask.js +2 -2
- package/dist/esm/InputMask/mask_types/DictionaryInputMask.js.map +2 -2
- package/dist/esm/InputMask/mask_types/NumberInputMask.js +2 -2
- package/dist/esm/InputMask/mask_types/NumberInputMask.js.map +2 -2
- package/dist/esm/InputMask/mask_types/PhoneInputMask.js +2 -2
- package/dist/esm/InputMask/mask_types/PhoneInputMask.js.map +2 -2
- package/dist/esm/InputMask/mask_types/PhoneInternationalInputMask.js +2 -2
- package/dist/esm/InputMask/mask_types/PhoneInternationalInputMask.js.map +2 -2
- package/dist/esm/InputMask/mask_types/SsnInputMask.js +2 -2
- package/dist/esm/InputMask/mask_types/SsnInputMask.js.map +2 -2
- package/dist/esm/InputMask/mask_types/UsZipCodeInputMask.js +2 -2
- package/dist/esm/InputMask/mask_types/UsZipCodeInputMask.js.map +2 -2
- package/dist/esm/InputMask/mask_types/ZipCodeSearchInputMask.js +2 -2
- package/dist/esm/InputMask/mask_types/ZipCodeSearchInputMask.js.map +2 -2
- package/dist/esm/InputMask/mask_types/index.js +9 -9
- package/dist/esm/InputMask/mask_types/index.js.map +2 -2
- package/dist/esm/InputMask/props.js +80 -0
- package/dist/esm/InputMask/props.js.map +1 -1
- package/dist/esm/InputProtected/DSInputProtected.js +5 -5
- package/dist/esm/InputProtected/DSInputProtected.js.map +2 -2
- package/dist/esm/InputProtected/defaultProps.js +1 -1
- package/dist/esm/InputProtected/defaultProps.js.map +1 -1
- package/dist/esm/InputProtected/index.js +2 -2
- package/dist/esm/InputProtected/index.js.map +1 -1
- package/dist/esm/InputProtected/props.js +5 -1
- package/dist/esm/InputProtected/props.js.map +2 -2
- package/dist/esm/LargeInputText/DSLargeInputText.js +2 -2
- package/dist/esm/LargeInputText/DSLargeInputText.js.map +1 -1
- package/dist/esm/LargeInputText/index.js +1 -1
- package/dist/esm/LargeInputText/index.js.map +1 -1
- package/dist/esm/LargeInputText/props.js +66 -0
- package/dist/esm/LargeInputText/props.js.map +1 -1
- package/dist/esm/Radio/Circle.js.map +1 -1
- package/dist/esm/Radio/DSRadio.js +31 -1
- package/dist/esm/Radio/DSRadio.js.map +2 -2
- package/dist/esm/Radio/index.js +1 -1
- package/dist/esm/Radio/index.js.map +1 -1
- package/dist/esm/RadioGroup/DSRadioGroup.js +4 -4
- package/dist/esm/RadioGroup/DSRadioGroup.js.map +2 -2
- package/dist/esm/RadioGroup/index.js +1 -1
- package/dist/esm/RadioGroup/index.js.map +1 -1
- package/dist/esm/RadioGroup/props.js +16 -0
- package/dist/esm/RadioGroup/props.js.map +1 -1
- package/dist/esm/RequiredMark/index.js +1 -1
- package/dist/esm/RequiredMark/index.js.map +1 -1
- package/dist/esm/TimeInput/DSTimeInput.js +25 -2
- package/dist/esm/TimeInput/DSTimeInput.js.map +2 -2
- package/dist/esm/TimeInput/TimeInputImpl.js +28 -1
- package/dist/esm/TimeInput/TimeInputImpl.js.map +2 -2
- package/dist/esm/TimeInput/TimeInputs.js +2 -1
- package/dist/esm/TimeInput/TimeInputs.js.map +2 -2
- package/dist/esm/TimeInput/index.js +1 -1
- package/dist/esm/TimeInput/index.js.map +1 -1
- package/dist/esm/Toggle/DSToggle.js +34 -1
- package/dist/esm/Toggle/DSToggle.js.map +2 -2
- package/dist/esm/Toggle/DSToggleImpl.js +36 -3
- package/dist/esm/Toggle/DSToggleImpl.js.map +2 -2
- package/dist/esm/Toggle/index.js +1 -1
- package/dist/esm/Toggle/index.js.map +1 -1
- package/dist/esm/Toggle/props.js +33 -0
- package/dist/esm/Toggle/props.js.map +1 -1
- package/dist/esm/index.js +21 -21
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +7 -0
- package/package.json +18 -18
- package/dist/types/Checkbox/index.d.ts +0 -1
- package/dist/types/CheckboxGroup/DSCheckboxGroup.d.ts +0 -46
- package/dist/types/CheckboxGroup/defaultProps.d.ts +0 -14
- package/dist/types/CheckboxGroup/index.d.ts +0 -1
- package/dist/types/CheckboxGroup/props.d.ts +0 -26
- package/dist/types/CheckboxGroup/tests/DSCheckboxGroup.events.test.d.ts +0 -1
- package/dist/types/ComboBox/index.d.ts +0 -1
- package/dist/types/ComboBoxFreeSolo/ComboBoxFreeSolo.d.ts +0 -78
- package/dist/types/ComboBoxFreeSolo/components/MultiValueLabel.d.ts +0 -5
- package/dist/types/ComboBoxFreeSolo/components/MultiValueRemove.d.ts +0 -5
- package/dist/types/ComboBoxFreeSolo/components/SingleValue.d.ts +0 -2
- package/dist/types/ComboBoxFreeSolo/components/SingleValueRemove.d.ts +0 -5
- package/dist/types/ComboBoxFreeSolo/index.d.ts +0 -1
- package/dist/types/DateInput/DSDateInput.d.ts +0 -62
- package/dist/types/DateInput/components/DateInputImpl.d.ts +0 -40
- package/dist/types/DateInput/components/DateInputs.d.ts +0 -40
- package/dist/types/DateInput/components/utils.d.ts +0 -40
- package/dist/types/DateInput/defaultProps.d.ts +0 -18
- package/dist/types/DateInput/index.d.ts +0 -1
- package/dist/types/DateInput/props.d.ts +0 -60
- package/dist/types/DateInput/tests/DSDateInput.events.test.d.ts +0 -1
- package/dist/types/DateInputV2/components/DSDateInput.d.ts +0 -54
- package/dist/types/DateInputV2/components/DateInputs.d.ts +0 -32
- package/dist/types/DateInputV2/components/helpers.d.ts +0 -1
- package/dist/types/DateInputV2/components/props.d.ts +0 -53
- package/dist/types/DateInputV2/components/propsTypes.d.ts +0 -21
- package/dist/types/DateInputV2/components/styled.d.ts +0 -5
- package/dist/types/DateInputV2/components/utils.d.ts +0 -42
- package/dist/types/DateInputV2/index.d.ts +0 -2
- package/dist/types/DateInputV2/tests/DateInput.test.d.ts +0 -1
- package/dist/types/ExpandableInput/DSExpandableInput.d.ts +0 -15
- package/dist/types/ExpandableInput/ExpandableInputImpl.d.ts +0 -7
- package/dist/types/ExpandableInput/index.d.ts +0 -1
- package/dist/types/FloatingLabelInput/DSFloatingLabelInput.d.ts +0 -47
- package/dist/types/FloatingLabelInput/FloatingLabelInputImpl.d.ts +0 -27
- package/dist/types/FloatingLabelInput/getSvgPath.d.ts +0 -10
- package/dist/types/FloatingLabelInput/index.d.ts +0 -1
- package/dist/types/FormItem/DSFormItemLayout.d.ts +0 -180
- package/dist/types/FormItem/Error/DSError.d.ts +0 -19
- package/dist/types/FormItem/Feedback.d.ts +0 -6
- package/dist/types/FormItem/Label/DSLabel.d.ts +0 -23
- package/dist/types/FormItem/Suffix/Suffix.d.ts +0 -4
- package/dist/types/FormItem/ValidationFieldWrapper.d.ts +0 -19
- package/dist/types/FormItem/defaultProps.d.ts +0 -51
- package/dist/types/FormItem/index.d.ts +0 -2
- package/dist/types/FormItem/props.d.ts +0 -80
- package/dist/types/FormItem/tests/DSFormItem.events.test.d.ts +0 -1
- package/dist/types/FormItem/variants.d.ts +0 -8
- package/dist/types/Input/DSInput.d.ts +0 -0
- package/dist/types/Input/InputAddonWrapper.d.ts +0 -0
- package/dist/types/Input/InputImpl.d.ts +0 -0
- package/dist/types/Input/index.d.ts +0 -1
- package/dist/types/Input/tests/Input.test.d.ts +0 -0
- package/dist/types/InputGroup/AddonWrapper.d.ts +0 -8
- package/dist/types/InputGroup/DSInputGroup.d.ts +0 -40
- package/dist/types/InputGroup/defaultProps.d.ts +0 -8
- package/dist/types/InputGroup/index.d.ts +0 -1
- package/dist/types/InputGroup/props.d.ts +0 -24
- package/dist/types/InputGroup/tests/DSInputGroup.events.test.d.ts +0 -1
- package/dist/types/InputMask/DSInputMask.d.ts +0 -85
- package/dist/types/InputMask/DSInputMaskDeprecated.d.ts +0 -18
- package/dist/types/InputMask/InputMaskContext.d.ts +0 -18
- package/dist/types/InputMask/MaskPipes.d.ts +0 -18
- package/dist/types/InputMask/MaskTypes.d.ts +0 -15
- package/dist/types/InputMask/addons/AutoCorrectedDatePipe.d.ts +0 -8
- package/dist/types/InputMask/defaultProps.d.ts +0 -28
- package/dist/types/InputMask/index.d.ts +0 -1
- package/dist/types/InputMask/mask_types/DateInputMask.d.ts +0 -36
- package/dist/types/InputMask/mask_types/DateTimeInputMask.d.ts +0 -36
- package/dist/types/InputMask/mask_types/DictionaryInputMask.d.ts +0 -39
- package/dist/types/InputMask/mask_types/NumberInputMask.d.ts +0 -48
- package/dist/types/InputMask/mask_types/PhoneInputMask.d.ts +0 -36
- package/dist/types/InputMask/mask_types/PhoneInternationalInputMask.d.ts +0 -36
- package/dist/types/InputMask/mask_types/SsnInputMask.d.ts +0 -36
- package/dist/types/InputMask/mask_types/UsZipCodeInputMask.d.ts +0 -36
- package/dist/types/InputMask/mask_types/ZipCodeSearchInputMask.d.ts +0 -36
- package/dist/types/InputMask/mask_types/index.d.ts +0 -41
- package/dist/types/InputMask/props.d.ts +0 -112
- package/dist/types/InputMask/tests/DSInputMask.test.d.ts +0 -1
- package/dist/types/InputMask/tests/NumberInputMask.test.d.ts +0 -1
- package/dist/types/InputMask/tests/events/DateInputMask.events.test.d.ts +0 -1
- package/dist/types/InputMask/tests/events/DateTimeInputMask.events.test.d.ts +0 -1
- package/dist/types/InputMask/tests/events/NumberInputMask.events.test.d.ts +0 -1
- package/dist/types/InputMask/tests/events/PercentInputMask.events.test.d.ts +0 -1
- package/dist/types/InputMask/tests/events/PhoneInputMask.events.test.d.ts +0 -1
- package/dist/types/InputMask/tests/events/PhoneInternationalInputMask.events.test.d.ts +0 -1
- package/dist/types/InputMask/tests/events/SsnInputMask.events.test.d.ts +0 -1
- package/dist/types/InputMask/tests/events/UsZipCodeInputMask.events.test.d.ts +0 -1
- package/dist/types/InputMask/tests/events/ZipCodeSearchInputMask.events.test.d.ts +0 -1
- package/dist/types/InputMask/types/index.d.ts +0 -5
- package/dist/types/InputMask/utils/setCaretPosition.d.ts +0 -3
- package/dist/types/InputProtected/DSInputProtected.d.ts +0 -41
- package/dist/types/InputProtected/defaultProps.d.ts +0 -4
- package/dist/types/InputProtected/index.d.ts +0 -2
- package/dist/types/InputProtected/options.d.ts +0 -8
- package/dist/types/InputProtected/props.d.ts +0 -14
- package/dist/types/InputProtected/tests/DSInputProtected.events.test.d.ts +0 -1
- package/dist/types/InputProtected/tests/DSInputProtected.test.d.ts +0 -1
- package/dist/types/LargeInputText/DSLargeInputText.d.ts +0 -127
- package/dist/types/LargeInputText/defaultProps.d.ts +0 -31
- package/dist/types/LargeInputText/index.d.ts +0 -1
- package/dist/types/LargeInputText/props.d.ts +0 -95
- package/dist/types/LargeInputText/tests/DSLargeInputText.events.test.d.ts +0 -1
- package/dist/types/LargeInputText/tests/DSLargeInputText.test.d.ts +0 -1
- package/dist/types/MenuItem/components/MenuItem/index.d.ts +0 -0
- package/dist/types/MenuItem/components/MenuItem/styled.d.ts +0 -0
- package/dist/types/MenuItem/components/MultiMenuItem/MultiMenuItem.d.ts +0 -0
- package/dist/types/MenuItem/components/MultiMenuItem/styled.d.ts +0 -0
- package/dist/types/MenuItem/components/Section/index.d.ts +0 -0
- package/dist/types/MenuItem/components/Section/props.d.ts +0 -0
- package/dist/types/MenuItem/components/Section/styled.d.ts +0 -0
- package/dist/types/MenuItem/components/Separator/index.d.ts +0 -0
- package/dist/types/MenuItem/components/Separator/styled.d.ts +0 -0
- package/dist/types/MenuItem/components/SingleMenuItem/SingleMenuItem.d.ts +0 -0
- package/dist/types/MenuItem/components/SubmenuItem/index.d.ts +0 -0
- package/dist/types/MenuItem/components/SubmenuItem/styled.d.ts +0 -0
- package/dist/types/MenuItem/components/index.d.ts +0 -0
- package/dist/types/MenuItem/components/styled.d.ts +0 -0
- package/dist/types/MenuItem/index.d.ts +0 -0
- package/dist/types/MenuItem/props.d.ts +0 -0
- package/dist/types/Radio/Circle.d.ts +0 -8
- package/dist/types/Radio/DSRadio.d.ts +0 -87
- package/dist/types/Radio/index.d.ts +0 -1
- package/dist/types/RadioGroup/DSRadioGroup.d.ts +0 -46
- package/dist/types/RadioGroup/defaultProps.d.ts +0 -12
- package/dist/types/RadioGroup/index.d.ts +0 -1
- package/dist/types/RadioGroup/props.d.ts +0 -25
- package/dist/types/RadioGroup/tests/DSRadioGroup.events.test.d.ts +0 -1
- package/dist/types/RequiredMark/RequiredMark.d.ts +0 -6
- package/dist/types/RequiredMark/index.d.ts +0 -1
- package/dist/types/SearchBox/index.d.ts +0 -1
- package/dist/types/TextBox/index.d.ts +0 -1
- package/dist/types/TimeInput/DSTimeInput.d.ts +0 -71
- package/dist/types/TimeInput/TimeInputImpl.d.ts +0 -55
- package/dist/types/TimeInput/TimeInputs.d.ts +0 -17
- package/dist/types/TimeInput/index.d.ts +0 -1
- package/dist/types/TimeInput/utils.d.ts +0 -39
- package/dist/types/Toggle/DSToggle.d.ts +0 -86
- package/dist/types/Toggle/DSToggleImpl.d.ts +0 -61
- package/dist/types/Toggle/DSToggleRender.d.ts +0 -32
- package/dist/types/Toggle/index.d.ts +0 -1
- package/dist/types/Toggle/props.d.ts +0 -47
- package/dist/types/Toggle/toggleHelper.d.ts +0 -24
- package/dist/types/index.d.ts +0 -21
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
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;AAC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AAS,MAAM,EAAE,CAAC;AAErD,SAAO;AACT;AAEO,MAAM,sBAAsB,CAAC,MAAM,MAAM,UAAU;AACxD,MAAI,eAAe,CAAC;AACpB,QAAM,EAAE,MAAM,OAAO,IAAI,IAAI;AAC7B,MAAK,OAAO,IAAI,SAAS,KAAO,SAAS,MAAM,SAAS;AAAI,WAAO;AACnE,QAAM,EAAE,UAAU,WAAW,QAAQ,IAAI;AACzC,QAAM,EAAE,cAAc,aAAa,IAAI;AAEvC,MAAI;AAAW,mBAAe,CAAC,GAAG,cAAc,SAAS,IAAI;AAC7D,MAAI;AAAS,mBAAe,CAAC,GAAG,cAAc,OAAO,IAAI;AACzD,MAAI;AAAU,mBAAe,CAAC,GAAG,cAAc,QAAQ,IAAI;AAE3D,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
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 {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/DateInput/props.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from '@elliemae/ds-props-helpers';\n\nexport const props = {\n /** 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,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;",
|
|
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
3
|
import { describe } from "@elliemae/ds-props-helpers";
|
|
4
|
-
import { DSInput } from "../../Input";
|
|
5
|
-
import { DateInputs } from "./DateInputs";
|
|
6
|
-
import { props, defaultProps } from "./props";
|
|
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-props-helpers';\nimport { DSInput } from '../../Input';\nimport { DateInputs } from './DateInputs';\nimport { props, defaultProps } from './props';\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"],
|
|
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
|
}
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
getFormattedMonth,
|
|
14
14
|
getShouldShortcircuitMonth,
|
|
15
15
|
getFormattedYear
|
|
16
|
-
} from "./utils";
|
|
17
|
-
import { onKeyDownHelper } from "./helpers";
|
|
18
|
-
import { DateInputDivider, DateInputWrapper, DateInputInput, DateInputFluidContainer } from "./styled";
|
|
19
|
-
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";
|
|
20
20
|
const FORMAT = "MMDDYYYY";
|
|
21
21
|
const DateInputs = ({ onBlur, onChange, onDateChange, disabled, onCustomKeyDown, time, tabIndex, innerRef }) => {
|
|
22
22
|
useDeprecateComponent({ componentName: "ds-form/DateInputV2", version: "3.x Date: 2023 Q1" });
|
|
@@ -179,6 +179,7 @@ const DateInputs = ({ onBlur, onChange, onDateChange, disabled, onCustomKeyDown,
|
|
|
179
179
|
return [
|
|
180
180
|
inputsWithDividers,
|
|
181
181
|
React2.createElement("span", { key: "span" })
|
|
182
|
+
// hack for next/prev focus
|
|
182
183
|
];
|
|
183
184
|
};
|
|
184
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 */\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';\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 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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J,eAAY;AAAA,QACZ;AAAA,QACA,MAAK;AAAA,QACL,QAAQ;AAAA,QACR,UAAU;AAAA,QACV,OAAO;AAAA,QACP;AAAA;AAAA,IACF;AAAA,EAEJ;AACA,QAAM,kBAAkB,MAAM;AAC5B,kBAAc;AACd,aAAS;AACT,UAAM,kBAAkB,CAAC,MAAM;AAC7B,oBAAc,GAAG,MAAM;AAAA,IACzB;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG,iBAAiB,QAAQ,WAAW,WAAW;AAAA,QACnD,cAAa;AAAA,QACb,KAAI;AAAA,QACJ,eAAY;AAAA,QACZ;AAAA,QACA,MAAK;AAAA,QACL,QAAQ;AAAA,QACR,UAAU;AAAA,QACV,OAAO;AAAA,QACP,MAAK;AAAA,QACL;AAAA;AAAA,IACF;AAAA,EAEJ;AAEA,QAAM,mBAAmB,MAAM;AAC7B,UAAM,SAAS,CAAC,iBAAiB,GAAG,eAAe,GAAG,gBAAgB,CAAC;AACvE,UAAM,qBAAqB,OAAO;AAAA,MAChC,CAAC,KAAK,OAAO,UAAW,QAAQ,IAAI,OAAO,CAAC,QAAQ,oBAAC,oBAAiB,eAAC,IAAsB,MAAM,KAAK,CAAC,IAAI;AAAA,MAC7G,CAAC;AAAA,IACH;AAEA,WAAO;AAAA,MACL;AAAA,MACAA,OAAM,cAAc,QAAQ,EAAE,KAAK,OAAO,CAAC;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;",
|
|
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;AAA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Input } 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;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B,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
|
}
|
|
@@ -2,17 +2,47 @@ import * as React from "react";
|
|
|
2
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 = {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/DateInputV2/components/props.tsx"],
|
|
4
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,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;",
|
|
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`\n padding: 1px;\n text-align: center;\n`;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AACvB,SAAS,YAAY;AAEd,MAAM,0BAA0B,OAAO,IAAI;AAAA;AAAA;AAAA;AAAA;AAM3C,MAAM,mBAAmB,OAAO,IAAI;AAAA;AAAA;AAAA,IAGvC,CAAC,EAAE,UAAU,MAAM,MACnB,WACI;AAAA,kBACU,MAAM,OAAO,QAAQ;AAAA,
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AACvB,SAAS,YAAY;AAEd,MAAM,0BAA0B,OAAO,IAAI;AAAA;AAAA;AAAA;AAAA;AAM3C,MAAM,mBAAmB,OAAO,IAAI;AAAA;AAAA;AAAA,IAGvC,CAAC,EAAE,UAAU,MAAM,MACnB,WACI;AAAA,kBACU,MAAM,OAAO,QAAQ,GAAG;AAAA,aAC7B,MAAM,OAAO,QAAQ,GAAG;AAAA,QAE7B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUD,MAAM,iBAAiB,OAAO;AAAA;AAAA;AAAA;AAAA,WAI1B,CAAC,UAAW,MAAM,SAAS,MAAM,SAAS;AAAA,YACzC,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA,IACrC,CAAC,EAAE,UAAU,MAAM,MACnB,WACI;AAAA,gBACQ,MAAM,OAAO,QAAQ,GAAG;AAAA,WAC7B,MAAM,OAAO,QAAQ,GAAG;AAAA,MAE3B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAiBU,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWlD,MAAM,mBAAmB,OAAO;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { addLeadingZeros } from "@elliemae/ds-utilities";
|
|
3
3
|
import { parseInt, isNaN } from "@elliemae/ds-utilities";
|
|
4
4
|
import moment from "moment";
|
|
5
|
-
const currentYear = new Date().getFullYear();
|
|
5
|
+
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
6
6
|
const getNextSibling = (elem, selector) => {
|
|
7
7
|
let sibling = elem.nextElementSibling;
|
|
8
8
|
if (!selector)
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/DateInputV2/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 } from '@elliemae/ds-utilities';\nimport { parseInt, isNaN } from '@elliemae/ds-utilities';\nimport moment from 'moment';\n\nconst currentYear = new Date().getFullYear();\n\nconst getNextSibling = (elem, selector) => {\n // Get the next sibling element\n let sibling = elem.nextElementSibling;\n // If there's no selector, return the first sibling\n if (!selector) return sibling;\n\n // If the sibling matches our selector, use it\n // If not, jump to the next sibling and continue the loop\n while (sibling) {\n if (sibling.matches(selector)) return sibling;\n sibling = sibling.nextElementSibling;\n }\n return sibling;\n};\n\nconst getPreviousSibling = (elem, selector) => {\n let sibling = elem.previousElementSibling;\n if (!selector) return sibling;\n while (sibling) {\n if (sibling.matches(selector)) return sibling;\n sibling = sibling.previousElementSibling;\n }\n return sibling;\n};\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 getFormattedDay = (value) => {\n const v = value.length > 2 ? value.slice(-2) : value;\n const parsedValue = parseInt(v, 10);\n\n if (parsedValue > 31) return '31';\n return formatTimeNumber(parseTimeNumberFromText(v), true, 2);\n};\n\nexport const getShouldShortcircuitDay = (value) => {\n const v = value.length > 2 ? value.slice(-2) : value;\n const parsedValue = parseInt(v, 10);\n if (parsedValue > 31) return true;\n // if the first input is in range 4-9 then there is no other option\n // so we auto advance\n if (parsedValue > 3 && parsedValue < 10) return true;\n return false;\n};\n\nexport const getFormattedYear = (value) => {\n const v = value.length > 4 ? value.slice(-4) : value;\n if (parseInt(v) > 9999) return '9999';\n return formatTimeNumber(parseTimeNumberFromText(v), true, 4);\n};\n\nexport const getFormattedMonth = (value) => {\n const v = value.length > 2 ? value.slice(-2) : value;\n const parsedValue = parseInt(v, 10);\n if (parsedValue > 12) return '12';\n return formatTimeNumber(parseTimeNumberFromText(v), true, 2);\n};\n\nexport const getShouldShortcircuitMonth = (value) => {\n const v = value.length > 2 ? value.slice(-2) : value;\n const parsedValue = parseInt(v, 10);\n if (parsedValue > 12) return true;\n // if the first input is in range 2-9 then there is no other option\n // so we auto advance\n if (parsedValue > 1 && parsedValue < 10) return true;\n return false;\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 getNextSibling(currentEl, 'input')?.focus();\n};\n\nexport const focusPreviousInput = (currentEl) => {\n getPreviousSibling(currentEl, 'input')?.focus();\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) 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: getFormattedMonth(format, month),\n day: getFormattedDay(format, day),\n year: getFormattedYear(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 // we select the whole value to be able to override the value on first key\n // we don't use selection color to be consistent with the highlight of the input\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 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,uBAAuB;AAChC,SAAS,UAAU,aAAa;AAChC,OAAO,YAAY;AAEnB,MAAM,
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,uBAAuB;AAChC,SAAS,UAAU,aAAa;AAChC,OAAO,YAAY;AAEnB,MAAM,eAAc,oBAAI,KAAK,GAAE,YAAY;AAE3C,MAAM,iBAAiB,CAAC,MAAM,aAAa;AAEzC,MAAI,UAAU,KAAK;AAEnB,MAAI,CAAC;AAAU,WAAO;AAItB,SAAO,SAAS;AACd,QAAI,QAAQ,QAAQ,QAAQ;AAAG,aAAO;AACtC,cAAU,QAAQ;AAAA,EACpB;AACA,SAAO;AACT;AAEA,MAAM,qBAAqB,CAAC,MAAM,aAAa;AAC7C,MAAI,UAAU,KAAK;AACnB,MAAI,CAAC;AAAU,WAAO;AACtB,SAAO,SAAS;AACd,QAAI,QAAQ,QAAQ,QAAQ;AAAG,aAAO;AACtC,cAAU,QAAQ;AAAA,EACpB;AACA,SAAO;AACT;AAEO,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,K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AAAK,WAAO;AAE5C,UAAQ,QAAQ,GAAG,QAAQ,SAAS;AAEpC,MAAI,aAAa;AAAO,YAAQ,MAAM,SAAS,QAAQ,GAAG,EAAE,CAAC;AAC7D,MAAI,WAAW;AAAK,YAAQ,KAAK,SAAS,KAAK,EAAE,CAAC;AAClD,MAAI,YAAY;AAAM,YAAQ,KAAK,SAAS,MAAM,EAAE,CAAC;AAErD,SAAO;AACT;AAEO,MAAM,sBAAsB,CAAC,MAAM,MAAM,UAAU;AACxD,MAAI,eAAe,CAAC;AACpB,QAAM,EAAE,MAAM,OAAO,IAAI,IAAI;AAC7B,QAAM,EAAE,UAAU,WAAW,QAAQ,IAAI;AACzC,QAAM,EAAE,cAAc,aAAa,IAAI;AAEvC,MAAI;AAAW,mBAAe,CAAC,GAAG,cAAc,SAAS,IAAI;AAC7D,MAAI;AAAS,mBAAe,CAAC,GAAG,cAAc,OAAO,IAAI;AACzD,MAAI;AAAU,mBAAe,CAAC,GAAG,cAAc,QAAQ,IAAI;AAE3D,QAAM,cAAc,OAAO,gBAAgB,OAAO;AAElD,SAAO,CAAC,aAAa,KAAK,CAAC,UAAU,CAAC,KAAK,KAAK;AAClD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { DateInputs } from "./components/DateInputs";
|
|
3
|
-
export * from "./components/DSDateInput";
|
|
2
|
+
import { DateInputs } from "./components/DateInputs.js";
|
|
3
|
+
export * from "./components/DSDateInput.js";
|
|
4
4
|
export {
|
|
5
5
|
DateInputs as DateInputsV2Impl
|
|
6
6
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/DateInputV2/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DateInputs as DateInputsV2Impl } from './components/DateInputs';\nexport * from './components/DSDateInput';\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DateInputs as DateInputsV2Impl } from './components/DateInputs.js';\nexport * from './components/DSDateInput.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAuB,kBAAwB;AAC/C,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { ExpandableInputImpl } from "./ExpandableInputImpl";
|
|
3
|
+
import { ExpandableInputImpl } from "./ExpandableInputImpl.js";
|
|
4
4
|
const DSExpandableInput = ({
|
|
5
5
|
containerProps = {},
|
|
6
6
|
innerRef,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/ExpandableInput/DSExpandableInput.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { ExpandableInputImpl } from './ExpandableInputImpl';\n\nconst DSExpandableInput = ({\n containerProps = {},\n innerRef,\n className = '',\n style = {},\n triggerComponent = undefined,\n children,\n isOpen = false,\n onOpen = () => null,\n onClose = () => null,\n onBlur = () => null,\n width = undefined,\n}) => (\n <ExpandableInputImpl\n className={className}\n containerProps={containerProps}\n innerRef={innerRef}\n isOpen={isOpen}\n onBlur={onBlur}\n onClose={onClose}\n onOpen={onOpen}\n style={style}\n triggerComponent={triggerComponent}\n width={width}\n >\n {children}\n </ExpandableInputImpl>\n);\n\nexport { DSExpandableInput };\nexport default DSExpandableInput;\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { ExpandableInputImpl } from './ExpandableInputImpl.js';\n\nconst DSExpandableInput = ({\n containerProps = {},\n innerRef,\n className = '',\n style = {},\n triggerComponent = undefined,\n children,\n isOpen = false,\n onOpen = () => null,\n onClose = () => null,\n onBlur = () => null,\n width = undefined,\n}) => (\n <ExpandableInputImpl\n className={className}\n containerProps={containerProps}\n innerRef={innerRef}\n isOpen={isOpen}\n onBlur={onBlur}\n onClose={onClose}\n onOpen={onOpen}\n style={style}\n triggerComponent={triggerComponent}\n width={width}\n >\n {children}\n </ExpandableInputImpl>\n);\n\nexport { DSExpandableInput };\nexport default DSExpandableInput;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACgBrB;AAfF,SAAS,2BAA2B;AAEpC,MAAM,oBAAoB,CAAC;AAAA,EACzB,iBAAiB,CAAC;AAAA,EAClB;AAAA,EACA,YAAY;AAAA,EACZ,QAAQ,CAAC;AAAA,EACT,mBAAmB;AAAA,EACnB;AAAA,EACA,SAAS;AAAA,EACT,SAAS,MAAM;AAAA,EACf,UAAU,MAAM;AAAA,EAChB,SAAS,MAAM;AAAA,EACf,QAAQ;AACV,MACE;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAEC;AAAA;AACH;AAIF,IAAO,4BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,7 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import React2, { Component, cloneElement } from "react";
|
|
4
4
|
import { aggregatedClasses } from "@elliemae/ds-classnames";
|
|
5
5
|
import { isFunction } from "@elliemae/ds-shared";
|
|
6
|
-
import { InputAddonWrapper } from "../Input";
|
|
6
|
+
import { InputAddonWrapper } from "../Input/index.js";
|
|
7
7
|
const blockName = "expandable-input";
|
|
8
8
|
const ExpandableInput = aggregatedClasses("div")(blockName, null, ({ isOpen }) => ({ opened: isOpen }));
|
|
9
9
|
const InputWrapper = aggregatedClasses(InputAddonWrapper)(blockName, "wrapper", ({ isOpen }) => ({ opened: isOpen }));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/ExpandableInput/ExpandableInputImpl.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { Component, cloneElement } from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { isFunction } from '@elliemae/ds-shared';\nimport { InputAddonWrapper } from '../Input';\n\nconst blockName = 'expandable-input';\n\nconst ExpandableInput = aggregatedClasses('div')(blockName, null, ({ isOpen }) => ({ opened: isOpen }));\nconst InputWrapper = aggregatedClasses(InputAddonWrapper)(blockName, 'wrapper', ({ isOpen }) => ({ opened: isOpen }));\n\nclass ExpandableInputImpl extends Component {\n componentDidUpdate(prevProps) {\n const { isOpen } = this.props;\n if (isOpen && isOpen !== prevProps.isOpen) this.input.focus();\n }\n\n render() {\n const { innerRef, triggerComponent, children, width, isOpen, onOpen, onClose, onBlur, containerProps } = this.props;\n const InputComponent = React.Children.only(children);\n const handleTriggerClick = (e) => {\n if (isFunction(triggerComponent.onClick)) triggerComponent.onClick(e);\n if (isOpen) {\n onClose();\n } else {\n onOpen();\n }\n };\n\n return (\n <ExpandableInput\n {...containerProps}\n classProps={{ isOpen }}\n innerRef={innerRef}\n style={{ width: isOpen && width }}\n >\n <InputWrapper\n rightComponents={[\n cloneElement(triggerComponent, {\n key: 'handler',\n onClick: handleTriggerClick,\n }),\n ]}\n >\n {cloneElement(InputComponent, {\n className: 'expandable-input__input',\n innerRef: (node) => (this.input = node),\n onBlur,\n })}\n </InputWrapper>\n </ExpandableInput>\n );\n }\n}\n\nexport { ExpandableInputImpl };\nexport default ExpandableInputImpl;\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { Component, cloneElement } from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { isFunction } from '@elliemae/ds-shared';\nimport { InputAddonWrapper } from '../Input/index.js';\n\nconst blockName = 'expandable-input';\n\nconst ExpandableInput = aggregatedClasses('div')(blockName, null, ({ isOpen }) => ({ opened: isOpen }));\nconst InputWrapper = aggregatedClasses(InputAddonWrapper)(blockName, 'wrapper', ({ isOpen }) => ({ opened: isOpen }));\n\nclass ExpandableInputImpl extends Component {\n componentDidUpdate(prevProps) {\n const { isOpen } = this.props;\n if (isOpen && isOpen !== prevProps.isOpen) this.input.focus();\n }\n\n render() {\n const { innerRef, triggerComponent, children, width, isOpen, onOpen, onClose, onBlur, containerProps } = this.props;\n const InputComponent = React.Children.only(children);\n const handleTriggerClick = (e) => {\n if (isFunction(triggerComponent.onClick)) triggerComponent.onClick(e);\n if (isOpen) {\n onClose();\n } else {\n onOpen();\n }\n };\n\n return (\n <ExpandableInput\n {...containerProps}\n classProps={{ isOpen }}\n innerRef={innerRef}\n style={{ width: isOpen && width }}\n >\n <InputWrapper\n rightComponents={[\n cloneElement(triggerComponent, {\n key: 'handler',\n onClick: handleTriggerClick,\n }),\n ]}\n >\n {cloneElement(InputComponent, {\n className: 'expandable-input__input',\n innerRef: (node) => (this.input = node),\n onBlur,\n })}\n </InputWrapper>\n </ExpandableInput>\n );\n }\n}\n\nexport { ExpandableInputImpl };\nexport default ExpandableInputImpl;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACmCf;AAnCR,OAAOA,UAAS,WAAW,oBAAoB;AAC/C,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB;AAElC,MAAM,YAAY;AAElB,MAAM,kBAAkB,kBAAkB,KAAK,EAAE,WAAW,MAAM,CAAC,EAAE,OAAO,OAAO,EAAE,QAAQ,OAAO,EAAE;AACtG,MAAM,eAAe,kBAAkB,iBAAiB,EAAE,WAAW,WAAW,CAAC,EAAE,OAAO,OAAO,EAAE,QAAQ,OAAO,EAAE;AAEpH,MAAM,4BAA4B,UAAU;AAAA,EAC1C,mBAAmB,WAAW;AAC5B,UAAM,EAAE,OAAO,IAAI,KAAK;AACxB,QAAI,UAAU,WAAW,UAAU;AAAQ,WAAK,MAAM,MAAM;AAAA,EAC9D;AAAA,EAEA,SAAS;AACP,UAAM,EAAE,UAAU,kBAAkB,UAAU,OAAO,QAAQ,QAAQ,SAAS,QAAQ,eAAe,IAAI,KAAK;AAC9G,UAAM,iBAAiBA,OAAM,SAAS,KAAK,QAAQ;AACnD,UAAM,qBAAqB,CAAC,MAAM;AAChC,UAAI,WAAW,iBAAiB,OAAO;AAAG,yBAAiB,QAAQ,CAAC;AACpE,UAAI,QAAQ;AACV,gBAAQ;AAAA,MACV,OAAO;AACL,eAAO;AAAA,MACT;AAAA,IACF;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ,YAAY,EAAE,OAAO;AAAA,QACrB;AAAA,QACA,OAAO,EAAE,OAAO,UAAU,MAAM;AAAA,QAEhC;AAAA,UAAC;AAAA;AAAA,YACC,iBAAiB;AAAA,cACf,aAAa,kBAAkB;AAAA,gBAC7B,KAAK;AAAA,gBACL,SAAS;AAAA,cACX,CAAC;AAAA,YACH;AAAA,YAEC,uBAAa,gBAAgB;AAAA,cAC5B,WAAW;AAAA,cACX,UAAU,CAAC,SAAU,KAAK,QAAQ;AAAA,cAClC;AAAA,YACF,CAAC;AAAA;AAAA,QACH;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAGA,IAAO,8BAAQ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/ExpandableInput/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSExpandableInput';\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSExpandableInput.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|