react-native-better-html 1.0.22 → 1.0.24
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/index.js +57 -43
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +57 -43
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -512,6 +512,8 @@ import { useTheme as useTheme2 } from "react-better-core";
|
|
|
512
512
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
513
513
|
var touchableHighlightStyleMoveToContent = [
|
|
514
514
|
"width",
|
|
515
|
+
"alignItems",
|
|
516
|
+
"justifyContent",
|
|
515
517
|
"backgroundColor",
|
|
516
518
|
"padding",
|
|
517
519
|
"paddingTop",
|
|
@@ -1775,7 +1777,7 @@ var InputFieldComponent = forwardRef(
|
|
|
1775
1777
|
const readyPaddingHorizontal = paddingHorizontal ?? theme2.styles.space;
|
|
1776
1778
|
const readyPaddingVertical = paddingVertical ? parseFloat(paddingVertical.toString()) : (theme2.styles.space + theme2.styles.gap) / 2;
|
|
1777
1779
|
const readyHeight = height ?? isIOSDateTime ? void 0 : borderWidth + readyPaddingVertical + lineHeight + readyPaddingVertical + borderWidth + (Platform5.OS === "android" ? 2 : 0);
|
|
1778
|
-
const
|
|
1780
|
+
const onValueChangeRNDateTimePicker = useCallback6(
|
|
1779
1781
|
(event, data) => {
|
|
1780
1782
|
setInternalDateValue(data);
|
|
1781
1783
|
onChange?.(data?.toISOString() ?? "");
|
|
@@ -1802,13 +1804,13 @@ var InputFieldComponent = forwardRef(
|
|
|
1802
1804
|
label: "Cancel",
|
|
1803
1805
|
textColor: theme2.colors.textSecondary
|
|
1804
1806
|
},
|
|
1805
|
-
|
|
1807
|
+
onValueChange: onValueChangeRNDateTimePicker
|
|
1806
1808
|
});
|
|
1807
1809
|
} else if (Platform5.OS === "ios") {
|
|
1808
1810
|
}
|
|
1809
1811
|
}
|
|
1810
1812
|
},
|
|
1811
|
-
[onPress, type, internalDateValue,
|
|
1813
|
+
[onPress, type, internalDateValue, onValueChangeRNDateTimePicker]
|
|
1812
1814
|
);
|
|
1813
1815
|
const onFocusElement = useCallback6((event) => {
|
|
1814
1816
|
setIsFocused.setTrue();
|
|
@@ -1874,19 +1876,16 @@ var InputFieldComponent = forwardRef(
|
|
|
1874
1876
|
type === "date" ? date : internalDateValue ? `${hours.length === 1 ? `0${hours}` : hours}:${minutes.length === 1 ? `0${minutes}` : minutes}` : ""
|
|
1875
1877
|
);
|
|
1876
1878
|
}, [internalDateValue]);
|
|
1877
|
-
useImperativeHandle(
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
return textInputRef.current;
|
|
1881
|
-
},
|
|
1882
|
-
[]
|
|
1883
|
-
);
|
|
1879
|
+
useImperativeHandle(ref, () => {
|
|
1880
|
+
return textInputRef.current;
|
|
1881
|
+
}, []);
|
|
1884
1882
|
const withPressInputField = !!onPress || type === "date" || type === "time";
|
|
1885
1883
|
const prefixSuffixBackgroundColor = colorTheme === "light" ? darkenColor(theme2.colors.backgroundContent, 0.03) : lightenColor(theme2.colors.backgroundContent, 0.1);
|
|
1886
1884
|
const labelComponent = label && /* @__PURE__ */ jsxs6(View_default, { isRow: true, alignItems: "center", gap: 2, children: [
|
|
1887
1885
|
/* @__PURE__ */ jsx12(Text_default, { fontSize: 14, color: isError ? theme2.colors.error : theme2.colors.textSecondary, children: label }),
|
|
1888
1886
|
required && /* @__PURE__ */ jsx12(Text_default, { color: theme2.colors.error, children: "*" })
|
|
1889
1887
|
] });
|
|
1888
|
+
const borderColor = isFocused ? theme2.colors.primary : isError ? theme2.colors.error : theme2.colors.border;
|
|
1890
1889
|
return /* @__PURE__ */ jsxs6(
|
|
1891
1890
|
Animate_default.View,
|
|
1892
1891
|
{
|
|
@@ -1898,10 +1897,11 @@ var InputFieldComponent = forwardRef(
|
|
|
1898
1897
|
children: [
|
|
1899
1898
|
isIOSDateTime && !iOSDateTimeFullSize ? void 0 : labelComponent,
|
|
1900
1899
|
/* @__PURE__ */ jsxs6(View_default, { isRow: true, position: "relative", alignItems: "center", height: readyHeight, children: [
|
|
1901
|
-
prefix && /* @__PURE__ */
|
|
1900
|
+
prefix && /* @__PURE__ */ jsxs6(
|
|
1902
1901
|
View_default,
|
|
1903
1902
|
{
|
|
1904
1903
|
isRow: true,
|
|
1904
|
+
position: "relative",
|
|
1905
1905
|
height: "100%",
|
|
1906
1906
|
backgroundColor: prefixSuffixBackgroundColor,
|
|
1907
1907
|
alignItems: "center",
|
|
@@ -1912,16 +1912,23 @@ var InputFieldComponent = forwardRef(
|
|
|
1912
1912
|
borderBottomLeftRadius: theme2.styles.borderRadius,
|
|
1913
1913
|
borderColor: theme2.colors.border,
|
|
1914
1914
|
paddingHorizontal: readyPaddingHorizontal,
|
|
1915
|
+
zIndex: 1,
|
|
1915
1916
|
onPress: onPressPrefix,
|
|
1916
|
-
children:
|
|
1917
|
-
Text_default,
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1917
|
+
children: [
|
|
1918
|
+
typeof prefix === "string" ? /* @__PURE__ */ jsx12(Text_default, { fontWeight: 700, lineHeight, children: prefix }) : prefix,
|
|
1919
|
+
/* @__PURE__ */ jsx12(
|
|
1920
|
+
Animate_default.View,
|
|
1921
|
+
{
|
|
1922
|
+
position: "absolute",
|
|
1923
|
+
top: 0,
|
|
1924
|
+
right: -1,
|
|
1925
|
+
width: 1,
|
|
1926
|
+
height: "100%",
|
|
1927
|
+
initialBackgroundColor: theme2.colors.border,
|
|
1928
|
+
animateBackgroundColor: borderColor
|
|
1929
|
+
}
|
|
1930
|
+
)
|
|
1931
|
+
]
|
|
1925
1932
|
}
|
|
1926
1933
|
),
|
|
1927
1934
|
isIOSDateTime ? /* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
@@ -1935,7 +1942,7 @@ var InputFieldComponent = forwardRef(
|
|
|
1935
1942
|
accentColor: theme2.colors.primary,
|
|
1936
1943
|
themeVariant: colorTheme === "dark" ? "dark" : "light",
|
|
1937
1944
|
style: rnDateTimePickerStyle,
|
|
1938
|
-
|
|
1945
|
+
onValueChange: onValueChangeRNDateTimePicker
|
|
1939
1946
|
}
|
|
1940
1947
|
)
|
|
1941
1948
|
] }) : /* @__PURE__ */ jsx12(
|
|
@@ -1956,13 +1963,15 @@ var InputFieldComponent = forwardRef(
|
|
|
1956
1963
|
flex: 1,
|
|
1957
1964
|
justifyContent: "center",
|
|
1958
1965
|
backgroundColor: theme2.colors.backgroundContent,
|
|
1959
|
-
borderTopLeftRadius: prefix ?
|
|
1960
|
-
borderBottomLeftRadius: prefix ?
|
|
1961
|
-
borderTopRightRadius: suffix ?
|
|
1962
|
-
borderBottomRightRadius: suffix ?
|
|
1966
|
+
borderTopLeftRadius: prefix ? 2 : theme2.styles.borderRadius,
|
|
1967
|
+
borderBottomLeftRadius: prefix ? 2 : theme2.styles.borderRadius,
|
|
1968
|
+
borderTopRightRadius: suffix ? 2 : theme2.styles.borderRadius,
|
|
1969
|
+
borderBottomRightRadius: suffix ? 2 : theme2.styles.borderRadius,
|
|
1963
1970
|
borderWidth,
|
|
1971
|
+
marginLeft: prefix ? -2 : 0,
|
|
1972
|
+
marginRight: suffix ? -2 : 0,
|
|
1964
1973
|
initialBorderColor: theme2.colors.border,
|
|
1965
|
-
animateBorderColor:
|
|
1974
|
+
animateBorderColor: borderColor,
|
|
1966
1975
|
overflow: "hidden",
|
|
1967
1976
|
children: [
|
|
1968
1977
|
leftIcon && /* @__PURE__ */ jsx12(
|
|
@@ -2029,29 +2038,38 @@ var InputFieldComponent = forwardRef(
|
|
|
2029
2038
|
)
|
|
2030
2039
|
}
|
|
2031
2040
|
),
|
|
2032
|
-
suffix && /* @__PURE__ */
|
|
2041
|
+
suffix && /* @__PURE__ */ jsxs6(
|
|
2033
2042
|
View_default,
|
|
2034
2043
|
{
|
|
2035
2044
|
isRow: true,
|
|
2045
|
+
position: "relative",
|
|
2036
2046
|
height: "100%",
|
|
2037
2047
|
backgroundColor: prefixSuffixBackgroundColor,
|
|
2038
2048
|
alignItems: "center",
|
|
2049
|
+
justifyContent: "center",
|
|
2039
2050
|
borderWidth,
|
|
2040
2051
|
borderLeftWidth: 0,
|
|
2041
2052
|
borderTopRightRadius: theme2.styles.borderRadius,
|
|
2042
2053
|
borderBottomRightRadius: theme2.styles.borderRadius,
|
|
2043
2054
|
borderColor: theme2.colors.border,
|
|
2044
2055
|
paddingHorizontal: readyPaddingHorizontal,
|
|
2056
|
+
zIndex: 1,
|
|
2045
2057
|
onPress: onPressSuffix,
|
|
2046
|
-
children:
|
|
2047
|
-
Text_default,
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2058
|
+
children: [
|
|
2059
|
+
typeof suffix === "string" ? /* @__PURE__ */ jsx12(Text_default, { fontWeight: 700, lineHeight, children: suffix }) : suffix,
|
|
2060
|
+
/* @__PURE__ */ jsx12(
|
|
2061
|
+
Animate_default.View,
|
|
2062
|
+
{
|
|
2063
|
+
position: "absolute",
|
|
2064
|
+
top: 0,
|
|
2065
|
+
left: -1,
|
|
2066
|
+
width: 1,
|
|
2067
|
+
height: "100%",
|
|
2068
|
+
initialBackgroundColor: theme2.colors.border,
|
|
2069
|
+
animateBackgroundColor: borderColor
|
|
2070
|
+
}
|
|
2071
|
+
)
|
|
2072
|
+
]
|
|
2055
2073
|
}
|
|
2056
2074
|
)
|
|
2057
2075
|
] }),
|
|
@@ -2105,13 +2123,9 @@ InputFieldComponent.password = forwardRef(function Password(props, ref) {
|
|
|
2105
2123
|
setShowPassword.toggle();
|
|
2106
2124
|
inputFieldRef.current?.focus();
|
|
2107
2125
|
}, []);
|
|
2108
|
-
useImperativeHandle(
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
return inputFieldRef.current;
|
|
2112
|
-
},
|
|
2113
|
-
[]
|
|
2114
|
-
);
|
|
2126
|
+
useImperativeHandle(ref, () => {
|
|
2127
|
+
return inputFieldRef.current;
|
|
2128
|
+
}, []);
|
|
2115
2129
|
return /* @__PURE__ */ jsx12(
|
|
2116
2130
|
InputFieldComponent,
|
|
2117
2131
|
{
|