@elliemae/ds-form 3.12.0-next.0 → 3.12.0-next.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/CheckboxGroup/DSCheckboxGroup.js.map +2 -2
- package/dist/cjs/ComboBox/index.js.map +1 -1
- package/dist/cjs/ComboBoxFreeSolo/ComboBoxFreeSolo.js +28 -30
- package/dist/cjs/ComboBoxFreeSolo/ComboBoxFreeSolo.js.map +2 -2
- package/dist/cjs/ComboBoxFreeSolo/components/MultiValueLabel.js.map +2 -2
- package/dist/cjs/ComboBoxFreeSolo/components/SingleValue.js.map +2 -2
- package/dist/cjs/DateInput/props.js +12 -33
- package/dist/cjs/DateInput/props.js.map +2 -2
- package/dist/cjs/DateInputV2/components/helpers.js.map +2 -2
- package/dist/cjs/DateInputV2/components/props.js +8 -25
- package/dist/cjs/DateInputV2/components/props.js.map +2 -2
- package/dist/cjs/DateInputV2/components/propsTypes.js +1 -4
- package/dist/cjs/DateInputV2/components/propsTypes.js.map +2 -2
- package/dist/cjs/DateInputV2/components/styled.js.map +2 -2
- package/dist/cjs/DateInputV2/components/utils.js +1 -4
- package/dist/cjs/DateInputV2/components/utils.js.map +2 -2
- package/dist/cjs/FloatingLabelInput/getSvgPath.js.map +2 -2
- package/dist/cjs/FormItem/Label/DSLabel.js +1 -9
- package/dist/cjs/FormItem/Label/DSLabel.js.map +2 -2
- package/dist/cjs/FormItem/Suffix/Suffix.js.map +2 -2
- package/dist/cjs/FormItem/ValidationFieldWrapper.js.map +2 -2
- package/dist/cjs/Input/index.js.map +1 -1
- package/dist/cjs/InputGroup/AddonWrapper.js +1 -7
- package/dist/cjs/InputGroup/AddonWrapper.js.map +2 -2
- package/dist/cjs/InputGroup/props.js +5 -12
- package/dist/cjs/InputGroup/props.js.map +2 -2
- package/dist/cjs/InputMask/DSInputMask.js +2 -6
- package/dist/cjs/InputMask/DSInputMask.js.map +2 -2
- package/dist/cjs/InputMask/InputMaskContext.js.map +1 -1
- package/dist/cjs/InputMask/addons/AutoCorrectedDatePipe.js +3 -12
- package/dist/cjs/InputMask/addons/AutoCorrectedDatePipe.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/DateInputMask.js +1 -5
- package/dist/cjs/InputMask/mask_types/DateInputMask.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/DateTimeInputMask.js +1 -5
- package/dist/cjs/InputMask/mask_types/DateTimeInputMask.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/DictionaryInputMask.js +1 -7
- package/dist/cjs/InputMask/mask_types/DictionaryInputMask.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/PhoneInputMask.js +1 -5
- package/dist/cjs/InputMask/mask_types/PhoneInputMask.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/PhoneInternationalInputMask.js +1 -5
- package/dist/cjs/InputMask/mask_types/PhoneInternationalInputMask.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/SsnInputMask.js +1 -5
- package/dist/cjs/InputMask/mask_types/SsnInputMask.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/ZipCodeSearchInputMask.js +1 -5
- package/dist/cjs/InputMask/mask_types/ZipCodeSearchInputMask.js.map +2 -2
- package/dist/cjs/InputMask/mask_types/index.js.map +2 -2
- package/dist/cjs/InputMask/props.js +19 -59
- package/dist/cjs/InputMask/props.js.map +2 -2
- package/dist/cjs/InputProtected/props.js +8 -21
- package/dist/cjs/InputProtected/props.js.map +2 -2
- package/dist/cjs/LargeInputText/DSLargeInputText.js +13 -19
- package/dist/cjs/LargeInputText/DSLargeInputText.js.map +2 -2
- package/dist/cjs/LargeInputText/props.js +13 -39
- package/dist/cjs/LargeInputText/props.js.map +2 -2
- package/dist/cjs/Radio/Circle.js.map +2 -2
- package/dist/cjs/RadioGroup/DSRadioGroup.js.map +2 -2
- package/dist/cjs/TimeInput/DSTimeInput.js +8 -19
- package/dist/cjs/TimeInput/DSTimeInput.js.map +2 -2
- package/dist/cjs/TimeInput/TimeInputImpl.js +1 -3
- package/dist/cjs/TimeInput/TimeInputImpl.js.map +2 -2
- package/dist/cjs/TimeInput/utils.js +4 -5
- package/dist/cjs/TimeInput/utils.js.map +3 -3
- package/dist/cjs/Toggle/DSToggleImpl.js.map +2 -2
- package/dist/cjs/Toggle/DSToggleRender.js +13 -15
- package/dist/cjs/Toggle/DSToggleRender.js.map +2 -2
- package/dist/cjs/Toggle/toggleHelper.js +1 -7
- package/dist/cjs/Toggle/toggleHelper.js.map +2 -2
- package/dist/esm/CheckboxGroup/DSCheckboxGroup.js.map +2 -2
- package/dist/esm/ComboBox/index.js.map +1 -1
- package/dist/esm/ComboBoxFreeSolo/ComboBoxFreeSolo.js +28 -30
- package/dist/esm/ComboBoxFreeSolo/ComboBoxFreeSolo.js.map +2 -2
- package/dist/esm/ComboBoxFreeSolo/components/MultiValueLabel.js.map +2 -2
- package/dist/esm/ComboBoxFreeSolo/components/SingleValue.js.map +2 -2
- package/dist/esm/DateInput/props.js +12 -33
- package/dist/esm/DateInput/props.js.map +2 -2
- package/dist/esm/DateInputV2/components/helpers.js.map +2 -2
- package/dist/esm/DateInputV2/components/props.js +8 -25
- package/dist/esm/DateInputV2/components/props.js.map +2 -2
- package/dist/esm/DateInputV2/components/propsTypes.js +1 -4
- package/dist/esm/DateInputV2/components/propsTypes.js.map +2 -2
- package/dist/esm/DateInputV2/components/styled.js.map +2 -2
- package/dist/esm/DateInputV2/components/utils.js +1 -4
- package/dist/esm/DateInputV2/components/utils.js.map +2 -2
- package/dist/esm/FloatingLabelInput/getSvgPath.js.map +2 -2
- package/dist/esm/FormItem/Label/DSLabel.js +1 -9
- package/dist/esm/FormItem/Label/DSLabel.js.map +2 -2
- package/dist/esm/FormItem/Suffix/Suffix.js.map +2 -2
- package/dist/esm/FormItem/ValidationFieldWrapper.js.map +2 -2
- package/dist/esm/Input/index.js.map +1 -1
- package/dist/esm/InputGroup/AddonWrapper.js +1 -7
- package/dist/esm/InputGroup/AddonWrapper.js.map +2 -2
- package/dist/esm/InputGroup/props.js +5 -12
- package/dist/esm/InputGroup/props.js.map +2 -2
- package/dist/esm/InputMask/DSInputMask.js +2 -6
- package/dist/esm/InputMask/DSInputMask.js.map +2 -2
- package/dist/esm/InputMask/InputMaskContext.js.map +1 -1
- package/dist/esm/InputMask/addons/AutoCorrectedDatePipe.js +3 -12
- package/dist/esm/InputMask/addons/AutoCorrectedDatePipe.js.map +2 -2
- package/dist/esm/InputMask/mask_types/DateInputMask.js +1 -5
- package/dist/esm/InputMask/mask_types/DateInputMask.js.map +2 -2
- package/dist/esm/InputMask/mask_types/DateTimeInputMask.js +1 -5
- package/dist/esm/InputMask/mask_types/DateTimeInputMask.js.map +2 -2
- package/dist/esm/InputMask/mask_types/DictionaryInputMask.js +1 -7
- package/dist/esm/InputMask/mask_types/DictionaryInputMask.js.map +2 -2
- package/dist/esm/InputMask/mask_types/PhoneInputMask.js +1 -5
- package/dist/esm/InputMask/mask_types/PhoneInputMask.js.map +2 -2
- package/dist/esm/InputMask/mask_types/PhoneInternationalInputMask.js +1 -5
- package/dist/esm/InputMask/mask_types/PhoneInternationalInputMask.js.map +2 -2
- package/dist/esm/InputMask/mask_types/SsnInputMask.js +1 -5
- package/dist/esm/InputMask/mask_types/SsnInputMask.js.map +2 -2
- package/dist/esm/InputMask/mask_types/ZipCodeSearchInputMask.js +1 -5
- package/dist/esm/InputMask/mask_types/ZipCodeSearchInputMask.js.map +2 -2
- package/dist/esm/InputMask/mask_types/index.js.map +2 -2
- package/dist/esm/InputMask/props.js +19 -59
- package/dist/esm/InputMask/props.js.map +2 -2
- package/dist/esm/InputProtected/props.js +8 -21
- package/dist/esm/InputProtected/props.js.map +2 -2
- package/dist/esm/LargeInputText/DSLargeInputText.js +14 -23
- package/dist/esm/LargeInputText/DSLargeInputText.js.map +2 -2
- package/dist/esm/LargeInputText/props.js +13 -39
- package/dist/esm/LargeInputText/props.js.map +2 -2
- package/dist/esm/Radio/Circle.js.map +2 -2
- package/dist/esm/RadioGroup/DSRadioGroup.js.map +2 -2
- package/dist/esm/TimeInput/DSTimeInput.js +8 -19
- package/dist/esm/TimeInput/DSTimeInput.js.map +2 -2
- package/dist/esm/TimeInput/TimeInputImpl.js +1 -3
- package/dist/esm/TimeInput/TimeInputImpl.js.map +2 -2
- package/dist/esm/TimeInput/utils.js +1 -2
- package/dist/esm/TimeInput/utils.js.map +2 -2
- package/dist/esm/Toggle/DSToggleImpl.js.map +2 -2
- package/dist/esm/Toggle/DSToggleRender.js +13 -15
- package/dist/esm/Toggle/DSToggleRender.js.map +2 -2
- package/dist/esm/Toggle/toggleHelper.js +1 -7
- package/dist/esm/Toggle/toggleHelper.js.map +2 -2
- package/package.json +12 -12
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/FormItem/Suffix/Suffix.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable consistent-return */\nimport { styled } from '@elliemae/ds-system';\n\nexport const Suffix = styled.div`\n height: 2.16rem;\n align-items: center;\n display: flex;\n ${props => {\n if (props.label && !props.withFeedback) {\n return `\n padding-top: 1.2rem;\n `;\n }\n if (!props.label && !props.withFeedback) {\n return `\n padding-top: 1rem;\n `;\n }\n }}\n`;\n\nexport const SuffixInputWrapper = styled.div`\n padding-right: 0.32rem;\n flex: 1;\n`;\nexport const SuffixWrapper = styled.div`\n display: flex;\n align-items: center;\n`;\n\nexport default Suffix;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,uBAAuB;AAEhB,MAAM,SAAS,wBAAO;AAAA;AAAA;AAAA;AAAA,IAIzB,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable consistent-return */\nimport { styled } from '@elliemae/ds-system';\n\nexport const Suffix = styled.div`\n height: 2.16rem;\n align-items: center;\n display: flex;\n ${(props) => {\n if (props.label && !props.withFeedback) {\n return `\n padding-top: 1.2rem;\n `;\n }\n if (!props.label && !props.withFeedback) {\n return `\n padding-top: 1rem;\n `;\n }\n }}\n`;\n\nexport const SuffixInputWrapper = styled.div`\n padding-right: 0.32rem;\n flex: 1;\n`;\nexport const SuffixWrapper = styled.div`\n display: flex;\n align-items: center;\n`;\n\nexport default Suffix;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,uBAAuB;AAEhB,MAAM,SAAS,wBAAO;AAAA;AAAA;AAAA;AAAA,IAIzB,CAAC,UAAU;AACX,MAAI,MAAM,SAAS,CAAC,MAAM,cAAc;AACtC,WAAO;AAAA;AAAA;AAAA,EAGT;AACA,MAAI,CAAC,MAAM,SAAS,CAAC,MAAM,cAAc;AACvC,WAAO;AAAA;AAAA;AAAA,EAGT;AACF;AAAA;AAGK,MAAM,qBAAqB,wBAAO;AAAA;AAAA;AAAA;AAIlC,MAAM,gBAAgB,wBAAO;AAAA;AAAA;AAAA;AAKpC,IAAO,iBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/FormItem/ValidationFieldWrapper.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { Component } from 'react';\n\nexport default class ValidationFieldWrapper extends Component {\n static defaultProps = {\n validateOnBlur: false,\n validateOnChange: false,\n name: '', // name in context of the form\n value: '',\n validate: () => null,\n onChange: () => null,\n onBlur: () => null,\n };\n\n constructor(props) {\n super(props);\n this.state = {\n value: props.value,\n };\n }\n\n componentDidMount() {\n const { value } = this.state;\n this.executeValidations(value);\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n const { value } = nextProps;\n if (value === prevState.value) return null;\n return {\n ...prevState,\n value,\n };\n }\n\n handleChange = (e) => {\n const { onChange } = this.props;\n this.setState({ value: e.target.value });\n if (onChange) onChange(e);\n }
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA0B;AAE1B,MAAO,+BAA6C,uBAAU;AAAA,EAW5D,YAAY,OAAO;AACjB,UAAM,KAAK;AAoBb,wBAAe,CAAC,MAAM;AACpB,YAAM,EAAE,SAAS,IAAI,KAAK;AAC1B,WAAK,SAAS,EAAE,OAAO,EAAE,OAAO,MAAM,CAAC;AACvC,UAAI;AAAU,iBAAS,CAAC;AAAA,IAC1B;AAEA,sBAAa,CAAC,MAAM;AAClB,YAAM,EAAE,QAAQ,eAAe,IAAI,KAAK;AACxC,YAAM,EAAE,MAAM,IAAI,KAAK;AACvB,UAAI;AAAgB,aAAK,mBAAmB,KAAK;AACjD,aAAO,CAAC;AAAA,IACV;AAEA,8BAAqB,CAAC,UAAU;AAC9B,YAAM,EAAE,YAAY,IAAI,KAAK;AAC7B,UAAI,eAAe,MAAM,QAAQ,WAAW,GAAG;AAC7C,YACE,CAAC,YAAY,KAAK,
|
|
4
|
+
"sourcesContent": ["import { Component } from 'react';\n\nexport default class ValidationFieldWrapper extends Component {\n static defaultProps = {\n validateOnBlur: false,\n validateOnChange: false,\n name: '', // name in context of the form\n value: '',\n validate: () => null,\n onChange: () => null,\n onBlur: () => null,\n };\n\n constructor(props) {\n super(props);\n this.state = {\n value: props.value,\n };\n }\n\n componentDidMount() {\n const { value } = this.state;\n this.executeValidations(value);\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n const { value } = nextProps;\n if (value === prevState.value) return null;\n return {\n ...prevState,\n value,\n };\n }\n\n handleChange = (e) => {\n const { onChange } = this.props;\n this.setState({ value: e.target.value });\n if (onChange) onChange(e);\n };\n\n handleBlur = (e) => {\n const { onBlur, validateOnBlur } = this.props;\n const { value } = this.state;\n if (validateOnBlur) this.executeValidations(value);\n onBlur(e);\n };\n\n executeValidations = (value) => {\n const { validations } = this.props;\n if (validations && Array.isArray(validations)) {\n if (\n !validations.some((validation) => {\n const { error, payload } = validation({ value });\n if (error) this.setState({ validationMessage: payload, state: error });\n return error;\n })\n ) {\n this.setState({ hasError: false });\n }\n }\n };\n\n render() {\n const { children } = this.props;\n const { value, validationMessage, validationState, hasError } = this.state;\n return children({\n value,\n validationMessage,\n validationState,\n hasError,\n onChange: this.handleChange,\n onBlur: this.handleBlur,\n });\n }\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA0B;AAE1B,MAAO,+BAA6C,uBAAU;AAAA,EAW5D,YAAY,OAAO;AACjB,UAAM,KAAK;AAoBb,wBAAe,CAAC,MAAM;AACpB,YAAM,EAAE,SAAS,IAAI,KAAK;AAC1B,WAAK,SAAS,EAAE,OAAO,EAAE,OAAO,MAAM,CAAC;AACvC,UAAI;AAAU,iBAAS,CAAC;AAAA,IAC1B;AAEA,sBAAa,CAAC,MAAM;AAClB,YAAM,EAAE,QAAQ,eAAe,IAAI,KAAK;AACxC,YAAM,EAAE,MAAM,IAAI,KAAK;AACvB,UAAI;AAAgB,aAAK,mBAAmB,KAAK;AACjD,aAAO,CAAC;AAAA,IACV;AAEA,8BAAqB,CAAC,UAAU;AAC9B,YAAM,EAAE,YAAY,IAAI,KAAK;AAC7B,UAAI,eAAe,MAAM,QAAQ,WAAW,GAAG;AAC7C,YACE,CAAC,YAAY,KAAK,CAAC,eAAe;AAChC,gBAAM,EAAE,OAAO,QAAQ,IAAI,WAAW,EAAE,MAAM,CAAC;AAC/C,cAAI;AAAO,iBAAK,SAAS,EAAE,mBAAmB,SAAS,OAAO,MAAM,CAAC;AACrE,iBAAO;AAAA,QACT,CAAC,GACD;AACA,eAAK,SAAS,EAAE,UAAU,MAAM,CAAC;AAAA,QACnC;AAAA,MACF;AAAA,IACF;AA7CE,SAAK,QAAQ;AAAA,MACX,OAAO,MAAM;AAAA,IACf;AAAA,EACF;AAAA,EAEA,oBAAoB;AAClB,UAAM,EAAE,MAAM,IAAI,KAAK;AACvB,SAAK,mBAAmB,KAAK;AAAA,EAC/B;AAAA,EAEA,OAAO,yBAAyB,WAAW,WAAW;AACpD,UAAM,EAAE,MAAM,IAAI;AAClB,QAAI,UAAU,UAAU;AAAO,aAAO;AACtC,WAAO;AAAA,MACL,GAAG;AAAA,MACH;AAAA,IACF;AAAA,EACF;AAAA,EA8BA,SAAS;AACP,UAAM,EAAE,SAAS,IAAI,KAAK;AAC1B,UAAM,EAAE,OAAO,mBAAmB,iBAAiB,SAAS,IAAI,KAAK;AACrE,WAAO,SAAS;AAAA,MACd;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU,KAAK;AAAA,MACf,QAAQ,KAAK;AAAA,IACf,CAAC;AAAA,EACH;AACF;AAxEqB,uBACZ,eAAe;AAAA,EACpB,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU,MAAM;AAAA,EAChB,UAAU,MAAM;AAAA,EAChB,QAAQ,MAAM;AAChB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/Input/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export { DSInput, InputAddonWrapper, DSInput as default } from '@elliemae/ds-common/Input'
|
|
4
|
+
"sourcesContent": ["export { DSInput, InputAddonWrapper, DSInput as default } from '@elliemae/ds-common/Input';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA+D;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -41,13 +41,7 @@ class AddonWrapper extends import_react.Component {
|
|
|
41
41
|
this.state = {};
|
|
42
42
|
}
|
|
43
43
|
render() {
|
|
44
|
-
const {
|
|
45
|
-
leftAddon,
|
|
46
|
-
rightAddon,
|
|
47
|
-
children: inputComponent,
|
|
48
|
-
className,
|
|
49
|
-
containerProps
|
|
50
|
-
} = this.props;
|
|
44
|
+
const { leftAddon, rightAddon, children: inputComponent, className, containerProps } = this.props;
|
|
51
45
|
const childType = inputComponent && inputComponent.type && inputComponent.type.name ? inputComponent.type.name.toLowerCase() : "default";
|
|
52
46
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Container, {
|
|
53
47
|
className: `${className} ${blockName}--${childType}`,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/InputGroup/AddonWrapper.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { Component } from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\n\nconst blockName = 'input-addon-group';\n\nconst Container = aggregatedClasses('div')(blockName);\nconst InputAddon = aggregatedClasses('span')(blockName, 'addon');\n\nclass AddonWrapper extends Component {\n static defaultProps = {};\n\n state = {};\n\n render() {\n const {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React, { Component } from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\n\nconst blockName = 'input-addon-group';\n\nconst Container = aggregatedClasses('div')(blockName);\nconst InputAddon = aggregatedClasses('span')(blockName, 'addon');\n\nclass AddonWrapper extends Component {\n static defaultProps = {};\n\n state = {};\n\n render() {\n const { leftAddon, rightAddon, children: inputComponent, className, containerProps } = this.props;\n const childType =\n inputComponent && inputComponent.type && inputComponent.type.name\n ? inputComponent.type.name.toLowerCase()\n : 'default';\n return (\n <Container className={`${className} ${blockName}--${childType}`} {...containerProps}>\n {leftAddon && <InputAddon>{leftAddon}</InputAddon>}\n {inputComponent}\n {rightAddon && <InputAddon>{rightAddon}</InputAddon>}\n </Container>\n );\n }\n}\n\nexport { AddonWrapper };\nexport default AddonWrapper;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADoBjB;AApBN,mBAAiC;AACjC,2BAAkC;AAElC,MAAM,YAAY;AAElB,MAAM,gBAAY,wCAAkB,KAAK,EAAE,SAAS;AACpD,MAAM,iBAAa,wCAAkB,MAAM,EAAE,WAAW,OAAO;AAE/D,MAAM,qBAAqB,uBAAU;AAAA,EAArC;AAAA;AAGE,iBAAQ,CAAC;AAAA;AAAA,EAET,SAAS;AACP,UAAM,EAAE,WAAW,YAAY,UAAU,gBAAgB,WAAW,eAAe,IAAI,KAAK;AAC5F,UAAM,YACJ,kBAAkB,eAAe,QAAQ,eAAe,KAAK,OACzD,eAAe,KAAK,KAAK,YAAY,IACrC;AACN,WACE,6CAAC;AAAA,MAAU,WAAW,GAAG,aAAa,cAAc;AAAA,MAAc,GAAG;AAAA,MAClE;AAAA,qBAAa,4CAAC;AAAA,UAAY;AAAA,SAAU;AAAA,QACpC;AAAA,QACA,cAAc,4CAAC;AAAA,UAAY;AAAA,SAAW;AAAA;AAAA,KACzC;AAAA,EAEJ;AACF;AAnBM,aACG,eAAe,CAAC;AAqBzB,IAAO,uBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -30,21 +30,14 @@ module.exports = __toCommonJS(props_exports);
|
|
|
30
30
|
var React = __toESM(require("react"));
|
|
31
31
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
32
32
|
const props = {
|
|
33
|
-
containerProps: import_ds_utilities.PropTypes.shape({}).description(
|
|
34
|
-
|
|
33
|
+
containerProps: import_ds_utilities.PropTypes.shape({}).description("props injected to wrapper of page header"),
|
|
34
|
+
innerRef: import_ds_utilities.PropTypes.oneOfType([import_ds_utilities.PropTypes.func, import_ds_utilities.PropTypes.shape({ current: import_ds_utilities.PropTypes.any })]).description(
|
|
35
|
+
"inner ref for input group wrapper"
|
|
35
36
|
),
|
|
36
|
-
innerRef: import_ds_utilities.PropTypes.oneOfType([
|
|
37
|
-
import_ds_utilities.PropTypes.func,
|
|
38
|
-
import_ds_utilities.PropTypes.shape({ current: import_ds_utilities.PropTypes.any })
|
|
39
|
-
]).description("inner ref for input group wrapper"),
|
|
40
37
|
className: import_ds_utilities.PropTypes.string.description("class for input group wrapper"),
|
|
41
38
|
style: import_ds_utilities.PropTypes.object.description("Set style for the input group"),
|
|
42
|
-
leftAddon: import_ds_utilities.PropTypes.element.description(
|
|
43
|
-
|
|
44
|
-
),
|
|
45
|
-
rightAddon: import_ds_utilities.PropTypes.element.description(
|
|
46
|
-
"Component to be added at the right side of the input"
|
|
47
|
-
),
|
|
39
|
+
leftAddon: import_ds_utilities.PropTypes.element.description("Component to be added at the left side of the input"),
|
|
40
|
+
rightAddon: import_ds_utilities.PropTypes.element.description("Component to be added at the right side of the input"),
|
|
48
41
|
children: import_ds_utilities.PropTypes.element.description("Input components to show")
|
|
49
42
|
};
|
|
50
43
|
//# sourceMappingURL=props.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/InputGroup/props.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { PropTypes } from '@elliemae/ds-utilities';\n\nexport const props = {\n /** props injected to wrapper of page header */\n containerProps: PropTypes.shape({}).description(
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0BAA0B;AAEnB,MAAM,QAAQ;AAAA,EAEnB,gBAAgB,8BAAU,MAAM,CAAC,CAAC,EAAE
|
|
4
|
+
"sourcesContent": ["import { PropTypes } from '@elliemae/ds-utilities';\n\nexport const props = {\n /** props injected to wrapper of page header */\n containerProps: PropTypes.shape({}).description('props injected to wrapper of page header'),\n /** inner ref for input group wrapper */\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]).description(\n 'inner ref for input group wrapper',\n ),\n /** class for input group wrapper */\n className: PropTypes.string.description('class for input group wrapper'),\n /**\n * Set style for the input group\n */\n style: PropTypes.object.description('Set style for the input group'),\n /**\n * Component to be added at the left side of the input\n */\n leftAddon: PropTypes.element.description('Component to be added at the left side of the input'),\n /**\n * Component to be added at the right side of the input\n */\n rightAddon: PropTypes.element.description('Component to be added at the right side of the input'),\n /**\n * Input components to show\n */\n children: PropTypes.element.description('Input components to show'),\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0BAA0B;AAEnB,MAAM,QAAQ;AAAA,EAEnB,gBAAgB,8BAAU,MAAM,CAAC,CAAC,EAAE,YAAY,0CAA0C;AAAA,EAE1F,UAAU,8BAAU,UAAU,CAAC,8BAAU,MAAM,8BAAU,MAAM,EAAE,SAAS,8BAAU,IAAI,CAAC,CAAC,CAAC,EAAE;AAAA,IAC3F;AAAA,EACF;AAAA,EAEA,WAAW,8BAAU,OAAO,YAAY,+BAA+B;AAAA,EAIvE,OAAO,8BAAU,OAAO,YAAY,+BAA+B;AAAA,EAInE,WAAW,8BAAU,QAAQ,YAAY,qDAAqD;AAAA,EAI9F,YAAY,8BAAU,QAAQ,YAAY,sDAAsD;AAAA,EAIhG,UAAU,8BAAU,QAAQ,YAAY,0BAA0B;AACpE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -63,9 +63,7 @@ const DSInputMask = ({
|
|
|
63
63
|
value: valueOrEvent,
|
|
64
64
|
...rest
|
|
65
65
|
}) => {
|
|
66
|
-
const [rawValue, setRawValue] = (0, import_react.useState)(
|
|
67
|
-
getValueFromEventOrString(valueOrEvent)
|
|
68
|
-
);
|
|
66
|
+
const [rawValue, setRawValue] = (0, import_react.useState)(getValueFromEventOrString(valueOrEvent));
|
|
69
67
|
(0, import_react.useEffect)(() => {
|
|
70
68
|
setRawValue(getValueFromEventOrString(valueOrEvent));
|
|
71
69
|
}, [valueOrEvent]);
|
|
@@ -135,9 +133,7 @@ const DSInputMask = ({
|
|
|
135
133
|
DSInputMask.propTypes = import_props.inputProps;
|
|
136
134
|
DSInputMask.defaultProps = import_defaultProps.defaultProps;
|
|
137
135
|
DSInputMask.displayName = "DSInputMask";
|
|
138
|
-
const DSInputMaskWithSchema = (0, import_ds_utilities.describe)(DSInputMask).description(
|
|
139
|
-
"Masking input for custom formats"
|
|
140
|
-
);
|
|
136
|
+
const DSInputMaskWithSchema = (0, import_ds_utilities.describe)(DSInputMask).description("Masking input for custom formats");
|
|
141
137
|
DSInputMaskWithSchema.propTypes = import_props.inputProps;
|
|
142
138
|
var DSInputMask_default = DSInputMask;
|
|
143
139
|
//# sourceMappingURL=DSInputMask.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/InputMask/DSInputMask.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport React, { useCallback, useEffect, useState } from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { MASK_TYPES } from './MaskTypes';\nimport { MASK_PIPES } from './MaskPipes';\nimport { DSInputMaskDeprecated } from './DSInputMaskDeprecated';\nimport { inputProps } from './props';\nimport { defaultProps } from './defaultProps';\nimport { OutOfTheBoxMaskTypes } from './mask_types';\n\nconst isStringMask = (mask: any) => typeof mask === 'string';\n\nconst isObjectMask = (mask: any) => typeof mask === 'object' && mask.type;\n\nconst getRawMask = (mask: any, rawValue: string)
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport React, { useCallback, useEffect, useState } from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { MASK_TYPES } from './MaskTypes';\nimport { MASK_PIPES } from './MaskPipes';\nimport { DSInputMaskDeprecated } from './DSInputMaskDeprecated';\nimport { inputProps } from './props';\nimport { defaultProps } from './defaultProps';\nimport { OutOfTheBoxMaskTypes } from './mask_types';\n\nconst isStringMask = (mask: any) => typeof mask === 'string';\n\nconst isObjectMask = (mask: any) => typeof mask === 'object' && mask.type;\n\nconst getRawMask = (mask: any, rawValue: string) => (typeof mask === 'function' ? mask(rawValue) : mask);\n\nconst getValueFromEventOrString = (e: any): string => {\n let value = e;\n if (e && e.target) {\n const {\n target: { value: eValue },\n } = e;\n value = eValue;\n }\n return value;\n};\n\nconst DSInputMask = ({\n 'aria-label': ariaLabel = 'Input Mask',\n autoFocus,\n innerRef,\n mask,\n pipe,\n value: valueOrEvent,\n ...rest\n}) => {\n const [rawValue, setRawValue] = useState(getValueFromEventOrString(valueOrEvent));\n\n useEffect(() => {\n setRawValue(getValueFromEventOrString(valueOrEvent));\n }, [valueOrEvent]);\n\n const [rawMask, setRawMask] = useState<any>(getRawMask(mask, rawValue));\n\n const [focus, setFocus] = useState(autoFocus);\n\n const [lastkey, setLastkey] = useState<{ code: number; key: string }>({\n code: null,\n key: null,\n });\n\n const [cursorPosition, setCursorPosition] = useState({ current: 0 });\n\n const handleSetMask = useCallback(\n (newValue) => {\n setRawMask(getRawMask(mask, newValue));\n },\n [mask],\n );\n\n if (!pipe && isStringMask(rawMask)) {\n return OutOfTheBoxMaskTypes[rawMask]({\n ...rest,\n 'aria-label': ariaLabel,\n innerRef,\n value: rawValue,\n focus,\n setFocus,\n setRawMask: handleSetMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n });\n }\n\n if (!pipe && isObjectMask(rawMask)) {\n // we should change rawMask.type to rawMask.maskType\n // to avoid override standard props\n return OutOfTheBoxMaskTypes[rawMask.type]({\n ...rawMask,\n ...rest,\n 'aria-label': ariaLabel,\n innerRef,\n value: rawValue,\n focus,\n setFocus,\n setRawMask: handleSetMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n });\n }\n\n const getDeprecatedMask = () => {\n if (mask === MASK_TYPES.DATE) return MASK_TYPES.DATE_DEPRECATED;\n if (mask === MASK_TYPES.DATE_TIME) return MASK_TYPES.DATE_TIME_DEPRECATED;\n return mask;\n };\n return (\n <DSInputMaskDeprecated\n {...rest}\n aria-label={ariaLabel}\n autoFocus={autoFocus}\n innerRef={innerRef}\n mask={getDeprecatedMask()}\n pipe={pipe}\n value={rawValue}\n />\n );\n};\n\nDSInputMask.propTypes = inputProps;\nDSInputMask.defaultProps = defaultProps;\nDSInputMask.displayName = 'DSInputMask';\nconst DSInputMaskWithSchema = describe(DSInputMask).description('Masking input for custom formats');\nDSInputMaskWithSchema.propTypes = inputProps;\n\nexport { MASK_TYPES, MASK_PIPES, DSInputMaskWithSchema, DSInputMask };\nexport default DSInputMask;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADuGnB;AAtGJ,mBAAwD;AACxD,0BAAyB;AACzB,uBAA2B;AAC3B,uBAA2B;AAC3B,mCAAsC;AACtC,mBAA2B;AAC3B,0BAA6B;AAC7B,wBAAqC;AAErC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YAAY;AAAA,MACZ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AAEA,MAAI,CAAC,QAAQ,aAAa,OAAO,GAAG;AAGlC,WAAO,uCAAqB,QAAQ,MAAM;AAAA,MACxC,GAAG;AAAA,MACH,GAAG;AAAA,MACH,cAAc;AAAA,MACd;AAAA,MACA,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA,YAAY;AAAA,MACZ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AAEA,QAAM,oBAAoB,MAAM;AAC9B,QAAI,SAAS,4BAAW;AAAM,aAAO,4BAAW;AAChD,QAAI,SAAS,4BAAW;AAAW,aAAO,4BAAW;AACrD,WAAO;AAAA,EACT;AACA,SACE,4CAAC;AAAA,IACE,GAAG;AAAA,IACJ,cAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA,MAAM,kBAAkB;AAAA,IACxB;AAAA,IACA,OAAO;AAAA,GACT;AAEJ;AAEA,YAAY,YAAY;AACxB,YAAY,eAAe;AAC3B,YAAY,cAAc;AAC1B,MAAM,4BAAwB,8BAAS,WAAW,EAAE,YAAY,kCAAkC;AAClG,sBAAsB,YAAY;AAGlC,IAAO,sBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/InputMask/InputMaskContext.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { TLastkey } from './types';\n\nexport const InputMaskContext = React.createContext<{\n rawValue: string;\n setRawValue: React.Dispatch<string>;\n rawMask: any;\n setRawMask: React.Dispatch<any>;\n focus: boolean;\n setFocus: React.Dispatch<boolean>;\n lastkey: TLastkey;\n setLastkey: React.Dispatch<TLastkey>;\n cursorPosition: { current: number };\n setCursorPosition: React.Dispatch<{ current: number }>;\n}>({\n rawValue: '',\n setRawValue: () => null,\n rawMask: null,\n setRawMask: () => null,\n focus: false,\n setFocus: () => null,\n lastkey: { code: null, key: null },\n setLastkey: () => null,\n cursorPosition: { current: 0 },\n setCursorPosition: () => null,\n});\n", "import * as React from 'react';\nexport { React };\n"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport type { TLastkey } from './types';\n\nexport const InputMaskContext = React.createContext<{\n rawValue: string;\n setRawValue: React.Dispatch<string>;\n rawMask: any;\n setRawMask: React.Dispatch<any>;\n focus: boolean;\n setFocus: React.Dispatch<boolean>;\n lastkey: TLastkey;\n setLastkey: React.Dispatch<TLastkey>;\n cursorPosition: { current: number };\n setCursorPosition: React.Dispatch<{ current: number }>;\n}>({\n rawValue: '',\n setRawValue: () => null,\n rawMask: null,\n setRawMask: () => null,\n focus: false,\n setFocus: () => null,\n lastkey: { code: null, key: null },\n setLastkey: () => null,\n cursorPosition: { current: 0 },\n setCursorPosition: () => null,\n});\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAGX,MAAM,mBAAmB,aAAAA,QAAM,cAWnC;AAAA,EACD,UAAU;AAAA,EACV,aAAa,MAAM;AAAA,EACnB,SAAS;AAAA,EACT,YAAY,MAAM;AAAA,EAClB,OAAO;AAAA,EACP,UAAU,MAAM;AAAA,EAChB,SAAS,EAAE,MAAM,MAAM,KAAK,KAAK;AAAA,EACjC,YAAY,MAAM;AAAA,EAClB,gBAAgB,EAAE,SAAS,EAAE;AAAA,EAC7B,mBAAmB,MAAM;AAC3B,CAAC;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -55,10 +55,7 @@ const autoCorrectedDatePipe = (dateFormat = "mm dd yyyy", { minYear = 1, maxYear
|
|
|
55
55
|
const conformedValueArr = conformedValue.split("");
|
|
56
56
|
dateFormatArray.forEach((format) => {
|
|
57
57
|
const position = dateFormat.indexOf(format);
|
|
58
|
-
const maxFirstDigit = parseInt(
|
|
59
|
-
maxValue[format].toString().substr(0, 1),
|
|
60
|
-
10
|
|
61
|
-
);
|
|
58
|
+
const maxFirstDigit = parseInt(maxValue[format].toString().substr(0, 1), 10);
|
|
62
59
|
if (parseInt(conformedValueArr[position], 10) > maxFirstDigit) {
|
|
63
60
|
conformedValueArr[position + 1] = conformedValueArr[position];
|
|
64
61
|
conformedValueArr[position] = 0;
|
|
@@ -76,14 +73,8 @@ const autoCorrectedDatePipe = (dateFormat = "mm dd yyyy", { minYear = 1, maxYear
|
|
|
76
73
|
}
|
|
77
74
|
const maxValueForFormat = format === "dd" ? maxValueMonth[month] : maxValue[format];
|
|
78
75
|
if (format === "yyyy" && (minYear !== 1 || maxYear !== 9999)) {
|
|
79
|
-
const scopedMaxValue = parseInt(
|
|
80
|
-
|
|
81
|
-
10
|
|
82
|
-
);
|
|
83
|
-
const scopedMinValue = parseInt(
|
|
84
|
-
minValue[format].toString().substring(0, textValue.length),
|
|
85
|
-
10
|
|
86
|
-
);
|
|
76
|
+
const scopedMaxValue = parseInt(maxValue[format].toString().substring(0, textValue.length), 10);
|
|
77
|
+
const scopedMinValue = parseInt(minValue[format].toString().substring(0, textValue.length), 10);
|
|
87
78
|
return value < scopedMinValue || value > scopedMaxValue;
|
|
88
79
|
}
|
|
89
80
|
return value > maxValueForFormat || textValue.length === length && value < minValue[format];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/InputMask/addons/AutoCorrectedDatePipe.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["const maxValueMonth = [31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst formatOrder = ['yyyy', 'yy', 'mm', 'dd', 'HH', 'MM', 'SS'];\nexport const autoCorrectedDatePipe = (
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,MAAM,gBAAgB,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,EAAE;AACzE,MAAM,cAAc,CAAC,QAAQ,MAAM,MAAM,MAAM,MAAM,MAAM,IAAI;AACxD,MAAM,wBAAwB,
|
|
4
|
+
"sourcesContent": ["const maxValueMonth = [31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst formatOrder = ['yyyy', 'yy', 'mm', 'dd', 'HH', 'MM', 'SS'];\nexport const autoCorrectedDatePipe = (dateFormat = 'mm dd yyyy', { minYear = 1, maxYear = 9999 } = {}) => {\n const dateFormatArray = dateFormat\n .split(/[^dmyHMS]+/)\n .sort((a, b) => formatOrder.indexOf(a) - formatOrder.indexOf(b));\n return (conformedValue) => {\n const indexesOfPipedChars = [];\n const maxValue = {\n dd: 31,\n mm: 12,\n yy: 99,\n yyyy: maxYear,\n HH: 23,\n MM: 59,\n SS: 59,\n };\n const minValue = {\n dd: 1,\n mm: 1,\n yy: 0,\n yyyy: minYear,\n HH: 0,\n MM: 0,\n SS: 0,\n };\n const conformedValueArr = conformedValue.split('');\n\n // Check first digit\n dateFormatArray.forEach((format) => {\n const position = dateFormat.indexOf(format);\n const maxFirstDigit = parseInt(maxValue[format].toString().substr(0, 1), 10);\n\n if (parseInt(conformedValueArr[position], 10) > maxFirstDigit) {\n conformedValueArr[position + 1] = conformedValueArr[position];\n conformedValueArr[position] = 0;\n indexesOfPipedChars.push(position);\n }\n });\n\n // Check for invalid date\n let month = 0;\n const isInvalid = dateFormatArray.some((format) => {\n const position = dateFormat.indexOf(format);\n const { length } = format;\n const textValue = conformedValue.substr(position, length).replace(/\\D/g, '');\n const value = parseInt(textValue, 10);\n if (format === 'mm') {\n month = value || 0;\n }\n const maxValueForFormat = format === 'dd' ? maxValueMonth[month] : maxValue[format];\n if (format === 'yyyy' && (minYear !== 1 || maxYear !== 9999)) {\n const scopedMaxValue = parseInt(maxValue[format].toString().substring(0, textValue.length), 10);\n const scopedMinValue = parseInt(minValue[format].toString().substring(0, textValue.length), 10);\n return value < scopedMinValue || value > scopedMaxValue;\n }\n return value > maxValueForFormat || (textValue.length === length && value < minValue[format]);\n });\n\n return {\n value: conformedValueArr.join(''),\n valid: !isInvalid,\n indexesOfPipedChars,\n };\n };\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,MAAM,gBAAgB,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,EAAE;AACzE,MAAM,cAAc,CAAC,QAAQ,MAAM,MAAM,MAAM,MAAM,MAAM,IAAI;AACxD,MAAM,wBAAwB,CAAC,aAAa,cAAc,EAAE,UAAU,GAAG,UAAU,KAAK,IAAI,CAAC,MAAM;AACxG,QAAM,kBAAkB,WACrB,MAAM,YAAY,EAClB,KAAK,CAAC,GAAG,MAAM,YAAY,QAAQ,CAAC,IAAI,YAAY,QAAQ,CAAC,CAAC;AACjE,SAAO,CAAC,mBAAmB;AACzB,UAAM,sBAAsB,CAAC;AAC7B,UAAM,WAAW;AAAA,MACf,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AACA,UAAM,WAAW;AAAA,MACf,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AACA,UAAM,oBAAoB,eAAe,MAAM,EAAE;AAGjD,oBAAgB,QAAQ,C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103
103
|
const conform = (0, import_react.useCallback)(
|
|
104
104
|
({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true }) => {
|
|
105
|
-
const { nextMaskedValue, maskedPos } = conformValue(
|
|
106
|
-
rawValue,
|
|
107
|
-
cursorPos,
|
|
108
|
-
lastkeycode
|
|
109
|
-
);
|
|
105
|
+
const { nextMaskedValue, maskedPos } = conformValue(rawValue, cursorPos, lastkeycode);
|
|
110
106
|
const event = {
|
|
111
107
|
target: {
|
|
112
108
|
value: nextMaskedValue,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/InputMask/mask_types/DateInputMask.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from '@elliemae/ds-utilities';\nimport { DSTextBox } from '../../TextBox';\nimport { TCharsToAdd } from '../types';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst conformValue = (
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from '@elliemae/ds-utilities';\nimport { DSTextBox } from '../../TextBox';\nimport type { TCharsToAdd } from '../types';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst conformValue = (rawValue: string, cursorPos: number, lastkeycode: number) => {\n const nextMaskedValue = rawValue\n .split('')\n .filter((char) => char >= '0' && char <= '9')\n .slice(0, 8);\n\n let maskedPos = 0;\n for (let i = 0; i < cursorPos; i += 1) {\n if (nextMaskedValue[maskedPos] === rawValue[i]) maskedPos += 1;\n }\n\n // list of [string to add, position to add]\n const charactersToAdd: TCharsToAdd = [\n ['/', 2],\n ['/', 5],\n ];\n\n charactersToAdd.forEach(([chars, pos]) => {\n if (nextMaskedValue.length > pos) {\n nextMaskedValue.splice(pos, 0, chars);\n if (maskedPos >= pos) maskedPos += chars.length;\n }\n });\n\n if (lastkeycode !== 8 && maskedPos < nextMaskedValue.length) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos) maskedPos += chars.length;\n });\n } else if (lastkeycode === 8 && maskedPos) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos + 1) maskedPos -= chars.length;\n });\n }\n\n return { nextMaskedValue: nextMaskedValue.join(''), maskedPos };\n};\n\nconst DateInputMask = ({\n focus,\n setFocus,\n setRawMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n style,\n disabled,\n className,\n name,\n maxLength,\n minLength,\n fluidWidth,\n placeholder,\n onKeyDown,\n onClick,\n onChange,\n onFocus,\n onBlur,\n onPaste,\n onKeyUp,\n hasError,\n readOnly,\n type,\n innerRef,\n clearable = false,\n leftComponent,\n rightComponent,\n value,\n ...rest\n}) => {\n const inputRef = useRef();\n const [maskedValue, setMaskedValue] = useState(value);\n\n const conform = useCallback(\n ({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true }) => {\n const { nextMaskedValue, maskedPos } = conformValue(rawValue, cursorPos, lastkeycode);\n const event = {\n target: {\n value: nextMaskedValue,\n originalValue: rawValue,\n },\n };\n if (onChange && nextMaskedValue !== maskedValue) onChange(event);\n\n setMaskedValue(nextMaskedValue);\n setRawValue(nextMaskedValue);\n\n if (shouldUpdateCursorPos) setCursorPosition({ current: maskedPos });\n },\n [maskedValue, onChange],\n );\n\n const handleOnChange = useCallback(\n (e) => {\n const { value: rawValue, selectionEnd } = e.target;\n setRawMask(rawValue);\n setRawValue(rawValue);\n setCursorPosition({ current: selectionEnd });\n setFocus(true);\n },\n [setRawMask, setRawValue, setCursorPosition, setFocus, lastkey.code],\n );\n\n useLayoutEffect(() => {\n if (focus) setCaretPosition(inputRef.current, cursorPosition.current);\n }, [focus, cursorPosition]);\n\n useLayoutEffect(() => {\n // if the value changes, then re-conform the mask\n conform({\n rawValue: value,\n cursorPos: cursorPosition.current,\n lastkeycode: lastkey.code,\n shouldUpdateCursorPos: focus,\n });\n }, [focus, value, cursorPosition.current]);\n\n const handleKeyDown = useCallback(\n (e) => {\n e.stopPropagation();\n setLastkey({ key: e.key, code: e.keyCode });\n onKeyDown(e);\n },\n [onKeyDown],\n );\n\n const handleBlur = useCallback(\n (e) => {\n setFocus(false);\n onBlur(e);\n },\n [onBlur],\n );\n\n return (\n <DSTextBox\n {...rest}\n className={className}\n clearable={clearable}\n disabled={disabled}\n fluidWidth={fluidWidth}\n hasError={hasError}\n innerRef={(ref) => {\n inputRef.current = ref;\n if (innerRef) innerRef(ref);\n }}\n isActive={focus}\n leftComponent={leftComponent}\n maxLength={maxLength}\n minLength={minLength}\n name={name}\n onBlur={handleBlur}\n onChange={handleOnChange}\n onClick={onClick}\n onFocus={onFocus}\n onKeyDown={handleKeyDown}\n onKeyUp={onKeyUp}\n onPaste={onPaste}\n placeholder={placeholder}\n readOnly={readOnly}\n rightComponent={rightComponent}\n style={style}\n type={type}\n value={maskedValue}\n />\n );\n};\n\nexport { DateInputMask };\nexport default DateInputMask;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADgJnB;AA9IJ,mBAAsE;AAEtE,qBAA0B;AAE1B,8BAAiC;AAEjC,MAAM,eAAe,CAAC,UAAkB,WAAmB,gBAAwB;AACjF,QAAM,kBAAkB,SACrB,MAAM,EAAE,EACR,OAAO,CAAC,SAAS,QAAQ,OAAO,QAAQ,GAAG,EAC3C,MAAM,GAAG,CAAC;AAEb,MAAI,YAAY;AAChB,WAAS,IAAI,GAAG,IAAI,WAAW,KAAK,G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O,CAAC;AAAA,IACV;AAAA,IACA,CAAC,MAAM;AAAA,EACT;AAEA,SACE,4CAAC;AAAA,IACE,GAAG;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,CAAC,QAAQ;AACjB,eAAS,UAAU;AACnB,UAAI;AAAU,iBAAS,GAAG;AAAA,IAC5B;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,GACT;AAEJ;AAGA,IAAO,wBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -108,11 +108,7 @@ const DateTimeInputMask = ({
|
|
|
108
108
|
const [maskedValue, setMaskedValue] = (0, import_react.useState)(value);
|
|
109
109
|
const conform = (0, import_react.useCallback)(
|
|
110
110
|
({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true }) => {
|
|
111
|
-
const { nextMaskedValue, maskedPos } = conformValue(
|
|
112
|
-
rawValue,
|
|
113
|
-
cursorPos,
|
|
114
|
-
lastkeycode
|
|
115
|
-
);
|
|
111
|
+
const { nextMaskedValue, maskedPos } = conformValue(rawValue, cursorPos, lastkeycode);
|
|
116
112
|
const event = {
|
|
117
113
|
target: {
|
|
118
114
|
value: nextMaskedValue,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/InputMask/mask_types/DateTimeInputMask.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from '@elliemae/ds-utilities';\nimport { DSTextBox } from '../../TextBox';\nimport { TCharsToAdd } from '../types';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst conformValue = (
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from '@elliemae/ds-utilities';\nimport { DSTextBox } from '../../TextBox';\nimport type { TCharsToAdd } from '../types';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst conformValue = (rawValue: string, cursorPos: number, lastkeycode: number) => {\n const nextMaskedValue = rawValue\n .split('')\n .filter((char) => char >= '0' && char <= '9')\n .slice(0, 12);\n\n while (nextMaskedValue.length > 8 && !nextMaskedValue[8].match(/[0-2]/)) nextMaskedValue.splice(8, 1);\n while (nextMaskedValue.length > 10 && !nextMaskedValue[10].match(/[0-5]/)) nextMaskedValue.splice(10, 1);\n\n let maskedPos = 0;\n for (let i = 0; i < cursorPos; i += 1) {\n if (nextMaskedValue[maskedPos] === rawValue[i]) maskedPos += 1;\n }\n\n // list of [string to add, position to add]\n const charactersToAdd: TCharsToAdd = [\n ['/', 2],\n ['/', 5],\n [' ', 10],\n [':', 13],\n ];\n\n charactersToAdd.forEach(([chars, pos]) => {\n if (nextMaskedValue.length > pos) {\n nextMaskedValue.splice(pos, 0, chars);\n if (maskedPos >= pos) maskedPos += chars.length;\n }\n });\n\n if (lastkeycode !== 8 && maskedPos < nextMaskedValue.length) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos) maskedPos += chars.length;\n });\n } else if (lastkeycode === 8 && maskedPos) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos + 1) maskedPos -= chars.length;\n });\n }\n\n return { nextMaskedValue: nextMaskedValue.join(''), maskedPos };\n};\n\nconst DateTimeInputMask = ({\n focus,\n setFocus,\n setRawMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n style,\n disabled,\n className,\n name,\n maxLength,\n minLength,\n fluidWidth,\n placeholder,\n onKeyDown,\n onClick,\n onChange,\n onFocus,\n onBlur,\n onPaste,\n onKeyUp,\n hasError,\n readOnly,\n type,\n innerRef,\n clearable = false,\n leftComponent,\n rightComponent,\n value,\n ...rest\n}) => {\n const inputRef = useRef();\n const [maskedValue, setMaskedValue] = useState(value);\n\n const conform = useCallback(\n ({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true }) => {\n const { nextMaskedValue, maskedPos } = conformValue(rawValue, cursorPos, lastkeycode);\n const event = {\n target: {\n value: nextMaskedValue,\n originalValue: rawValue,\n },\n };\n if (onChange && nextMaskedValue !== maskedValue) onChange(event);\n\n setMaskedValue(nextMaskedValue);\n setRawValue(nextMaskedValue);\n\n if (shouldUpdateCursorPos) setCursorPosition({ current: maskedPos });\n },\n [maskedValue, onChange],\n );\n\n const handleOnChange = useCallback(\n (e) => {\n const { value: rawValue, selectionEnd } = e.target;\n setRawMask(rawValue);\n setRawValue(rawValue);\n setCursorPosition({ current: selectionEnd });\n setFocus(true);\n },\n [setRawMask, setRawValue, setCursorPosition, setFocus, lastkey.code],\n );\n\n useLayoutEffect(() => {\n if (focus) setCaretPosition(inputRef.current, cursorPosition.current);\n }, [focus, cursorPosition]);\n\n useLayoutEffect(() => {\n // if the value changes, then re-conform the mask\n conform({\n rawValue: value,\n cursorPos: cursorPosition.current,\n lastkeycode: lastkey.code,\n shouldUpdateCursorPos: focus,\n });\n }, [focus, value, cursorPosition.current]);\n\n const handleKeyDown = useCallback(\n (e) => {\n e.stopPropagation();\n setLastkey({ key: e.key, code: e.keyCode });\n onKeyDown(e);\n },\n [onKeyDown],\n );\n\n const handleBlur = useCallback(\n (e) => {\n setFocus(false);\n onBlur(e);\n },\n [onBlur],\n );\n\n return (\n <DSTextBox\n {...rest}\n className={className}\n clearable={clearable}\n disabled={disabled}\n fluidWidth={fluidWidth}\n hasError={hasError}\n innerRef={(ref) => {\n inputRef.current = ref;\n if (innerRef) innerRef(ref);\n }}\n isActive={focus}\n leftComponent={leftComponent}\n maxLength={maxLength}\n minLength={minLength}\n name={name}\n onBlur={handleBlur}\n onChange={handleOnChange}\n onClick={onClick}\n onFocus={onFocus}\n onKeyDown={handleKeyDown}\n onKeyUp={onKeyUp}\n onPaste={onPaste}\n placeholder={placeholder}\n readOnly={readOnly}\n rightComponent={rightComponent}\n style={style}\n type={type}\n value={maskedValue}\n />\n );\n};\n\nexport { DateTimeInputMask };\nexport default DateTimeInputMask;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADsJnB;AAnJJ,mBAAsE;AAEtE,qBAA0B;AAE1B,8BAAiC;AAEjC,MAAM,eAAe,CAAC,UAAkB,WAAmB,gBAAwB;AACjF,QAAM,kBAAkB,SACrB,MAAM,EAAE,EACR,OAAO,CAAC,SAAS,QAAQ,OAAO,QAAQ,GAAG,EAC3C,MAAM,GAAG,EAAE;AAEd,SAAO,gBAAgB,SAAS,KAAK,CAAC,gBAAgB,GAAG,MAAM,OAAO;AAAG,oBAAgB,OAAO,GAAG,CAAC;AACpG,SAAO,gBAAgB,SAAS,MAAM,CAAC,gBAAgB,IAAI,MAAM,OAAO;AAAG,oBAAgB,OAAO,IAAI,CAAC;AAEvG,MAAI,YAAY;AAChB,WAAS,IAAI,GAAG,IAAI,WAAW,KAAK,GAAG;AACrC,QAAI,gBAAgB,eAAe,SAAS;AAAI,mBAAa;AAAA,EAC/D;AAGA,QAAM,kBAA+B;AAAA,IACnC,CAAC,KAAK,CAAC;AAAA,IACP,CAAC,KAAK,CAAC;AAAA,IACP,CAAC,KAAK,EAAE;AAAA,IACR,CAAC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A;AAAA,IACA;AAAA,IACA,UAAU,CAAC,QAAQ;AACjB,eAAS,UAAU;AACnB,UAAI;AAAU,iBAAS,GAAG;AAAA,IAC5B;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,GACT;AAEJ;AAGA,IAAO,4BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -95,13 +95,7 @@ const DictionaryInputMask = ({
|
|
|
95
95
|
const [maskedValue, setMaskedValue] = (0, import_react.useState)(value);
|
|
96
96
|
const conform = (0, import_react.useCallback)(
|
|
97
97
|
({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true }) => {
|
|
98
|
-
const { nextMaskedValue, maskedPos } = conformValue(
|
|
99
|
-
rawValue,
|
|
100
|
-
cursorPos,
|
|
101
|
-
lastkeycode,
|
|
102
|
-
allowedWords,
|
|
103
|
-
ignoreCase
|
|
104
|
-
);
|
|
98
|
+
const { nextMaskedValue, maskedPos } = conformValue(rawValue, cursorPos, lastkeycode, allowedWords, ignoreCase);
|
|
105
99
|
const event = {
|
|
106
100
|
target: {
|
|
107
101
|
value: nextMaskedValue,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/InputMask/mask_types/DictionaryInputMask.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable no-loop-func */\n/* eslint-disable max-params */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from '@elliemae/ds-utilities';\nimport { DSTextBox } from '../../TextBox';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst startsWith = (a: string, b: string, ignoreCase: boolean): boolean => {\n if (ignoreCase) {\n a = a.toLowerCase();\n b = b.toLowerCase();\n }\n return a.startsWith(b);\n};\n\nconst conformValue = (\n rawValue: string,\n cursorPos: number,\n lastkeycode: number,\n allowedWords: string[],\n ignoreCase: boolean,\n) => {\n let nextMaskedValue = '';\n let currentPosibleWords = allowedWords;\n for (let i = 0; i < rawValue.length; i += 1) {\n const matchingWords = currentPosibleWords.filter((word) =>\n startsWith(word, nextMaskedValue + rawValue[i], ignoreCase),\n );\n if (matchingWords.length) {\n nextMaskedValue += rawValue[i];\n currentPosibleWords = matchingWords;\n }\n }\n\n return { nextMaskedValue, maskedPos: cursorPos };\n};\n\nconst DictionaryInputMask = ({\n focus,\n setFocus,\n setRawMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n allowedWords,\n ignoreCase = true,\n autoFocus,\n style,\n disabled,\n className,\n name,\n maxLength,\n minLength,\n fluidWidth,\n placeholder,\n onKeyDown,\n onClick,\n onChange,\n onFocus,\n onBlur,\n onPaste,\n onKeyUp,\n hasError,\n readOnly,\n type,\n innerRef,\n clearable = false,\n leftComponent,\n rightComponent,\n value,\n ...rest\n}) => {\n const inputRef = useRef();\n const [maskedValue, setMaskedValue] = useState(value);\n\n const conform = useCallback(\n ({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true }) => {\n const { nextMaskedValue, maskedPos } = conformValue(
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable no-loop-func */\n/* eslint-disable max-params */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from '@elliemae/ds-utilities';\nimport { DSTextBox } from '../../TextBox';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst startsWith = (a: string, b: string, ignoreCase: boolean): boolean => {\n if (ignoreCase) {\n a = a.toLowerCase();\n b = b.toLowerCase();\n }\n return a.startsWith(b);\n};\n\nconst conformValue = (\n rawValue: string,\n cursorPos: number,\n lastkeycode: number,\n allowedWords: string[],\n ignoreCase: boolean,\n) => {\n let nextMaskedValue = '';\n let currentPosibleWords = allowedWords;\n for (let i = 0; i < rawValue.length; i += 1) {\n const matchingWords = currentPosibleWords.filter((word) =>\n startsWith(word, nextMaskedValue + rawValue[i], ignoreCase),\n );\n if (matchingWords.length) {\n nextMaskedValue += rawValue[i];\n currentPosibleWords = matchingWords;\n }\n }\n\n return { nextMaskedValue, maskedPos: cursorPos };\n};\n\nconst DictionaryInputMask = ({\n focus,\n setFocus,\n setRawMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n allowedWords,\n ignoreCase = true,\n autoFocus,\n style,\n disabled,\n className,\n name,\n maxLength,\n minLength,\n fluidWidth,\n placeholder,\n onKeyDown,\n onClick,\n onChange,\n onFocus,\n onBlur,\n onPaste,\n onKeyUp,\n hasError,\n readOnly,\n type,\n innerRef,\n clearable = false,\n leftComponent,\n rightComponent,\n value,\n ...rest\n}) => {\n const inputRef = useRef();\n const [maskedValue, setMaskedValue] = useState(value);\n\n const conform = useCallback(\n ({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true }) => {\n const { nextMaskedValue, maskedPos } = conformValue(rawValue, cursorPos, lastkeycode, allowedWords, ignoreCase);\n const event = {\n target: {\n value: nextMaskedValue,\n originalValue: rawValue,\n },\n };\n if (onChange && nextMaskedValue !== maskedValue) onChange(event);\n\n setMaskedValue(nextMaskedValue);\n setRawValue(nextMaskedValue);\n\n if (shouldUpdateCursorPos) setCursorPosition({ current: maskedPos });\n },\n [maskedValue, onChange],\n );\n\n const handleOnChange = useCallback(\n (e) => {\n const { value: rawValue, selectionEnd } = e.target;\n setRawMask(rawValue);\n setRawValue(rawValue);\n setCursorPosition({ current: selectionEnd });\n setFocus(true);\n },\n [setRawMask, setRawValue, setCursorPosition, setFocus, lastkey.code],\n );\n\n useLayoutEffect(() => {\n if (focus) setCaretPosition(inputRef.current, cursorPosition.current);\n }, [focus, cursorPosition]);\n\n useLayoutEffect(() => {\n // if the value changes, then re-conform the mask\n conform({\n rawValue: value,\n cursorPos: cursorPosition.current,\n lastkeycode: lastkey.code,\n shouldUpdateCursorPos: focus,\n });\n }, [focus, value, cursorPosition.current]);\n\n const handleKeyDown = useCallback(\n (e) => {\n e.stopPropagation();\n setLastkey({ key: e.key, code: e.keyCode });\n onKeyDown(e);\n },\n [onKeyDown],\n );\n\n const handleBlur = useCallback(\n (e) => {\n setFocus(false);\n onBlur(e);\n },\n [onBlur],\n );\n\n return (\n <DSTextBox\n {...rest}\n className={className}\n clearable={clearable}\n disabled={disabled}\n fluidWidth={fluidWidth}\n hasError={hasError}\n innerRef={(ref) => {\n inputRef.current = ref;\n if (innerRef) innerRef(ref);\n }}\n isActive={focus}\n leftComponent={leftComponent}\n maxLength={maxLength}\n minLength={minLength}\n name={name}\n onBlur={handleBlur}\n onChange={handleOnChange}\n onClick={onClick}\n onFocus={onFocus}\n onKeyDown={handleKeyDown}\n onKeyUp={onKeyUp}\n onPaste={onPaste}\n placeholder={placeholder}\n readOnly={readOnly}\n rightComponent={rightComponent}\n style={style}\n type={type}\n value={maskedValue}\n />\n );\n};\n\nexport { DictionaryInputMask };\nexport default DictionaryInputMask;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD6InB;AAzIJ,mBAAsE;AAEtE,qBAA0B;AAC1B,8BAAiC;AAEjC,MAAM,aAAa,CAAC,GAAW,GAAW,eAAiC;AACzE,MAAI,YAAY;AACd,QAAI,EAAE,YAAY;AAClB,QAAI,EAAE,YAAY;AAAA,EACpB;AACA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AAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,GACT;AAEJ;AAGA,IAAO,8BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -106,11 +106,7 @@ const PhoneInputMask = ({
|
|
|
106
106
|
const [maskedValue, setMaskedValue] = (0, import_react.useState)(value);
|
|
107
107
|
const conform = (0, import_react.useCallback)(
|
|
108
108
|
({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true }) => {
|
|
109
|
-
const { nextMaskedValue, maskedPos } = conformValue(
|
|
110
|
-
rawValue,
|
|
111
|
-
cursorPos,
|
|
112
|
-
lastkeycode
|
|
113
|
-
);
|
|
109
|
+
const { nextMaskedValue, maskedPos } = conformValue(rawValue, cursorPos, lastkeycode);
|
|
114
110
|
const event = {
|
|
115
111
|
target: {
|
|
116
112
|
value: nextMaskedValue,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/InputMask/mask_types/PhoneInputMask.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from '@elliemae/ds-utilities';\nimport { DSTextBox } from '../../TextBox';\nimport { TCharsToAdd } from '../types';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst conformValue = (rawValue, cursorPos, lastkeycode) => {\n let nextMaskedValue = rawValue
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from '@elliemae/ds-utilities';\nimport { DSTextBox } from '../../TextBox';\nimport type { TCharsToAdd } from '../types';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst conformValue = (rawValue, cursorPos, lastkeycode) => {\n let nextMaskedValue = rawValue.split('').filter((char) => char >= '0' && char <= '9');\n\n while (nextMaskedValue.length && nextMaskedValue[0] === '0') nextMaskedValue.splice(0, 1);\n\n nextMaskedValue = nextMaskedValue.slice(0, 10);\n\n let maskedPos = 0;\n for (let i = 0; i < cursorPos; i += 1) {\n if (nextMaskedValue[maskedPos] === rawValue[i]) maskedPos += 1;\n }\n\n // list of [string to add, position to add]\n const charactersToAdd: TCharsToAdd = [\n ['(', 0],\n [') ', 4],\n ['-', 9],\n ];\n\n charactersToAdd.forEach(([chars, pos]) => {\n if (nextMaskedValue.length > pos) {\n nextMaskedValue.splice(pos, 0, ...chars);\n if (maskedPos >= pos) maskedPos += chars.length;\n }\n });\n\n if (lastkeycode !== 8 && maskedPos < nextMaskedValue.length) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos) maskedPos += chars.length;\n });\n } else if (lastkeycode === 8 && maskedPos) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos + 1) maskedPos -= chars.length;\n });\n }\n return { nextMaskedValue: nextMaskedValue.join(''), maskedPos };\n};\n\nconst PhoneInputMask = ({\n focus,\n setFocus,\n setRawMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n style,\n disabled,\n className,\n name,\n maxLength,\n minLength,\n fluidWidth,\n placeholder,\n onKeyDown,\n onClick,\n onChange,\n onFocus,\n onBlur,\n onPaste,\n onKeyUp,\n hasError,\n readOnly,\n type,\n innerRef,\n clearable = false,\n leftComponent,\n rightComponent,\n value,\n ...rest\n}) => {\n const inputRef = useRef();\n const [maskedValue, setMaskedValue] = useState(value);\n\n const conform = useCallback(\n ({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true }) => {\n const { nextMaskedValue, maskedPos } = conformValue(rawValue, cursorPos, lastkeycode);\n const event = {\n target: {\n value: nextMaskedValue,\n originalValue: rawValue,\n },\n };\n if (onChange && nextMaskedValue !== maskedValue) onChange(event);\n\n setMaskedValue(nextMaskedValue);\n setRawValue(nextMaskedValue);\n\n if (shouldUpdateCursorPos) setCursorPosition({ current: maskedPos });\n },\n [maskedValue, onChange],\n );\n\n const handleOnChange = useCallback(\n (e) => {\n const { value: rawValue, selectionEnd } = e.target;\n setRawMask(rawValue);\n setRawValue(rawValue);\n setCursorPosition({ current: selectionEnd });\n setFocus(true);\n },\n [setRawMask, setRawValue, setCursorPosition, setFocus, lastkey.code],\n );\n\n useLayoutEffect(() => {\n if (focus) setCaretPosition(inputRef.current, cursorPosition.current);\n }, [focus, cursorPosition]);\n\n useLayoutEffect(() => {\n // if the value changes, then re-conform the mask\n conform({\n rawValue: value,\n cursorPos: cursorPosition.current,\n lastkeycode: lastkey.code,\n shouldUpdateCursorPos: focus,\n });\n }, [focus, value, cursorPosition.current]);\n\n const handleKeyDown = useCallback(\n (e) => {\n e.stopPropagation();\n setLastkey({ key: e.key, code: e.keyCode });\n onKeyDown(e);\n },\n [onKeyDown],\n );\n\n const handleBlur = useCallback(\n (e) => {\n setFocus(false);\n onBlur(e);\n },\n [onBlur],\n );\n\n return (\n <DSTextBox\n {...rest}\n className={className}\n clearable={clearable}\n disabled={disabled}\n fluidWidth={fluidWidth}\n hasError={hasError}\n innerRef={(ref) => {\n inputRef.current = ref;\n if (innerRef) innerRef(ref);\n }}\n isActive={focus}\n leftComponent={leftComponent}\n maxLength={maxLength}\n minLength={minLength}\n name={name}\n onBlur={handleBlur}\n onChange={handleOnChange}\n onClick={onClick}\n onFocus={onFocus}\n onKeyDown={handleKeyDown}\n onKeyUp={onKeyUp}\n onPaste={onPaste}\n placeholder={placeholder}\n readOnly={readOnly}\n rightComponent={rightComponent}\n style={style}\n type={type}\n value={maskedValue}\n />\n );\n};\n\nexport { PhoneInputMask };\nexport default PhoneInputMask;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADiJnB;AA/IJ,mBAAsE;AAEtE,qBAA0B;AAE1B,8BAAiC;AAEjC,MAAM,eAAe,CAAC,UAAU,WAAW,gBAAgB;AACzD,MAAI,kBAAkB,SAAS,MAAM,EAAE,EAAE,OAAO,CAAC,SAAS,QAAQ,OAAO,QAAQ,GAAG;AAEpF,SAAO,gBAAgB,UAAU,gBAAgB,OAAO;AAAK,oBAAgB,OAAO,GAAG,CAAC;AAExF,oBAAkB,gBAAgB,MAAM,GAAG,EAAE;AAE7C,MAAI,YAAY;AAChB,WAAS,IAAI,GAAG,IAAI,WAAW,KAAK,GAAG;AACrC,QAAI,gBAAgB,eAAe,SAAS;AAAI,mBAAa;AAAA,EAC/D;AAGA,QAAM,kBAA+B;AAAA,IACnC,CAAC,KAAK,CAAC;AAAA,IACP,CAAC,MAAM,CAAC;AAAA,IACR,CAAC,KAAK,CAAC;AAAA,EACT;AAEA,kBAAgB,QAAQ,CAAC,CAAC,OAAO,GAAG,MAAM;AACxC,QAAI,gBAAgB,SAAS,KAAK;AAChC,sBAAgB,OAAO,KAAK,GAAG,GAAG,KAAK;AACvC,UAAI,aAAa;AAAK,qBAAa,MAAM;AAAA,IAC3C;AAAA,EACF,CAAC;AAED,MAAI,gBAAgB,KAAK,YAAY,gBAAgB,QAAQ;AAC3D,oBAAgB,QAAQ,CAAC,CAAC,OAAO,GAAG,MAAM;AACxC,UAAI,cAAc;AAAK,qBAAa,MAAM;AAAA,IAC5C,CAAC;AAAA,EACH,WAAW,gBAAgB,KAAK,WAAW;AACzC,oBAAgB,QAAQ,CAAC,CAAC,OAAO,GAAG,MAAM;AACxC,UAAI,cAAc,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edValue] = (0, import_react.useState)(value);
|
|
107
107
|
const conform = (0, import_react.useCallback)(
|
|
108
108
|
({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true }) => {
|
|
109
|
-
const { nextMaskedValue, maskedPos } = conformValue(
|
|
110
|
-
rawValue,
|
|
111
|
-
cursorPos,
|
|
112
|
-
lastkeycode
|
|
113
|
-
);
|
|
109
|
+
const { nextMaskedValue, maskedPos } = conformValue(rawValue, cursorPos, lastkeycode);
|
|
114
110
|
const event = {
|
|
115
111
|
target: {
|
|
116
112
|
value: nextMaskedValue,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/InputMask/mask_types/PhoneInternationalInputMask.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from '@elliemae/ds-utilities';\nimport { DSTextBox } from '../../TextBox';\nimport { TCharsToAdd } from '../types';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst conformValue = (rawValue, cursorPos, lastkeycode) => {\n let nextMaskedValue = rawValue\n .split('+1')\n .slice(-1)[0]\n .split('')\n .filter((char) => char >= '0' && char <= '9');\n\n while (nextMaskedValue.length && nextMaskedValue[0] === '0')
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { PropTypes } from '@elliemae/ds-utilities';\nimport { DSTextBox } from '../../TextBox';\nimport type { TCharsToAdd } from '../types';\nimport { setCaretPosition } from '../utils/setCaretPosition';\n\nconst conformValue = (rawValue, cursorPos, lastkeycode) => {\n let nextMaskedValue = rawValue\n .split('+1')\n .slice(-1)[0]\n .split('')\n .filter((char) => char >= '0' && char <= '9');\n\n while (nextMaskedValue.length && nextMaskedValue[0] === '0') nextMaskedValue.splice(0, 1);\n\n nextMaskedValue = nextMaskedValue.slice(0, 10);\n\n let maskedPos = 0;\n for (let i = 0; i < cursorPos; i += 1) {\n if (nextMaskedValue[maskedPos] === rawValue[i]) maskedPos += 1;\n }\n\n // list of [string to add, position to add]\n const charactersToAdd: TCharsToAdd = [\n ['+1 (', 0],\n [') ', 7],\n ['-', 12],\n ];\n\n charactersToAdd.forEach(([chars, pos]) => {\n if (nextMaskedValue.length > pos) {\n nextMaskedValue.splice(pos, 0, ...chars);\n if (maskedPos >= pos) maskedPos += chars.length;\n }\n });\n\n if (lastkeycode !== 8 && maskedPos < nextMaskedValue.length) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos) maskedPos += chars.length;\n });\n } else if (lastkeycode === 8 && maskedPos) {\n charactersToAdd.forEach(([chars, pos]) => {\n if (maskedPos === pos + 1) maskedPos -= chars.length;\n });\n }\n return { nextMaskedValue: nextMaskedValue.join(''), maskedPos };\n};\n\nconst PhoneInternationalInputMask = ({\n focus,\n setFocus,\n setRawMask,\n cursorPosition,\n setCursorPosition,\n lastkey,\n setLastkey,\n setRawValue,\n style,\n disabled,\n className,\n name,\n maxLength,\n minLength,\n fluidWidth,\n placeholder,\n onKeyDown,\n onClick,\n onChange,\n onFocus,\n onBlur,\n onPaste,\n onKeyUp,\n hasError,\n readOnly,\n type,\n innerRef,\n clearable = false,\n leftComponent,\n rightComponent,\n value,\n ...rest\n}) => {\n const inputRef = useRef();\n const [maskedValue, setMaskedValue] = useState(value);\n\n const conform = useCallback(\n ({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true }) => {\n const { nextMaskedValue, maskedPos } = conformValue(rawValue, cursorPos, lastkeycode);\n const event = {\n target: {\n value: nextMaskedValue,\n originalValue: rawValue,\n },\n };\n if (onChange && nextMaskedValue !== maskedValue) onChange(event);\n\n setMaskedValue(nextMaskedValue);\n setRawValue(nextMaskedValue);\n\n if (shouldUpdateCursorPos) setCursorPosition({ current: maskedPos });\n },\n [maskedValue, onChange],\n );\n\n const handleOnChange = useCallback(\n (e) => {\n const { value: rawValue, selectionEnd } = e.target;\n setRawMask(rawValue);\n setRawValue(rawValue);\n setCursorPosition({ current: selectionEnd });\n setFocus(true);\n },\n [setRawMask, setRawValue, setCursorPosition, setFocus, lastkey.code],\n );\n\n useLayoutEffect(() => {\n if (focus) setCaretPosition(inputRef.current, cursorPosition.current);\n }, [focus, cursorPosition]);\n\n useLayoutEffect(() => {\n // if the value changes, then re-conform the mask\n conform({\n rawValue: value,\n cursorPos: cursorPosition.current,\n lastkeycode: lastkey.code,\n shouldUpdateCursorPos: focus,\n });\n }, [focus, value, cursorPosition.current]);\n\n const handleKeyDown = useCallback(\n (e) => {\n e.stopPropagation();\n setLastkey({ key: e.key, code: e.keyCode });\n onKeyDown(e);\n },\n [onKeyDown],\n );\n\n const handleBlur = useCallback(\n (e) => {\n setFocus(false);\n onBlur(e);\n },\n [onBlur],\n );\n\n return (\n <DSTextBox\n {...rest}\n className={className}\n clearable={clearable}\n disabled={disabled}\n fluidWidth={fluidWidth}\n hasError={hasError}\n innerRef={(ref) => {\n inputRef.current = ref;\n if (innerRef) innerRef(ref);\n }}\n isActive={focus}\n leftComponent={leftComponent}\n maxLength={maxLength}\n minLength={minLength}\n name={name}\n onBlur={handleBlur}\n onChange={handleOnChange}\n onClick={onClick}\n onFocus={onFocus}\n onKeyDown={handleKeyDown}\n onKeyUp={onKeyUp}\n onPaste={onPaste}\n placeholder={placeholder}\n readOnly={readOnly}\n rightComponent={rightComponent}\n style={style}\n type={type}\n value={maskedValue}\n />\n );\n};\n\nexport { PhoneInternationalInputMask };\nexport default PhoneInternationalInputMask;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;A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AAO,cAAc,CAAC;AAE1B,oCAAgB,MAAM;AAEpB,YAAQ;AAAA,MACN,UAAU;AAAA,MACV,WAAW,eAAe;AAAA,MAC1B,aAAa,QAAQ;AAAA,MACrB,uBAAuB;AAAA,IACzB,CAAC;AAAA,EACH,GAAG,CAAC,OAAO,OAAO,eAAe,OAAO,CAAC;AAEzC,QAAM,oBAAgB;AAAA,IACpB,CAAC,MAAM;AACL,QAAE,gBAAgB;AAClB,iBAAW,EAAE,KAAK,EAAE,KAAK,MAAM,EAAE,QAAQ,CAAC;AAC1C,gBAAU,CAAC;AAAA,IACb;AAAA,IACA,CAAC,SAAS;AAAA,EACZ;AAEA,QAAM,iBAAa;AAAA,IACjB,CAAC,MAAM;AACL,eAAS,KAAK;AACd,aAAO,CAAC;AAAA,IACV;AAAA,IACA,CAAC,MAAM;AAAA,EACT;AAEA,SACE,4CAAC;AAAA,IACE,GAAG;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,CAAC,QAAQ;AACjB,eAAS,UAAU;AACnB,UAAI;AAAU,iBAAS,GAAG;AAAA,IAC5B;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,GACT;AAEJ;AAGA,IAAO,sCAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -102,11 +102,7 @@ const SsnInputMask = ({
|
|
|
102
102
|
const [maskedValue, setMaskedValue] = (0, import_react.useState)(value);
|
|
103
103
|
const conform = (0, import_react.useCallback)(
|
|
104
104
|
({ rawValue, cursorPos, lastkeycode, shouldUpdateCursorPos = true }) => {
|
|
105
|
-
const { nextMaskedValue, maskedPos } = conformValue(
|
|
106
|
-
rawValue,
|
|
107
|
-
cursorPos,
|
|
108
|
-
lastkeycode
|
|
109
|
-
);
|
|
105
|
+
const { nextMaskedValue, maskedPos } = conformValue(rawValue, cursorPos, lastkeycode);
|
|
110
106
|
const event = {
|
|
111
107
|
target: {
|
|
112
108
|
value: nextMaskedValue,
|