@trackunit/react-form-components 0.1.125 → 0.2.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/index.cjs.js +10 -3
- package/index.esm.js +10 -3
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -2019,8 +2019,11 @@ const useCustomComponents = ({ componentsProps, disabled, readOnly, refMenuIsEna
|
|
|
2019
2019
|
...props.innerProps,
|
|
2020
2020
|
onScroll: e => {
|
|
2021
2021
|
const listEl = e.currentTarget;
|
|
2022
|
-
if (listEl.scrollTop + listEl.clientHeight >= listEl.scrollHeight
|
|
2023
|
-
props.selectProps.onMenuScrollToBottom
|
|
2022
|
+
if (listEl.scrollTop + listEl.clientHeight >= listEl.scrollHeight &&
|
|
2023
|
+
props.selectProps.onMenuScrollToBottom) {
|
|
2024
|
+
/Firefox/.test(navigator.userAgent)
|
|
2025
|
+
? props.selectProps.onMenuScrollToBottom(new WheelEvent("scroll"))
|
|
2026
|
+
: props.selectProps.onMenuScrollToBottom(new TouchEvent(""));
|
|
2024
2027
|
}
|
|
2025
2028
|
},
|
|
2026
2029
|
}, children: props.children }));
|
|
@@ -2745,7 +2748,11 @@ const useGetPhoneValidationRules = () => {
|
|
|
2745
2748
|
const pattern = {
|
|
2746
2749
|
...defaultRules,
|
|
2747
2750
|
validate: (value) => {
|
|
2748
|
-
const
|
|
2751
|
+
const errorMessage = validatePhoneNumber(value);
|
|
2752
|
+
if (!errorMessage) {
|
|
2753
|
+
return true;
|
|
2754
|
+
}
|
|
2755
|
+
const validationResult = t(`phoneField.error.${errorMessage}`);
|
|
2749
2756
|
return !validationResult || !value || validationResult;
|
|
2750
2757
|
},
|
|
2751
2758
|
};
|
package/index.esm.js
CHANGED
|
@@ -2000,8 +2000,11 @@ const useCustomComponents = ({ componentsProps, disabled, readOnly, refMenuIsEna
|
|
|
2000
2000
|
...props.innerProps,
|
|
2001
2001
|
onScroll: e => {
|
|
2002
2002
|
const listEl = e.currentTarget;
|
|
2003
|
-
if (listEl.scrollTop + listEl.clientHeight >= listEl.scrollHeight
|
|
2004
|
-
props.selectProps.onMenuScrollToBottom
|
|
2003
|
+
if (listEl.scrollTop + listEl.clientHeight >= listEl.scrollHeight &&
|
|
2004
|
+
props.selectProps.onMenuScrollToBottom) {
|
|
2005
|
+
/Firefox/.test(navigator.userAgent)
|
|
2006
|
+
? props.selectProps.onMenuScrollToBottom(new WheelEvent("scroll"))
|
|
2007
|
+
: props.selectProps.onMenuScrollToBottom(new TouchEvent(""));
|
|
2005
2008
|
}
|
|
2006
2009
|
},
|
|
2007
2010
|
}, children: props.children }));
|
|
@@ -2726,7 +2729,11 @@ const useGetPhoneValidationRules = () => {
|
|
|
2726
2729
|
const pattern = {
|
|
2727
2730
|
...defaultRules,
|
|
2728
2731
|
validate: (value) => {
|
|
2729
|
-
const
|
|
2732
|
+
const errorMessage = validatePhoneNumber(value);
|
|
2733
|
+
if (!errorMessage) {
|
|
2734
|
+
return true;
|
|
2735
|
+
}
|
|
2736
|
+
const validationResult = t(`phoneField.error.${errorMessage}`);
|
|
2730
2737
|
return !validationResult || !value || validationResult;
|
|
2731
2738
|
},
|
|
2732
2739
|
};
|