react-native-better-html 1.0.24 → 1.0.26
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.d.mts +32 -6
- package/dist/index.d.ts +32 -6
- package/dist/index.js +257 -129
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +208 -82
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -33,9 +33,11 @@ __export(index_exports, {
|
|
|
33
33
|
Animate: () => Animate_default,
|
|
34
34
|
BetterComponentsProvider: () => BetterComponentsProvider_default,
|
|
35
35
|
Button: () => Button_default,
|
|
36
|
+
CheckBox: () => CheckBox_default,
|
|
36
37
|
Icon: () => Icon_default,
|
|
37
38
|
Image: () => Image_default,
|
|
38
39
|
InputField: () => InputField_default,
|
|
40
|
+
Label: () => Label_default,
|
|
39
41
|
ListItem: () => ListItem_default,
|
|
40
42
|
Loader: () => Loader_default,
|
|
41
43
|
ScreenHolder: () => ScreenHolder_default,
|
|
@@ -46,38 +48,38 @@ __export(index_exports, {
|
|
|
46
48
|
alertControls: () => alertControls,
|
|
47
49
|
alertsPlugin: () => alertsPlugin,
|
|
48
50
|
asyncStoragePlugin: () => asyncStoragePlugin,
|
|
49
|
-
colorThemeControls: () =>
|
|
50
|
-
countries: () =>
|
|
51
|
-
darkenColor: () =>
|
|
51
|
+
colorThemeControls: () => import_react_better_core19.colorThemeControls,
|
|
52
|
+
countries: () => import_react_better_core19.countries,
|
|
53
|
+
darkenColor: () => import_react_better_core19.darkenColor,
|
|
52
54
|
defaultAlertsPluginOptions: () => defaultAlertsPluginOptions,
|
|
53
55
|
defaultAsyncStoragePluginOptions: () => defaultAsyncStoragePluginOptions,
|
|
54
|
-
desaturateColor: () =>
|
|
55
|
-
eventPreventDefault: () =>
|
|
56
|
-
eventPreventStop: () =>
|
|
57
|
-
eventStopPropagation: () =>
|
|
58
|
-
formatPhoneNumber: () =>
|
|
56
|
+
desaturateColor: () => import_react_better_core19.desaturateColor,
|
|
57
|
+
eventPreventDefault: () => import_react_better_core19.eventPreventDefault,
|
|
58
|
+
eventPreventStop: () => import_react_better_core19.eventPreventStop,
|
|
59
|
+
eventStopPropagation: () => import_react_better_core19.eventStopPropagation,
|
|
60
|
+
formatPhoneNumber: () => import_react_better_core19.formatPhoneNumber,
|
|
59
61
|
generateAsyncStorage: () => generateAsyncStorage,
|
|
60
|
-
generateRandomString: () =>
|
|
62
|
+
generateRandomString: () => import_react_better_core19.generateRandomString,
|
|
61
63
|
getFormErrorObject: () => getFormErrorObject,
|
|
62
|
-
getPluralWord: () =>
|
|
63
|
-
lightenColor: () =>
|
|
64
|
-
loaderControls: () =>
|
|
64
|
+
getPluralWord: () => import_react_better_core19.getPluralWord,
|
|
65
|
+
lightenColor: () => import_react_better_core19.lightenColor,
|
|
66
|
+
loaderControls: () => import_react_better_core19.loaderControls,
|
|
65
67
|
pressStrength: () => pressStrength,
|
|
66
|
-
saturateColor: () =>
|
|
68
|
+
saturateColor: () => import_react_better_core19.saturateColor,
|
|
67
69
|
useAlertControls: () => useAlertControls,
|
|
68
70
|
useBetterComponentsContext: () => useBetterComponentsContext,
|
|
69
|
-
useBooleanState: () =>
|
|
70
|
-
useDebounceState: () =>
|
|
71
|
+
useBooleanState: () => import_react_better_core19.useBooleanState,
|
|
72
|
+
useDebounceState: () => import_react_better_core19.useDebounceState,
|
|
71
73
|
useDevice: () => useDevice,
|
|
72
74
|
useEventEmitter: () => useEventEmitter,
|
|
73
75
|
useForm: () => useForm,
|
|
74
76
|
useKeyboard: () => useKeyboard,
|
|
75
|
-
useLoader: () =>
|
|
76
|
-
useLoaderControls: () =>
|
|
77
|
-
useTheme: () =>
|
|
77
|
+
useLoader: () => import_react_better_core19.useLoader,
|
|
78
|
+
useLoaderControls: () => import_react_better_core19.useLoaderControls,
|
|
79
|
+
useTheme: () => import_react_better_core19.useTheme
|
|
78
80
|
});
|
|
79
81
|
module.exports = __toCommonJS(index_exports);
|
|
80
|
-
var
|
|
82
|
+
var import_react_better_core19 = require("react-better-core");
|
|
81
83
|
|
|
82
84
|
// src/components/BetterComponentsProvider.tsx
|
|
83
85
|
var import_react12 = require("react");
|
|
@@ -507,6 +509,22 @@ function useForm(options) {
|
|
|
507
509
|
},
|
|
508
510
|
[values, setFieldValue]
|
|
509
511
|
);
|
|
512
|
+
const getCheckBoxProps = (0, import_react.useCallback)(
|
|
513
|
+
(field, insideListItem) => {
|
|
514
|
+
return insideListItem ? {
|
|
515
|
+
checkBoxIsChecked: values[field],
|
|
516
|
+
checkBoxOnChange: (value) => {
|
|
517
|
+
setFieldValue(field, value);
|
|
518
|
+
}
|
|
519
|
+
} : {
|
|
520
|
+
isChecked: values[field],
|
|
521
|
+
onChange: (value) => {
|
|
522
|
+
setFieldValue(field, value);
|
|
523
|
+
}
|
|
524
|
+
};
|
|
525
|
+
},
|
|
526
|
+
[values, setFieldValue]
|
|
527
|
+
);
|
|
510
528
|
const reset = (0, import_react.useCallback)(() => {
|
|
511
529
|
setValues(defaultValues);
|
|
512
530
|
setErrors({});
|
|
@@ -531,6 +549,7 @@ function useForm(options) {
|
|
|
531
549
|
setFieldsValue,
|
|
532
550
|
getInputFieldProps,
|
|
533
551
|
getSwitchProps,
|
|
552
|
+
getCheckBoxProps,
|
|
534
553
|
focusField,
|
|
535
554
|
inputFieldRefs: inputFieldRefs.current,
|
|
536
555
|
validate: validateForm,
|
|
@@ -1629,11 +1648,24 @@ function generateAsyncStorage() {
|
|
|
1629
1648
|
};
|
|
1630
1649
|
}
|
|
1631
1650
|
|
|
1632
|
-
// src/components/
|
|
1651
|
+
// src/components/Label.tsx
|
|
1633
1652
|
var import_react13 = require("react");
|
|
1634
|
-
var import_react_native8 = require("react-native");
|
|
1635
1653
|
var import_react_better_core12 = require("react-better-core");
|
|
1636
1654
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1655
|
+
function Label({ text, required, isError }) {
|
|
1656
|
+
const theme2 = (0, import_react_better_core12.useTheme)();
|
|
1657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(View_default, { isRow: true, alignItems: "center", gap: 2, children: [
|
|
1658
|
+
text && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text_default, { fontSize: 14, color: isError ? theme2.colors.error : theme2.colors.textSecondary, children: text }),
|
|
1659
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text_default, { color: theme2.colors.error, children: "*" })
|
|
1660
|
+
] });
|
|
1661
|
+
}
|
|
1662
|
+
var Label_default = (0, import_react13.memo)(Label);
|
|
1663
|
+
|
|
1664
|
+
// src/components/ScreenHolder.tsx
|
|
1665
|
+
var import_react14 = require("react");
|
|
1666
|
+
var import_react_native8 = require("react-native");
|
|
1667
|
+
var import_react_better_core13 = require("react-better-core");
|
|
1668
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1637
1669
|
var ScreenHolderComponent = ({
|
|
1638
1670
|
noScroll,
|
|
1639
1671
|
noSideSpace,
|
|
@@ -1651,17 +1683,17 @@ var ScreenHolderComponent = ({
|
|
|
1651
1683
|
withNoHeader,
|
|
1652
1684
|
children
|
|
1653
1685
|
}) => {
|
|
1654
|
-
const theme2 = (0,
|
|
1686
|
+
const theme2 = (0, import_react_better_core13.useTheme)();
|
|
1655
1687
|
const device = useDevice();
|
|
1656
1688
|
const keyboard = useKeyboard();
|
|
1657
|
-
const [isRefreshing, setIsRefreshing] = (0,
|
|
1658
|
-
const keyboardAvoidingViewStyle = (0,
|
|
1689
|
+
const [isRefreshing, setIsRefreshing] = (0, import_react_better_core13.useBooleanState)();
|
|
1690
|
+
const keyboardAvoidingViewStyle = (0, import_react14.useMemo)(
|
|
1659
1691
|
() => ({
|
|
1660
1692
|
flex: 1
|
|
1661
1693
|
}),
|
|
1662
1694
|
[]
|
|
1663
1695
|
);
|
|
1664
|
-
const onRefreshElement = (0,
|
|
1696
|
+
const onRefreshElement = (0, import_react14.useCallback)(() => {
|
|
1665
1697
|
setIsRefreshing.setTrue();
|
|
1666
1698
|
onRefresh?.();
|
|
1667
1699
|
setTimeout(() => {
|
|
@@ -1669,7 +1701,7 @@ var ScreenHolderComponent = ({
|
|
|
1669
1701
|
onRefreshEnd?.();
|
|
1670
1702
|
}, refreshTimeout * 1e3);
|
|
1671
1703
|
}, [onRefresh, onRefreshEnd, refreshTimeout]);
|
|
1672
|
-
const content = /* @__PURE__ */ (0,
|
|
1704
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1673
1705
|
View_default,
|
|
1674
1706
|
{
|
|
1675
1707
|
flex: 1,
|
|
@@ -1680,21 +1712,21 @@ var ScreenHolderComponent = ({
|
|
|
1680
1712
|
}
|
|
1681
1713
|
);
|
|
1682
1714
|
const withRefresh = onRefresh || onRefreshEnd;
|
|
1683
|
-
return /* @__PURE__ */ (0,
|
|
1715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(View_default, { flex: 1, backgroundColor: backgroundColor ?? theme2.colors.backgroundBase, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1684
1716
|
import_react_native8.KeyboardAvoidingView,
|
|
1685
1717
|
{
|
|
1686
1718
|
style: keyboardAvoidingViewStyle,
|
|
1687
1719
|
keyboardVerticalOffset: keyboardVerticalOffset ?? (withNoHeader ? import_react_native8.Platform.OS === "ios" ? 0 : theme2.styles.gap : keepFooterOnKeyboardOpened ? import_react_native8.Platform.OS === "ios" ? device.safeArea.afterCalculations.bottom : theme2.styles.gap : void 0),
|
|
1688
1720
|
behavior: import_react_native8.Platform.OS === "ios" ? "padding" : "height",
|
|
1689
1721
|
children: [
|
|
1690
|
-
/* @__PURE__ */ (0,
|
|
1722
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(View_default, { flex: 1, children: noScroll ? content : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1691
1723
|
import_react_native8.ScrollView,
|
|
1692
1724
|
{
|
|
1693
|
-
refreshControl: withRefresh ? /* @__PURE__ */ (0,
|
|
1725
|
+
refreshControl: withRefresh ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native8.RefreshControl, { refreshing: isRefreshing, onRefresh: onRefreshElement }) : void 0,
|
|
1694
1726
|
children: content
|
|
1695
1727
|
}
|
|
1696
1728
|
) }),
|
|
1697
|
-
keepFooterOnKeyboardOpened || (import_react_native8.Platform.OS === "ios" ? !keyboard.willOpen : !keyboard.isOpened) ? footer && /* @__PURE__ */ (0,
|
|
1729
|
+
keepFooterOnKeyboardOpened || (import_react_native8.Platform.OS === "ios" ? !keyboard.willOpen : !keyboard.isOpened) ? footer && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(View_default, { children: footer }) : !withNoHeader && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1698
1730
|
View_default,
|
|
1699
1731
|
{
|
|
1700
1732
|
width: "100%",
|
|
@@ -1712,10 +1744,10 @@ ScreenHolderComponent.footer = function Footer({
|
|
|
1712
1744
|
withNoHeader,
|
|
1713
1745
|
children
|
|
1714
1746
|
}) {
|
|
1715
|
-
const theme2 = (0,
|
|
1747
|
+
const theme2 = (0, import_react_better_core13.useTheme)();
|
|
1716
1748
|
const device = useDevice();
|
|
1717
1749
|
const keyboard = useKeyboard();
|
|
1718
|
-
return /* @__PURE__ */ (0,
|
|
1750
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1719
1751
|
View_default,
|
|
1720
1752
|
{
|
|
1721
1753
|
backgroundColor: backgroundColor ?? theme2.colors.backgroundBase,
|
|
@@ -1726,17 +1758,17 @@ ScreenHolderComponent.footer = function Footer({
|
|
|
1726
1758
|
}
|
|
1727
1759
|
);
|
|
1728
1760
|
};
|
|
1729
|
-
var ScreenHolder = (0,
|
|
1761
|
+
var ScreenHolder = (0, import_react14.memo)(ScreenHolderComponent);
|
|
1730
1762
|
ScreenHolder.footer = ScreenHolderComponent.footer;
|
|
1731
1763
|
var ScreenHolder_default = ScreenHolder;
|
|
1732
1764
|
|
|
1733
1765
|
// src/components/InputField.tsx
|
|
1734
|
-
var
|
|
1766
|
+
var import_react15 = require("react");
|
|
1735
1767
|
var import_react_native9 = require("react-native");
|
|
1736
1768
|
var import_datetimepicker = __toESM(require("@react-native-community/datetimepicker"));
|
|
1737
|
-
var
|
|
1738
|
-
var
|
|
1739
|
-
var InputFieldComponent = (0,
|
|
1769
|
+
var import_react_better_core14 = require("react-better-core");
|
|
1770
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1771
|
+
var InputFieldComponent = (0, import_react15.forwardRef)(
|
|
1740
1772
|
({
|
|
1741
1773
|
flex,
|
|
1742
1774
|
placeholder,
|
|
@@ -1787,12 +1819,12 @@ var InputFieldComponent = (0, import_react14.forwardRef)(
|
|
|
1787
1819
|
onPressEnter,
|
|
1788
1820
|
...props
|
|
1789
1821
|
}, ref) => {
|
|
1790
|
-
const theme2 = (0,
|
|
1791
|
-
const { colorTheme } = (0,
|
|
1792
|
-
const textInputRef = (0,
|
|
1793
|
-
const [internalValue, setInternalValue] = (0,
|
|
1794
|
-
const [internalDateValue, setInternalDateValue] = (0,
|
|
1795
|
-
const [isFocused, setIsFocused] = (0,
|
|
1822
|
+
const theme2 = (0, import_react_better_core14.useTheme)();
|
|
1823
|
+
const { colorTheme } = (0, import_react_better_core14.useBetterCoreContext)();
|
|
1824
|
+
const textInputRef = (0, import_react15.useRef)(null);
|
|
1825
|
+
const [internalValue, setInternalValue] = (0, import_react15.useState)(value?.toString() || defaultValue || "");
|
|
1826
|
+
const [internalDateValue, setInternalDateValue] = (0, import_react15.useState)();
|
|
1827
|
+
const [isFocused, setIsFocused] = (0, import_react_better_core14.useBooleanState)();
|
|
1796
1828
|
const isIOSDateTime = import_react_native9.Platform.OS === "ios" && (type === "date" || type === "time");
|
|
1797
1829
|
const iconSize = 16;
|
|
1798
1830
|
const iconPadding = onPressRightIcon ? theme2.styles.gap : 0;
|
|
@@ -1801,14 +1833,14 @@ var InputFieldComponent = (0, import_react14.forwardRef)(
|
|
|
1801
1833
|
const readyPaddingHorizontal = paddingHorizontal ?? theme2.styles.space;
|
|
1802
1834
|
const readyPaddingVertical = paddingVertical ? parseFloat(paddingVertical.toString()) : (theme2.styles.space + theme2.styles.gap) / 2;
|
|
1803
1835
|
const readyHeight = height ?? isIOSDateTime ? void 0 : borderWidth + readyPaddingVertical + lineHeight + readyPaddingVertical + borderWidth + (import_react_native9.Platform.OS === "android" ? 2 : 0);
|
|
1804
|
-
const onValueChangeRNDateTimePicker = (0,
|
|
1836
|
+
const onValueChangeRNDateTimePicker = (0, import_react15.useCallback)(
|
|
1805
1837
|
(event, data) => {
|
|
1806
1838
|
setInternalDateValue(data);
|
|
1807
1839
|
onChange?.(data?.toISOString() ?? "");
|
|
1808
1840
|
},
|
|
1809
1841
|
[onChange]
|
|
1810
1842
|
);
|
|
1811
|
-
const onPressInputField = (0,
|
|
1843
|
+
const onPressInputField = (0, import_react15.useCallback)(
|
|
1812
1844
|
(event) => {
|
|
1813
1845
|
onPress?.(event);
|
|
1814
1846
|
if (type === "date" || type === "time") {
|
|
@@ -1836,22 +1868,22 @@ var InputFieldComponent = (0, import_react14.forwardRef)(
|
|
|
1836
1868
|
},
|
|
1837
1869
|
[onPress, type, internalDateValue, onValueChangeRNDateTimePicker]
|
|
1838
1870
|
);
|
|
1839
|
-
const onFocusElement = (0,
|
|
1871
|
+
const onFocusElement = (0, import_react15.useCallback)((event) => {
|
|
1840
1872
|
setIsFocused.setTrue();
|
|
1841
1873
|
onFocus?.(event);
|
|
1842
1874
|
}, []);
|
|
1843
|
-
const onBlurElement = (0,
|
|
1875
|
+
const onBlurElement = (0, import_react15.useCallback)((event) => {
|
|
1844
1876
|
setIsFocused.setFalse();
|
|
1845
1877
|
onBlur?.(event);
|
|
1846
1878
|
}, []);
|
|
1847
|
-
const onChangeText = (0,
|
|
1879
|
+
const onChangeText = (0, import_react15.useCallback)(
|
|
1848
1880
|
(text) => {
|
|
1849
1881
|
setInternalValue(text);
|
|
1850
1882
|
onChange?.(text);
|
|
1851
1883
|
},
|
|
1852
1884
|
[onChange]
|
|
1853
1885
|
);
|
|
1854
|
-
const textInputStyle = (0,
|
|
1886
|
+
const textInputStyle = (0, import_react15.useMemo)(
|
|
1855
1887
|
() => ({
|
|
1856
1888
|
flex: 1,
|
|
1857
1889
|
fontSize,
|
|
@@ -1876,14 +1908,14 @@ var InputFieldComponent = (0, import_react14.forwardRef)(
|
|
|
1876
1908
|
rightIcon
|
|
1877
1909
|
]
|
|
1878
1910
|
);
|
|
1879
|
-
const rnDateTimePickerStyle = (0,
|
|
1911
|
+
const rnDateTimePickerStyle = (0, import_react15.useMemo)(
|
|
1880
1912
|
() => ({
|
|
1881
1913
|
flex: iOSDateTimeFullSize ? 1 : void 0,
|
|
1882
1914
|
marginLeft: -8 + (iOSDateTimeFullSize ? 0 : theme2.styles.space)
|
|
1883
1915
|
}),
|
|
1884
1916
|
[iOSDateTimeFullSize]
|
|
1885
1917
|
);
|
|
1886
|
-
(0,
|
|
1918
|
+
(0, import_react15.useEffect)(() => {
|
|
1887
1919
|
if (value === void 0) return;
|
|
1888
1920
|
setInternalValue(value.toString());
|
|
1889
1921
|
try {
|
|
@@ -1891,7 +1923,7 @@ var InputFieldComponent = (0, import_react14.forwardRef)(
|
|
|
1891
1923
|
} catch (error) {
|
|
1892
1924
|
}
|
|
1893
1925
|
}, [value]);
|
|
1894
|
-
(0,
|
|
1926
|
+
(0, import_react15.useEffect)(() => {
|
|
1895
1927
|
if (type !== "date" && type !== "time") return;
|
|
1896
1928
|
const date = internalDateValue?.toISOString().split("T")[0] ?? "";
|
|
1897
1929
|
const hours = internalDateValue ? internalDateValue.getHours().toString() : "00";
|
|
@@ -1900,17 +1932,14 @@ var InputFieldComponent = (0, import_react14.forwardRef)(
|
|
|
1900
1932
|
type === "date" ? date : internalDateValue ? `${hours.length === 1 ? `0${hours}` : hours}:${minutes.length === 1 ? `0${minutes}` : minutes}` : ""
|
|
1901
1933
|
);
|
|
1902
1934
|
}, [internalDateValue]);
|
|
1903
|
-
(0,
|
|
1935
|
+
(0, import_react15.useImperativeHandle)(ref, () => {
|
|
1904
1936
|
return textInputRef.current;
|
|
1905
1937
|
}, []);
|
|
1906
1938
|
const withPressInputField = !!onPress || type === "date" || type === "time";
|
|
1907
|
-
const prefixSuffixBackgroundColor = colorTheme === "light" ? (0,
|
|
1908
|
-
const labelComponent = label
|
|
1909
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text_default, { fontSize: 14, color: isError ? theme2.colors.error : theme2.colors.textSecondary, children: label }),
|
|
1910
|
-
required && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text_default, { color: theme2.colors.error, children: "*" })
|
|
1911
|
-
] });
|
|
1939
|
+
const prefixSuffixBackgroundColor = colorTheme === "light" ? (0, import_react_better_core14.darkenColor)(theme2.colors.backgroundContent, 0.03) : (0, import_react_better_core14.lightenColor)(theme2.colors.backgroundContent, 0.1);
|
|
1940
|
+
const labelComponent = label ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Label_default, { text: label, isError, required }) : void 0;
|
|
1912
1941
|
const borderColor = isFocused ? theme2.colors.primary : isError ? theme2.colors.error : theme2.colors.border;
|
|
1913
|
-
return /* @__PURE__ */ (0,
|
|
1942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1914
1943
|
Animate_default.View,
|
|
1915
1944
|
{
|
|
1916
1945
|
flex,
|
|
@@ -1920,8 +1949,8 @@ var InputFieldComponent = (0, import_react14.forwardRef)(
|
|
|
1920
1949
|
...props,
|
|
1921
1950
|
children: [
|
|
1922
1951
|
isIOSDateTime && !iOSDateTimeFullSize ? void 0 : labelComponent,
|
|
1923
|
-
/* @__PURE__ */ (0,
|
|
1924
|
-
prefix && /* @__PURE__ */ (0,
|
|
1952
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(View_default, { isRow: true, position: "relative", alignItems: "center", height: readyHeight, children: [
|
|
1953
|
+
prefix && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1925
1954
|
View_default,
|
|
1926
1955
|
{
|
|
1927
1956
|
isRow: true,
|
|
@@ -1939,8 +1968,8 @@ var InputFieldComponent = (0, import_react14.forwardRef)(
|
|
|
1939
1968
|
zIndex: 1,
|
|
1940
1969
|
onPress: onPressPrefix,
|
|
1941
1970
|
children: [
|
|
1942
|
-
typeof prefix === "string" ? /* @__PURE__ */ (0,
|
|
1943
|
-
/* @__PURE__ */ (0,
|
|
1971
|
+
typeof prefix === "string" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text_default, { fontWeight: 700, lineHeight, children: prefix }) : prefix,
|
|
1972
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1944
1973
|
Animate_default.View,
|
|
1945
1974
|
{
|
|
1946
1975
|
position: "absolute",
|
|
@@ -1955,9 +1984,9 @@ var InputFieldComponent = (0, import_react14.forwardRef)(
|
|
|
1955
1984
|
]
|
|
1956
1985
|
}
|
|
1957
1986
|
),
|
|
1958
|
-
isIOSDateTime ? /* @__PURE__ */ (0,
|
|
1987
|
+
isIOSDateTime ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1959
1988
|
!iOSDateTimeFullSize ? labelComponent : void 0,
|
|
1960
|
-
/* @__PURE__ */ (0,
|
|
1989
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1961
1990
|
import_datetimepicker.default,
|
|
1962
1991
|
{
|
|
1963
1992
|
value: internalDateValue ?? /* @__PURE__ */ new Date(),
|
|
@@ -1969,7 +1998,7 @@ var InputFieldComponent = (0, import_react14.forwardRef)(
|
|
|
1969
1998
|
onValueChange: onValueChangeRNDateTimePicker
|
|
1970
1999
|
}
|
|
1971
2000
|
)
|
|
1972
|
-
] }) : /* @__PURE__ */ (0,
|
|
2001
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1973
2002
|
View_default,
|
|
1974
2003
|
{
|
|
1975
2004
|
flex: 1,
|
|
@@ -1980,7 +2009,7 @@ var InputFieldComponent = (0, import_react14.forwardRef)(
|
|
|
1980
2009
|
borderBottomRightRadius: suffix ? 0 : theme2.styles.borderRadius,
|
|
1981
2010
|
pressStrength: 1,
|
|
1982
2011
|
onPress: import_react_native9.Platform.OS === "android" ? editable === false || withPressInputField ? onPressInputField : void 0 : void 0,
|
|
1983
|
-
children: /* @__PURE__ */ (0,
|
|
2012
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1984
2013
|
Animate_default.View,
|
|
1985
2014
|
{
|
|
1986
2015
|
position: "relative",
|
|
@@ -1998,7 +2027,7 @@ var InputFieldComponent = (0, import_react14.forwardRef)(
|
|
|
1998
2027
|
animateBorderColor: borderColor,
|
|
1999
2028
|
overflow: "hidden",
|
|
2000
2029
|
children: [
|
|
2001
|
-
leftIcon && /* @__PURE__ */ (0,
|
|
2030
|
+
leftIcon && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2002
2031
|
Icon_default,
|
|
2003
2032
|
{
|
|
2004
2033
|
position: "absolute",
|
|
@@ -2011,7 +2040,7 @@ var InputFieldComponent = (0, import_react14.forwardRef)(
|
|
|
2011
2040
|
onPress: onPressLeftIcon
|
|
2012
2041
|
}
|
|
2013
2042
|
),
|
|
2014
|
-
/* @__PURE__ */ (0,
|
|
2043
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2015
2044
|
import_react_native9.TextInput,
|
|
2016
2045
|
{
|
|
2017
2046
|
style: textInputStyle,
|
|
@@ -2044,7 +2073,7 @@ var InputFieldComponent = (0, import_react14.forwardRef)(
|
|
|
2044
2073
|
ref: textInputRef
|
|
2045
2074
|
}
|
|
2046
2075
|
),
|
|
2047
|
-
rightIcon && /* @__PURE__ */ (0,
|
|
2076
|
+
rightIcon && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2048
2077
|
Icon_default,
|
|
2049
2078
|
{
|
|
2050
2079
|
position: "absolute",
|
|
@@ -2062,7 +2091,7 @@ var InputFieldComponent = (0, import_react14.forwardRef)(
|
|
|
2062
2091
|
)
|
|
2063
2092
|
}
|
|
2064
2093
|
),
|
|
2065
|
-
suffix && /* @__PURE__ */ (0,
|
|
2094
|
+
suffix && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
2066
2095
|
View_default,
|
|
2067
2096
|
{
|
|
2068
2097
|
isRow: true,
|
|
@@ -2080,8 +2109,8 @@ var InputFieldComponent = (0, import_react14.forwardRef)(
|
|
|
2080
2109
|
zIndex: 1,
|
|
2081
2110
|
onPress: onPressSuffix,
|
|
2082
2111
|
children: [
|
|
2083
|
-
typeof suffix === "string" ? /* @__PURE__ */ (0,
|
|
2084
|
-
/* @__PURE__ */ (0,
|
|
2112
|
+
typeof suffix === "string" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text_default, { fontWeight: 700, lineHeight, children: suffix }) : suffix,
|
|
2113
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2085
2114
|
Animate_default.View,
|
|
2086
2115
|
{
|
|
2087
2116
|
position: "absolute",
|
|
@@ -2097,7 +2126,7 @@ var InputFieldComponent = (0, import_react14.forwardRef)(
|
|
|
2097
2126
|
}
|
|
2098
2127
|
)
|
|
2099
2128
|
] }),
|
|
2100
|
-
infoMessage && /* @__PURE__ */ (0,
|
|
2129
|
+
infoMessage && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2101
2130
|
Animate_default.Text,
|
|
2102
2131
|
{
|
|
2103
2132
|
fontSize: 14,
|
|
@@ -2109,7 +2138,7 @@ var InputFieldComponent = (0, import_react14.forwardRef)(
|
|
|
2109
2138
|
children: infoMessage
|
|
2110
2139
|
}
|
|
2111
2140
|
),
|
|
2112
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
2141
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2113
2142
|
Animate_default.Text,
|
|
2114
2143
|
{
|
|
2115
2144
|
fontSize: 14,
|
|
@@ -2126,8 +2155,8 @@ var InputFieldComponent = (0, import_react14.forwardRef)(
|
|
|
2126
2155
|
);
|
|
2127
2156
|
}
|
|
2128
2157
|
);
|
|
2129
|
-
InputFieldComponent.email = (0,
|
|
2130
|
-
return /* @__PURE__ */ (0,
|
|
2158
|
+
InputFieldComponent.email = (0, import_react15.forwardRef)(function Email(props, ref) {
|
|
2159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2131
2160
|
InputFieldComponent,
|
|
2132
2161
|
{
|
|
2133
2162
|
placeholder: "your@email.here",
|
|
@@ -2140,17 +2169,17 @@ InputFieldComponent.email = (0, import_react14.forwardRef)(function Email(props,
|
|
|
2140
2169
|
}
|
|
2141
2170
|
);
|
|
2142
2171
|
});
|
|
2143
|
-
InputFieldComponent.password = (0,
|
|
2144
|
-
const inputFieldRef = (0,
|
|
2145
|
-
const [showPassword, setShowPassword] = (0,
|
|
2146
|
-
const onPressEye = (0,
|
|
2172
|
+
InputFieldComponent.password = (0, import_react15.forwardRef)(function Password(props, ref) {
|
|
2173
|
+
const inputFieldRef = (0, import_react15.useRef)(null);
|
|
2174
|
+
const [showPassword, setShowPassword] = (0, import_react_better_core14.useBooleanState)();
|
|
2175
|
+
const onPressEye = (0, import_react15.useCallback)(() => {
|
|
2147
2176
|
setShowPassword.toggle();
|
|
2148
2177
|
inputFieldRef.current?.focus();
|
|
2149
2178
|
}, []);
|
|
2150
|
-
(0,
|
|
2179
|
+
(0, import_react15.useImperativeHandle)(ref, () => {
|
|
2151
2180
|
return inputFieldRef.current;
|
|
2152
2181
|
}, []);
|
|
2153
|
-
return /* @__PURE__ */ (0,
|
|
2182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2154
2183
|
InputFieldComponent,
|
|
2155
2184
|
{
|
|
2156
2185
|
secureTextEntry: !showPassword,
|
|
@@ -2165,12 +2194,12 @@ InputFieldComponent.password = (0, import_react14.forwardRef)(function Password(
|
|
|
2165
2194
|
}
|
|
2166
2195
|
);
|
|
2167
2196
|
});
|
|
2168
|
-
InputFieldComponent.search = (0,
|
|
2169
|
-
return /* @__PURE__ */ (0,
|
|
2197
|
+
InputFieldComponent.search = (0, import_react15.forwardRef)(function Search(props, ref) {
|
|
2198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(InputFieldComponent, { placeholder: "Search...", leftIcon: "magnifyingGlass", ...props, ref });
|
|
2170
2199
|
});
|
|
2171
|
-
InputFieldComponent.code = (0,
|
|
2172
|
-
const theme2 = (0,
|
|
2173
|
-
return /* @__PURE__ */ (0,
|
|
2200
|
+
InputFieldComponent.code = (0, import_react15.forwardRef)(function Password2({ isSmall, ...props }, ref) {
|
|
2201
|
+
const theme2 = (0, import_react_better_core14.useTheme)();
|
|
2202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2174
2203
|
InputFieldComponent,
|
|
2175
2204
|
{
|
|
2176
2205
|
flex: 1,
|
|
@@ -2185,7 +2214,7 @@ InputFieldComponent.code = (0, import_react14.forwardRef)(function Password2({ i
|
|
|
2185
2214
|
}
|
|
2186
2215
|
);
|
|
2187
2216
|
});
|
|
2188
|
-
var InputField = (0,
|
|
2217
|
+
var InputField = (0, import_react15.memo)(InputFieldComponent);
|
|
2189
2218
|
InputField.email = InputFieldComponent.email;
|
|
2190
2219
|
InputField.password = InputFieldComponent.password;
|
|
2191
2220
|
InputField.search = InputFieldComponent.search;
|
|
@@ -2193,32 +2222,32 @@ InputField.code = InputFieldComponent.code;
|
|
|
2193
2222
|
var InputField_default = InputField;
|
|
2194
2223
|
|
|
2195
2224
|
// src/components/Switch.tsx
|
|
2196
|
-
var
|
|
2225
|
+
var import_react16 = require("react");
|
|
2197
2226
|
var import_react_native10 = require("react-native");
|
|
2198
|
-
var
|
|
2199
|
-
var
|
|
2227
|
+
var import_react_better_core15 = require("react-better-core");
|
|
2228
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2200
2229
|
function Switch({ isEnabled, defaultIsEnabled, disabled, onChange }) {
|
|
2201
|
-
const theme2 = (0,
|
|
2202
|
-
const [enabled, setEnabled] = (0,
|
|
2203
|
-
const onPressElement = (0,
|
|
2230
|
+
const theme2 = (0, import_react_better_core15.useTheme)();
|
|
2231
|
+
const [enabled, setEnabled] = (0, import_react_better_core15.useBooleanState)(isEnabled ?? defaultIsEnabled);
|
|
2232
|
+
const onPressElement = (0, import_react16.useCallback)(() => {
|
|
2204
2233
|
onChange?.(!enabled);
|
|
2205
2234
|
setEnabled.toggle();
|
|
2206
2235
|
}, [onChange, enabled]);
|
|
2207
|
-
const trackColor = (0,
|
|
2236
|
+
const trackColor = (0, import_react16.useMemo)(
|
|
2208
2237
|
() => ({
|
|
2209
2238
|
false: theme2.colors.border,
|
|
2210
2239
|
true: theme2.colors.primary
|
|
2211
2240
|
}),
|
|
2212
2241
|
[theme2.colors]
|
|
2213
2242
|
);
|
|
2214
|
-
(0,
|
|
2243
|
+
(0, import_react16.useEffect)(() => {
|
|
2215
2244
|
if (isEnabled === void 0) return;
|
|
2216
2245
|
setEnabled.setState(isEnabled);
|
|
2217
2246
|
}, [isEnabled]);
|
|
2218
2247
|
const ballSize = 26;
|
|
2219
2248
|
const ballGap = 3;
|
|
2220
2249
|
const holderWidth = ballSize * 2.1;
|
|
2221
|
-
return import_react_native10.Platform.OS === "ios" ? /* @__PURE__ */ (0,
|
|
2250
|
+
return import_react_native10.Platform.OS === "ios" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2222
2251
|
import_react_native10.Switch,
|
|
2223
2252
|
{
|
|
2224
2253
|
trackColor,
|
|
@@ -2227,7 +2256,7 @@ function Switch({ isEnabled, defaultIsEnabled, disabled, onChange }) {
|
|
|
2227
2256
|
value: enabled,
|
|
2228
2257
|
disabled
|
|
2229
2258
|
}
|
|
2230
|
-
) : /* @__PURE__ */ (0,
|
|
2259
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2231
2260
|
View_default,
|
|
2232
2261
|
{
|
|
2233
2262
|
width: holderWidth,
|
|
@@ -2235,23 +2264,26 @@ function Switch({ isEnabled, defaultIsEnabled, disabled, onChange }) {
|
|
|
2235
2264
|
pressStrength: pressStrength().p05,
|
|
2236
2265
|
disabled,
|
|
2237
2266
|
onPress: !disabled ? onPressElement : void 0,
|
|
2238
|
-
children: /* @__PURE__ */ (0,
|
|
2267
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2239
2268
|
Animate_default.View,
|
|
2240
2269
|
{
|
|
2241
2270
|
width: "100%",
|
|
2242
2271
|
height: ballGap + ballSize + ballGap,
|
|
2243
2272
|
borderRadius: 999,
|
|
2244
|
-
initialOpacity: 1,
|
|
2245
|
-
animateOpacity: disabled ? 0.6 : 1,
|
|
2246
2273
|
initialBackgroundColor: theme2.colors.border,
|
|
2247
2274
|
animateBackgroundColor: enabled ? theme2.colors.primary : theme2.colors.border,
|
|
2248
|
-
|
|
2275
|
+
initialOpacity: 1,
|
|
2276
|
+
animateOpacity: disabled ? 0.6 : 1,
|
|
2277
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2249
2278
|
Animate_default.View,
|
|
2250
2279
|
{
|
|
2251
2280
|
width: ballSize,
|
|
2252
2281
|
height: ballSize,
|
|
2253
2282
|
top: ballGap,
|
|
2254
2283
|
borderRadius: 999,
|
|
2284
|
+
transitionType: "spring",
|
|
2285
|
+
transitionDamping: 20,
|
|
2286
|
+
transitionStiffness: 230,
|
|
2255
2287
|
backgroundColor: theme2.colors.backgroundContent,
|
|
2256
2288
|
initialX: ballGap,
|
|
2257
2289
|
animateX: enabled ? holderWidth - ballGap - ballSize : ballGap
|
|
@@ -2262,30 +2294,122 @@ function Switch({ isEnabled, defaultIsEnabled, disabled, onChange }) {
|
|
|
2262
2294
|
}
|
|
2263
2295
|
);
|
|
2264
2296
|
}
|
|
2265
|
-
var Switch_default = (0,
|
|
2297
|
+
var Switch_default = (0, import_react16.memo)(Switch);
|
|
2266
2298
|
|
|
2267
|
-
// src/components/
|
|
2268
|
-
var
|
|
2269
|
-
var import_react_better_core15 = require("react-better-core");
|
|
2299
|
+
// src/components/CheckBox.tsx
|
|
2300
|
+
var import_react17 = require("react");
|
|
2270
2301
|
var import_react_native11 = require("react-native");
|
|
2271
|
-
var
|
|
2302
|
+
var import_react_better_core16 = require("react-better-core");
|
|
2303
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2304
|
+
function CheckBox({
|
|
2305
|
+
isChecked,
|
|
2306
|
+
defaultIsChecked,
|
|
2307
|
+
size = 36,
|
|
2308
|
+
text,
|
|
2309
|
+
required,
|
|
2310
|
+
disabled,
|
|
2311
|
+
onChange
|
|
2312
|
+
}) {
|
|
2313
|
+
const theme2 = (0, import_react_better_core16.useTheme)();
|
|
2314
|
+
const [checked, setChecked] = (0, import_react_better_core16.useBooleanState)(isChecked ?? defaultIsChecked);
|
|
2315
|
+
const onPressElement = (0, import_react17.useCallback)(() => {
|
|
2316
|
+
onChange?.(!checked);
|
|
2317
|
+
setChecked.toggle();
|
|
2318
|
+
}, [onChange, checked]);
|
|
2319
|
+
(0, import_react17.useEffect)(() => {
|
|
2320
|
+
if (isChecked === void 0) return;
|
|
2321
|
+
setChecked.setState(isChecked);
|
|
2322
|
+
}, [isChecked]);
|
|
2323
|
+
const checkBox = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2324
|
+
View_default,
|
|
2325
|
+
{
|
|
2326
|
+
width: size,
|
|
2327
|
+
borderRadius: theme2.styles.borderRadius,
|
|
2328
|
+
pressStrength: pressStrength().p05,
|
|
2329
|
+
disabled,
|
|
2330
|
+
onPress: !disabled ? onPressElement : void 0,
|
|
2331
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2332
|
+
Animate_default.View,
|
|
2333
|
+
{
|
|
2334
|
+
width: "100%",
|
|
2335
|
+
height: size,
|
|
2336
|
+
borderWidth: 1,
|
|
2337
|
+
borderRadius: theme2.styles.borderRadius,
|
|
2338
|
+
initialBackgroundColor: theme2.colors.backgroundContent,
|
|
2339
|
+
animateBackgroundColor: checked ? theme2.colors.primary : theme2.colors.backgroundContent,
|
|
2340
|
+
initialBorderColor: theme2.colors.border,
|
|
2341
|
+
animateBorderColor: checked ? theme2.colors.primary : theme2.colors.border,
|
|
2342
|
+
initialOpacity: 1,
|
|
2343
|
+
animateOpacity: disabled ? 0.6 : 1,
|
|
2344
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2345
|
+
Animate_default.View,
|
|
2346
|
+
{
|
|
2347
|
+
width: "100%",
|
|
2348
|
+
height: "100%",
|
|
2349
|
+
alignItems: "center",
|
|
2350
|
+
justifyContent: "center",
|
|
2351
|
+
transitionType: "spring",
|
|
2352
|
+
transitionDamping: 20,
|
|
2353
|
+
transitionStiffness: 230,
|
|
2354
|
+
initialScale: 0,
|
|
2355
|
+
animateScale: checked ? 1 : 0,
|
|
2356
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2357
|
+
Icon_default,
|
|
2358
|
+
{
|
|
2359
|
+
name: "check",
|
|
2360
|
+
nameIOS: "checkmark",
|
|
2361
|
+
size: size * (import_react_native11.Platform.OS === "ios" ? 0.5 : 0.6),
|
|
2362
|
+
color: theme2.colors.base
|
|
2363
|
+
}
|
|
2364
|
+
)
|
|
2365
|
+
}
|
|
2366
|
+
)
|
|
2367
|
+
}
|
|
2368
|
+
)
|
|
2369
|
+
}
|
|
2370
|
+
);
|
|
2371
|
+
return text ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(View_default, { isRow: true, alignItems: "center", gap: theme2.styles.gap, children: [
|
|
2372
|
+
checkBox,
|
|
2373
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2374
|
+
View_default,
|
|
2375
|
+
{
|
|
2376
|
+
width: "100%",
|
|
2377
|
+
flexShrink: 1,
|
|
2378
|
+
pressType: "opacity",
|
|
2379
|
+
pressStrength: pressStrength().p3,
|
|
2380
|
+
onPress: onPressElement,
|
|
2381
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(View_default, { isRow: true, alignItems: "flex-start", gap: 2, children: [
|
|
2382
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(View_default, { flexShrink: 1, children: typeof text === "string" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text_default, { children: text }) : text }),
|
|
2383
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Label_default, { required: true })
|
|
2384
|
+
] })
|
|
2385
|
+
}
|
|
2386
|
+
)
|
|
2387
|
+
] }) }) : checkBox;
|
|
2388
|
+
}
|
|
2389
|
+
var CheckBox_default = (0, import_react17.memo)(CheckBox);
|
|
2390
|
+
|
|
2391
|
+
// src/components/StatusBar.tsx
|
|
2392
|
+
var import_react18 = require("react");
|
|
2393
|
+
var import_react_better_core17 = require("react-better-core");
|
|
2394
|
+
var import_react_native12 = require("react-native");
|
|
2395
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2272
2396
|
function StatusBar({ darkStatusBar, hidden, barStyle, androidBarStyle, iOSBarStyle }) {
|
|
2273
|
-
const theme2 = (0,
|
|
2274
|
-
return /* @__PURE__ */ (0,
|
|
2275
|
-
|
|
2397
|
+
const theme2 = (0, import_react_better_core17.useTheme)();
|
|
2398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2399
|
+
import_react_native12.StatusBar,
|
|
2276
2400
|
{
|
|
2277
2401
|
backgroundColor: darkStatusBar ? theme2.colors.backgroundSecondary : void 0,
|
|
2278
|
-
barStyle: barStyle ?? (
|
|
2402
|
+
barStyle: barStyle ?? (import_react_native12.Platform.OS === "android" ? androidBarStyle : iOSBarStyle),
|
|
2279
2403
|
hidden
|
|
2280
2404
|
}
|
|
2281
2405
|
);
|
|
2282
2406
|
}
|
|
2283
|
-
var StatusBar_default = (0,
|
|
2407
|
+
var StatusBar_default = (0, import_react18.memo)(StatusBar);
|
|
2284
2408
|
|
|
2285
2409
|
// src/components/ListItem.tsx
|
|
2286
|
-
var
|
|
2287
|
-
var
|
|
2288
|
-
var
|
|
2410
|
+
var import_react19 = require("react");
|
|
2411
|
+
var import_react_better_core18 = require("react-better-core");
|
|
2412
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2289
2413
|
function ListItem({
|
|
2290
2414
|
icon,
|
|
2291
2415
|
iconIOS,
|
|
@@ -2299,12 +2423,14 @@ function ListItem({
|
|
|
2299
2423
|
rightValue,
|
|
2300
2424
|
rightValueSelectable,
|
|
2301
2425
|
switchIsEnabled,
|
|
2302
|
-
switchOnChange
|
|
2426
|
+
switchOnChange,
|
|
2427
|
+
checkBoxIsChecked,
|
|
2428
|
+
checkBoxOnChange
|
|
2303
2429
|
}) {
|
|
2304
|
-
const theme2 = (0,
|
|
2430
|
+
const theme2 = (0, import_react_better_core18.useTheme)();
|
|
2305
2431
|
const device = useDevice();
|
|
2306
2432
|
const sideSpace = theme2.styles.space;
|
|
2307
|
-
return /* @__PURE__ */ (0,
|
|
2433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2308
2434
|
View_default,
|
|
2309
2435
|
{
|
|
2310
2436
|
width: insideScreenHolder ? device.windowDimensions.width : "100%",
|
|
@@ -2314,15 +2440,15 @@ function ListItem({
|
|
|
2314
2440
|
paddingHorizontal: sideSpace,
|
|
2315
2441
|
pressStrength: pressStrength().p05,
|
|
2316
2442
|
onPress,
|
|
2317
|
-
children: /* @__PURE__ */ (0,
|
|
2318
|
-
icon && /* @__PURE__ */ (0,
|
|
2319
|
-
/* @__PURE__ */ (0,
|
|
2320
|
-
title && /* @__PURE__ */ (0,
|
|
2321
|
-
description && /* @__PURE__ */ (0,
|
|
2443
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(View_default, { isRow: true, alignItems: "center", gap: theme2.styles.space, children: [
|
|
2444
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon_default, { name: icon, nameIOS: iconIOS, size: 22, color: theme2.colors.primary }),
|
|
2445
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(View_default, { flex: 1, flexDirection: "row", alignItems: "center", gap: theme2.styles.gap, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(View_default, { flex: 1, children: [
|
|
2446
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text_default, { fontSize: 20, fontWeight: 700, children: title }),
|
|
2447
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text_default.body, { selectable: descriptionSelectable, children: description })
|
|
2322
2448
|
] }) }),
|
|
2323
|
-
rightElement ? /* @__PURE__ */ (0,
|
|
2324
|
-
rightValue !== void 0 && /* @__PURE__ */ (0,
|
|
2325
|
-
rightElement === "arrow" && /* @__PURE__ */ (0,
|
|
2449
|
+
rightElement ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_jsx_runtime17.Fragment, { children: rightValue !== void 0 || rightElement === "arrow" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(View_default, { isRow: true, alignItems: "center", gap: theme2.styles.gap / 2, children: [
|
|
2450
|
+
rightValue !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text_default, { fontSize: 14, fontWeight: 700, selectable: rightValueSelectable, children: rightValue }),
|
|
2451
|
+
rightElement === "arrow" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2326
2452
|
Icon_default,
|
|
2327
2453
|
{
|
|
2328
2454
|
name: "chevronRight",
|
|
@@ -2330,20 +2456,22 @@ function ListItem({
|
|
|
2330
2456
|
color: rightValue !== void 0 ? theme2.colors.textPrimary : theme2.colors.textSecondary
|
|
2331
2457
|
}
|
|
2332
2458
|
)
|
|
2333
|
-
] }) : rightElement === "switch" ? /* @__PURE__ */ (0,
|
|
2459
|
+
] }) : rightElement === "switch" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Switch_default, { isEnabled: switchIsEnabled, onChange: switchOnChange }) : rightElement === "checkBox" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CheckBox_default, { isChecked: checkBoxIsChecked, onChange: checkBoxOnChange }) : void 0 }) : void 0
|
|
2334
2460
|
] })
|
|
2335
2461
|
}
|
|
2336
2462
|
);
|
|
2337
2463
|
}
|
|
2338
|
-
var ListItem_default = (0,
|
|
2464
|
+
var ListItem_default = (0, import_react19.memo)(ListItem);
|
|
2339
2465
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2340
2466
|
0 && (module.exports = {
|
|
2341
2467
|
Animate,
|
|
2342
2468
|
BetterComponentsProvider,
|
|
2343
2469
|
Button,
|
|
2470
|
+
CheckBox,
|
|
2344
2471
|
Icon,
|
|
2345
2472
|
Image,
|
|
2346
2473
|
InputField,
|
|
2474
|
+
Label,
|
|
2347
2475
|
ListItem,
|
|
2348
2476
|
Loader,
|
|
2349
2477
|
ScreenHolder,
|