react-native-better-html 1.0.15 → 1.0.16
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 +48 -32
- package/dist/index.d.ts +48 -32
- package/dist/index.js +221 -119
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +181 -80
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -2
package/dist/index.js
CHANGED
|
@@ -33,6 +33,7 @@ __export(index_exports, {
|
|
|
33
33
|
Animate: () => Animate_default,
|
|
34
34
|
BetterComponentsProvider: () => BetterComponentsProvider_default,
|
|
35
35
|
Button: () => Button_default,
|
|
36
|
+
Icon: () => Icon_default,
|
|
36
37
|
Image: () => Image_default,
|
|
37
38
|
InputField: () => InputField_default,
|
|
38
39
|
Loader: () => Loader_default,
|
|
@@ -41,35 +42,35 @@ __export(index_exports, {
|
|
|
41
42
|
Text: () => Text_default,
|
|
42
43
|
View: () => View_default,
|
|
43
44
|
asyncStoragePlugin: () => asyncStoragePlugin,
|
|
44
|
-
colorThemeControls: () =>
|
|
45
|
-
countries: () =>
|
|
46
|
-
darkenColor: () =>
|
|
45
|
+
colorThemeControls: () => import_react_better_core12.colorThemeControls,
|
|
46
|
+
countries: () => import_react_better_core12.countries,
|
|
47
|
+
darkenColor: () => import_react_better_core12.darkenColor,
|
|
47
48
|
defaultAsyncStoragePluginOptions: () => defaultAsyncStoragePluginOptions,
|
|
48
|
-
desaturateColor: () =>
|
|
49
|
-
eventPreventDefault: () =>
|
|
50
|
-
eventPreventStop: () =>
|
|
51
|
-
eventStopPropagation: () =>
|
|
52
|
-
formatPhoneNumber: () =>
|
|
49
|
+
desaturateColor: () => import_react_better_core12.desaturateColor,
|
|
50
|
+
eventPreventDefault: () => import_react_better_core12.eventPreventDefault,
|
|
51
|
+
eventPreventStop: () => import_react_better_core12.eventPreventStop,
|
|
52
|
+
eventStopPropagation: () => import_react_better_core12.eventStopPropagation,
|
|
53
|
+
formatPhoneNumber: () => import_react_better_core12.formatPhoneNumber,
|
|
53
54
|
generateAsyncStorage: () => generateAsyncStorage,
|
|
54
|
-
generateRandomString: () =>
|
|
55
|
+
generateRandomString: () => import_react_better_core12.generateRandomString,
|
|
55
56
|
getFormErrorObject: () => getFormErrorObject,
|
|
56
|
-
getPluralWord: () =>
|
|
57
|
-
lightenColor: () =>
|
|
58
|
-
loaderControls: () =>
|
|
57
|
+
getPluralWord: () => import_react_better_core12.getPluralWord,
|
|
58
|
+
lightenColor: () => import_react_better_core12.lightenColor,
|
|
59
|
+
loaderControls: () => import_react_better_core12.loaderControls,
|
|
59
60
|
pressStrength: () => pressStrength,
|
|
60
|
-
saturateColor: () =>
|
|
61
|
+
saturateColor: () => import_react_better_core12.saturateColor,
|
|
61
62
|
useBetterComponentsContext: () => useBetterComponentsContext,
|
|
62
|
-
useBooleanState: () =>
|
|
63
|
-
useDebounceState: () =>
|
|
63
|
+
useBooleanState: () => import_react_better_core12.useBooleanState,
|
|
64
|
+
useDebounceState: () => import_react_better_core12.useDebounceState,
|
|
64
65
|
useDevice: () => useDevice,
|
|
65
66
|
useForm: () => useForm,
|
|
66
67
|
useKeyboard: () => useKeyboard,
|
|
67
|
-
useLoader: () =>
|
|
68
|
-
useLoaderControls: () =>
|
|
69
|
-
useTheme: () =>
|
|
68
|
+
useLoader: () => import_react_better_core12.useLoader,
|
|
69
|
+
useLoaderControls: () => import_react_better_core12.useLoaderControls,
|
|
70
|
+
useTheme: () => import_react_better_core12.useTheme
|
|
70
71
|
});
|
|
71
72
|
module.exports = __toCommonJS(index_exports);
|
|
72
|
-
var
|
|
73
|
+
var import_react_better_core12 = require("react-better-core");
|
|
73
74
|
|
|
74
75
|
// src/components/BetterComponentsProvider.tsx
|
|
75
76
|
var import_react = require("react");
|
|
@@ -82,7 +83,18 @@ var appConfig = {};
|
|
|
82
83
|
var theme = {};
|
|
83
84
|
|
|
84
85
|
// src/constants/icons.ts
|
|
85
|
-
var icons = {
|
|
86
|
+
var icons = {
|
|
87
|
+
magnifyingGlass: {
|
|
88
|
+
width: 512,
|
|
89
|
+
height: 512,
|
|
90
|
+
paths: [
|
|
91
|
+
{
|
|
92
|
+
d: "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z",
|
|
93
|
+
type: "fill"
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
};
|
|
86
98
|
|
|
87
99
|
// src/constants/assets.ts
|
|
88
100
|
var assets = {};
|
|
@@ -184,10 +196,10 @@ var checkBetterCoreContextValue = (value, functionsName) => {
|
|
|
184
196
|
var pressStrength = () => {
|
|
185
197
|
if (!checkBetterCoreContextValue(externalBetterCoreContextValue, "pressStrength")) return void 0;
|
|
186
198
|
return {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
199
|
+
p05: externalBetterCoreContextValue.colorTheme === "dark" ? 0.85 : 0.95,
|
|
200
|
+
p1: externalBetterCoreContextValue.colorTheme === "dark" ? 0.6 : 0.8,
|
|
201
|
+
p2: externalBetterCoreContextValue.colorTheme === "dark" ? 0.5 : 0.7,
|
|
202
|
+
p3: externalBetterCoreContextValue.colorTheme === "dark" ? 0.4 : 0.6
|
|
191
203
|
};
|
|
192
204
|
};
|
|
193
205
|
|
|
@@ -695,7 +707,8 @@ var ViewComponent = function View({
|
|
|
695
707
|
previousValue.shadowOffset = void 0;
|
|
696
708
|
else previousValue[currentValue] = void 0;
|
|
697
709
|
return previousValue;
|
|
698
|
-
}, {})
|
|
710
|
+
}, {}),
|
|
711
|
+
width: props.width !== "100%" ? props.width : void 0
|
|
699
712
|
}),
|
|
700
713
|
[style]
|
|
701
714
|
);
|
|
@@ -1107,7 +1120,7 @@ ButtonComponent.secondary = function Secondary(props) {
|
|
|
1107
1120
|
borderWidth: 1,
|
|
1108
1121
|
borderColor: theme2.colors.border,
|
|
1109
1122
|
textColor: theme2.colors.textPrimary,
|
|
1110
|
-
pressStrength: pressStrength().
|
|
1123
|
+
pressStrength: pressStrength().p05,
|
|
1111
1124
|
animateOpacity: props.disabled ? 0.4 : 1,
|
|
1112
1125
|
...props
|
|
1113
1126
|
}
|
|
@@ -1301,13 +1314,52 @@ var Image2 = (0, import_react9.memo)(ImageComponent);
|
|
|
1301
1314
|
Image2.profileImage = ImageComponent.profileImage;
|
|
1302
1315
|
var Image_default = Image2;
|
|
1303
1316
|
|
|
1304
|
-
// src/components/
|
|
1317
|
+
// src/components/Icon.tsx
|
|
1305
1318
|
var import_react10 = require("react");
|
|
1306
1319
|
var import_react_native8 = require("react-native");
|
|
1307
|
-
var
|
|
1320
|
+
var import_react_native_svg = require("react-native-svg");
|
|
1308
1321
|
var import_react_better_core9 = require("react-better-core");
|
|
1322
|
+
var import_expo_symbols = require("expo-symbols");
|
|
1309
1323
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1310
|
-
var
|
|
1324
|
+
var import_react11 = require("react");
|
|
1325
|
+
function Icon({ name, nameIOS, size = 16, color, ...props }) {
|
|
1326
|
+
const theme2 = (0, import_react_better_core9.useTheme)();
|
|
1327
|
+
const { icons: icons2 } = (0, import_react_better_core9.useBetterCoreContext)();
|
|
1328
|
+
const svgColor = color ?? theme2.colors.textPrimary;
|
|
1329
|
+
(0, import_react10.useEffect)(() => {
|
|
1330
|
+
if (!icons2[name.toString()])
|
|
1331
|
+
console.warn(
|
|
1332
|
+
`The icon \`${name}\` you are trying to use does not exist. Make sure to add it to the \`icons\` object in \`<BetterComponentsProvider>\` config value prop.`
|
|
1333
|
+
);
|
|
1334
|
+
}, [icons2, name]);
|
|
1335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(View_default, { width: size, height: size, pressType: "opacity", pressStrength: pressStrength().p2, ...props, children: import_react_native8.Platform.OS === "ios" && nameIOS ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_expo_symbols.SymbolView, { name: nameIOS, tintColor: svgColor, size }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1336
|
+
import_react_native_svg.Svg,
|
|
1337
|
+
{
|
|
1338
|
+
width: size,
|
|
1339
|
+
height: size,
|
|
1340
|
+
viewBox: `0 0 ${icons2[name.toString()]?.width ?? 0} ${icons2[name.toString()]?.height ?? 0}`,
|
|
1341
|
+
fill: "none",
|
|
1342
|
+
children: icons2[name.toString()]?.paths.map(({ type, ...path }) => /* @__PURE__ */ (0, import_react11.createElement)(
|
|
1343
|
+
import_react_native_svg.Path,
|
|
1344
|
+
{
|
|
1345
|
+
...path,
|
|
1346
|
+
fill: type === "fill" ? svgColor : void 0,
|
|
1347
|
+
stroke: type === "stroke" ? svgColor : void 0,
|
|
1348
|
+
key: path.d
|
|
1349
|
+
}
|
|
1350
|
+
))
|
|
1351
|
+
}
|
|
1352
|
+
) });
|
|
1353
|
+
}
|
|
1354
|
+
var Icon_default = Icon;
|
|
1355
|
+
|
|
1356
|
+
// src/components/InputField.tsx
|
|
1357
|
+
var import_react12 = require("react");
|
|
1358
|
+
var import_react_native9 = require("react-native");
|
|
1359
|
+
var import_datetimepicker = __toESM(require("@react-native-community/datetimepicker"));
|
|
1360
|
+
var import_react_better_core10 = require("react-better-core");
|
|
1361
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1362
|
+
var InputFieldComponent = (0, import_react12.forwardRef)(
|
|
1311
1363
|
({
|
|
1312
1364
|
flex,
|
|
1313
1365
|
placeholder,
|
|
@@ -1341,6 +1393,10 @@ var InputFieldComponent = (0, import_react10.forwardRef)(
|
|
|
1341
1393
|
maxLength,
|
|
1342
1394
|
multiline,
|
|
1343
1395
|
numberOfLines = 2,
|
|
1396
|
+
leftIcon,
|
|
1397
|
+
leftIconIOS,
|
|
1398
|
+
rightIcon,
|
|
1399
|
+
rightIconIOS,
|
|
1344
1400
|
paddingHorizontal,
|
|
1345
1401
|
paddingVertical,
|
|
1346
1402
|
onFocus,
|
|
@@ -1352,29 +1408,31 @@ var InputFieldComponent = (0, import_react10.forwardRef)(
|
|
|
1352
1408
|
onPressEnter,
|
|
1353
1409
|
...props
|
|
1354
1410
|
}, ref) => {
|
|
1355
|
-
const theme2 = (0,
|
|
1356
|
-
const { colorTheme } = (0,
|
|
1357
|
-
const textInputRef = (0,
|
|
1358
|
-
const [internalValue, setInternalValue] = (0,
|
|
1359
|
-
const [internalDateValue, setInternalDateValue] = (0,
|
|
1360
|
-
const [isFocused, setIsFocused] = (0,
|
|
1361
|
-
const isIOSDateTime =
|
|
1411
|
+
const theme2 = (0, import_react_better_core10.useTheme)();
|
|
1412
|
+
const { colorTheme } = (0, import_react_better_core10.useBetterCoreContext)();
|
|
1413
|
+
const textInputRef = (0, import_react12.useRef)(null);
|
|
1414
|
+
const [internalValue, setInternalValue] = (0, import_react12.useState)(value?.toString() || defaultValue || "");
|
|
1415
|
+
const [internalDateValue, setInternalDateValue] = (0, import_react12.useState)();
|
|
1416
|
+
const [isFocused, setIsFocused] = (0, import_react_better_core10.useBooleanState)();
|
|
1417
|
+
const isIOSDateTime = import_react_native9.Platform.OS === "ios" && (type === "date" || type === "time");
|
|
1418
|
+
const iconSize = 16;
|
|
1419
|
+
const iconSideSpace = theme2.styles.space;
|
|
1362
1420
|
const borderWidth = 1;
|
|
1363
1421
|
const readyPaddingHorizontal = paddingHorizontal ?? theme2.styles.space;
|
|
1364
1422
|
const readyPaddingVertical = paddingVertical ? parseFloat(paddingVertical.toString()) : (theme2.styles.space + theme2.styles.gap) / 2;
|
|
1365
|
-
const readyHeight = height ?? isIOSDateTime ? void 0 : borderWidth + readyPaddingVertical + lineHeight + readyPaddingVertical + borderWidth + (
|
|
1366
|
-
const onChangeRNDateTimePicker = (0,
|
|
1423
|
+
const readyHeight = height ?? isIOSDateTime ? void 0 : borderWidth + readyPaddingVertical + lineHeight + readyPaddingVertical + borderWidth + (import_react_native9.Platform.OS === "android" ? 2 : 0);
|
|
1424
|
+
const onChangeRNDateTimePicker = (0, import_react12.useCallback)(
|
|
1367
1425
|
(event, data) => {
|
|
1368
1426
|
setInternalDateValue(data);
|
|
1369
1427
|
onChange?.(data?.toISOString() ?? "");
|
|
1370
1428
|
},
|
|
1371
1429
|
[onChange]
|
|
1372
1430
|
);
|
|
1373
|
-
const onPressInputField = (0,
|
|
1431
|
+
const onPressInputField = (0, import_react12.useCallback)(
|
|
1374
1432
|
(event) => {
|
|
1375
1433
|
onPress?.(event);
|
|
1376
1434
|
if (type === "date" || type === "time") {
|
|
1377
|
-
if (
|
|
1435
|
+
if (import_react_native9.Platform.OS === "android") {
|
|
1378
1436
|
import_datetimepicker.DateTimePickerAndroid.open({
|
|
1379
1437
|
value: internalDateValue ?? /* @__PURE__ */ new Date(),
|
|
1380
1438
|
is24Hour: true,
|
|
@@ -1392,47 +1450,60 @@ var InputFieldComponent = (0, import_react10.forwardRef)(
|
|
|
1392
1450
|
},
|
|
1393
1451
|
onChange: onChangeRNDateTimePicker
|
|
1394
1452
|
});
|
|
1395
|
-
} else if (
|
|
1453
|
+
} else if (import_react_native9.Platform.OS === "ios") {
|
|
1396
1454
|
}
|
|
1397
1455
|
}
|
|
1398
1456
|
},
|
|
1399
1457
|
[onPress, type, internalDateValue, onChangeRNDateTimePicker]
|
|
1400
1458
|
);
|
|
1401
|
-
const onFocusElement = (0,
|
|
1459
|
+
const onFocusElement = (0, import_react12.useCallback)((event) => {
|
|
1402
1460
|
setIsFocused.setTrue();
|
|
1403
1461
|
onFocus?.(event);
|
|
1404
1462
|
}, []);
|
|
1405
|
-
const onBlurElement = (0,
|
|
1463
|
+
const onBlurElement = (0, import_react12.useCallback)((event) => {
|
|
1406
1464
|
setIsFocused.setFalse();
|
|
1407
1465
|
onBlur?.(event);
|
|
1408
1466
|
}, []);
|
|
1409
|
-
const onChangeText = (0,
|
|
1467
|
+
const onChangeText = (0, import_react12.useCallback)(
|
|
1410
1468
|
(text) => {
|
|
1411
1469
|
setInternalValue(text);
|
|
1412
1470
|
onChange?.(text);
|
|
1413
1471
|
},
|
|
1414
1472
|
[onChange]
|
|
1415
1473
|
);
|
|
1416
|
-
const textInputStyle = (0,
|
|
1474
|
+
const textInputStyle = (0, import_react12.useMemo)(
|
|
1417
1475
|
() => ({
|
|
1418
1476
|
flex: 1,
|
|
1419
1477
|
fontSize,
|
|
1420
1478
|
fontWeight,
|
|
1421
1479
|
lineHeight,
|
|
1422
1480
|
color: theme2.colors.textPrimary,
|
|
1481
|
+
paddingLeft: leftIcon ? iconSideSpace + iconSize + iconSideSpace : void 0,
|
|
1482
|
+
paddingRight: rightIcon ? iconSideSpace + iconSize + iconSideSpace : void 0,
|
|
1423
1483
|
paddingHorizontal: readyPaddingHorizontal,
|
|
1424
1484
|
paddingVertical: readyPaddingVertical
|
|
1425
1485
|
}),
|
|
1426
|
-
[
|
|
1486
|
+
[
|
|
1487
|
+
theme2.colors,
|
|
1488
|
+
fontSize,
|
|
1489
|
+
fontWeight,
|
|
1490
|
+
lineHeight,
|
|
1491
|
+
readyPaddingHorizontal,
|
|
1492
|
+
readyPaddingVertical,
|
|
1493
|
+
iconSideSpace,
|
|
1494
|
+
iconSize,
|
|
1495
|
+
leftIcon,
|
|
1496
|
+
rightIcon
|
|
1497
|
+
]
|
|
1427
1498
|
);
|
|
1428
|
-
const rnDateTimePickerStyle = (0,
|
|
1499
|
+
const rnDateTimePickerStyle = (0, import_react12.useMemo)(
|
|
1429
1500
|
() => ({
|
|
1430
1501
|
flex: iOSDateTimeFullSize ? 1 : void 0,
|
|
1431
1502
|
marginLeft: -8 + (iOSDateTimeFullSize ? 0 : theme2.styles.space)
|
|
1432
1503
|
}),
|
|
1433
1504
|
[iOSDateTimeFullSize]
|
|
1434
1505
|
);
|
|
1435
|
-
(0,
|
|
1506
|
+
(0, import_react12.useEffect)(() => {
|
|
1436
1507
|
if (value === void 0) return;
|
|
1437
1508
|
setInternalValue(value.toString());
|
|
1438
1509
|
try {
|
|
@@ -1440,7 +1511,7 @@ var InputFieldComponent = (0, import_react10.forwardRef)(
|
|
|
1440
1511
|
} catch (error) {
|
|
1441
1512
|
}
|
|
1442
1513
|
}, [value]);
|
|
1443
|
-
(0,
|
|
1514
|
+
(0, import_react12.useEffect)(() => {
|
|
1444
1515
|
if (type !== "date" && type !== "time") return;
|
|
1445
1516
|
const date = internalDateValue?.toISOString().split("T")[0] ?? "";
|
|
1446
1517
|
const hours = internalDateValue ? internalDateValue.getHours().toString() : "00";
|
|
@@ -1449,7 +1520,7 @@ var InputFieldComponent = (0, import_react10.forwardRef)(
|
|
|
1449
1520
|
type === "date" ? date : internalDateValue ? `${hours.length === 1 ? `0${hours}` : hours}:${minutes.length === 1 ? `0${minutes}` : minutes}` : ""
|
|
1450
1521
|
);
|
|
1451
1522
|
}, [internalDateValue]);
|
|
1452
|
-
(0,
|
|
1523
|
+
(0, import_react12.useImperativeHandle)(
|
|
1453
1524
|
ref,
|
|
1454
1525
|
() => {
|
|
1455
1526
|
return textInputRef.current;
|
|
@@ -1457,12 +1528,12 @@ var InputFieldComponent = (0, import_react10.forwardRef)(
|
|
|
1457
1528
|
[]
|
|
1458
1529
|
);
|
|
1459
1530
|
const withPressInputField = !!onPress || type === "date" || type === "time";
|
|
1460
|
-
const prefixSuffixBackgroundColor = colorTheme === "light" ? (0,
|
|
1461
|
-
const labelComponent = label && /* @__PURE__ */ (0,
|
|
1462
|
-
/* @__PURE__ */ (0,
|
|
1463
|
-
required && /* @__PURE__ */ (0,
|
|
1531
|
+
const prefixSuffixBackgroundColor = colorTheme === "light" ? (0, import_react_better_core10.darkenColor)(theme2.colors.backgroundContent, 0.03) : (0, import_react_better_core10.lightenColor)(theme2.colors.backgroundContent, 0.1);
|
|
1532
|
+
const labelComponent = label && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(View_default, { isRow: true, alignItems: "center", gap: 2, children: [
|
|
1533
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text_default, { fontSize: 14, color: isError ? theme2.colors.error : theme2.colors.textSecondary, children: label }),
|
|
1534
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text_default, { color: theme2.colors.error, children: "*" })
|
|
1464
1535
|
] });
|
|
1465
|
-
return /* @__PURE__ */ (0,
|
|
1536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1466
1537
|
Animate_default.View,
|
|
1467
1538
|
{
|
|
1468
1539
|
flex,
|
|
@@ -1472,8 +1543,8 @@ var InputFieldComponent = (0, import_react10.forwardRef)(
|
|
|
1472
1543
|
...props,
|
|
1473
1544
|
children: [
|
|
1474
1545
|
isIOSDateTime && !iOSDateTimeFullSize ? void 0 : labelComponent,
|
|
1475
|
-
/* @__PURE__ */ (0,
|
|
1476
|
-
prefix && /* @__PURE__ */ (0,
|
|
1546
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(View_default, { isRow: true, position: "relative", alignItems: "center", height: readyHeight, children: [
|
|
1547
|
+
prefix && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1477
1548
|
View_default,
|
|
1478
1549
|
{
|
|
1479
1550
|
isRow: true,
|
|
@@ -1488,20 +1559,20 @@ var InputFieldComponent = (0, import_react10.forwardRef)(
|
|
|
1488
1559
|
borderColor: theme2.colors.border,
|
|
1489
1560
|
paddingHorizontal: readyPaddingHorizontal,
|
|
1490
1561
|
onPress: onPressPrefix,
|
|
1491
|
-
children: typeof prefix === "string" ? /* @__PURE__ */ (0,
|
|
1562
|
+
children: typeof prefix === "string" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1492
1563
|
Text_default,
|
|
1493
1564
|
{
|
|
1494
1565
|
fontWeight: 700,
|
|
1495
1566
|
lineHeight,
|
|
1496
|
-
marginTop:
|
|
1567
|
+
marginTop: import_react_native9.Platform.OS === "ios" && onPressPrefix ? readyPaddingVertical : void 0,
|
|
1497
1568
|
children: prefix
|
|
1498
1569
|
}
|
|
1499
1570
|
) : prefix
|
|
1500
1571
|
}
|
|
1501
1572
|
),
|
|
1502
|
-
isIOSDateTime ? /* @__PURE__ */ (0,
|
|
1573
|
+
isIOSDateTime ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
1503
1574
|
!iOSDateTimeFullSize ? labelComponent : void 0,
|
|
1504
|
-
/* @__PURE__ */ (0,
|
|
1575
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1505
1576
|
import_datetimepicker.default,
|
|
1506
1577
|
{
|
|
1507
1578
|
value: internalDateValue ?? /* @__PURE__ */ new Date(),
|
|
@@ -1512,7 +1583,7 @@ var InputFieldComponent = (0, import_react10.forwardRef)(
|
|
|
1512
1583
|
onChange: onChangeRNDateTimePicker
|
|
1513
1584
|
}
|
|
1514
1585
|
)
|
|
1515
|
-
] }) : /* @__PURE__ */ (0,
|
|
1586
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1516
1587
|
View_default,
|
|
1517
1588
|
{
|
|
1518
1589
|
flex: 1,
|
|
@@ -1522,11 +1593,13 @@ var InputFieldComponent = (0, import_react10.forwardRef)(
|
|
|
1522
1593
|
borderTopRightRadius: suffix ? 0 : theme2.styles.borderRadius,
|
|
1523
1594
|
borderBottomRightRadius: suffix ? 0 : theme2.styles.borderRadius,
|
|
1524
1595
|
pressStrength: 1,
|
|
1525
|
-
onPress:
|
|
1526
|
-
children: /* @__PURE__ */ (0,
|
|
1596
|
+
onPress: import_react_native9.Platform.OS === "android" ? editable === false || withPressInputField ? onPressInputField : void 0 : void 0,
|
|
1597
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1527
1598
|
Animate_default.View,
|
|
1528
1599
|
{
|
|
1600
|
+
position: "relative",
|
|
1529
1601
|
flex: 1,
|
|
1602
|
+
justifyContent: "center",
|
|
1530
1603
|
backgroundColor: theme2.colors.backgroundContent,
|
|
1531
1604
|
borderTopLeftRadius: prefix ? 0 : theme2.styles.borderRadius,
|
|
1532
1605
|
borderBottomLeftRadius: prefix ? 0 : theme2.styles.borderRadius,
|
|
@@ -1536,44 +1609,68 @@ var InputFieldComponent = (0, import_react10.forwardRef)(
|
|
|
1536
1609
|
initialBorderColor: theme2.colors.border,
|
|
1537
1610
|
animateBorderColor: isFocused ? theme2.colors.primary : isError ? theme2.colors.error : theme2.colors.border,
|
|
1538
1611
|
overflow: "hidden",
|
|
1539
|
-
children:
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1612
|
+
children: [
|
|
1613
|
+
leftIcon && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1614
|
+
Icon_default,
|
|
1615
|
+
{
|
|
1616
|
+
position: "absolute",
|
|
1617
|
+
left: iconSideSpace,
|
|
1618
|
+
name: leftIcon,
|
|
1619
|
+
nameIOS: leftIconIOS,
|
|
1620
|
+
size: iconSize,
|
|
1621
|
+
pointerEvents: "box-none"
|
|
1622
|
+
}
|
|
1623
|
+
),
|
|
1624
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1625
|
+
import_react_native9.TextInput,
|
|
1626
|
+
{
|
|
1627
|
+
style: textInputStyle,
|
|
1628
|
+
value: internalValue,
|
|
1629
|
+
defaultValue,
|
|
1630
|
+
autoCapitalize,
|
|
1631
|
+
autoComplete,
|
|
1632
|
+
autoCorrect,
|
|
1633
|
+
autoFocus,
|
|
1634
|
+
placeholder: placeholder ?? label,
|
|
1635
|
+
placeholderTextColor: theme2.colors.textSecondary + "80",
|
|
1636
|
+
enterKeyHint: returnKeyLabel,
|
|
1637
|
+
returnKeyType,
|
|
1638
|
+
onSubmitEditing: onPressEnter,
|
|
1639
|
+
readOnly: !editable || disabled || type === "date" || type === "time",
|
|
1640
|
+
textAlign,
|
|
1641
|
+
editable: !disabled,
|
|
1642
|
+
keyboardAppearance,
|
|
1643
|
+
keyboardType,
|
|
1644
|
+
cursorColor: theme2.colors.primary,
|
|
1645
|
+
selectionColor: theme2.colors.primary,
|
|
1646
|
+
secureTextEntry,
|
|
1647
|
+
onFocus: onFocusElement,
|
|
1648
|
+
onBlur: onBlurElement,
|
|
1649
|
+
onChangeText,
|
|
1650
|
+
maxLength,
|
|
1651
|
+
multiline,
|
|
1652
|
+
numberOfLines,
|
|
1653
|
+
onPress: withPressInputField ? onPressInputField : void 0,
|
|
1654
|
+
ref: textInputRef
|
|
1655
|
+
}
|
|
1656
|
+
),
|
|
1657
|
+
rightIcon && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1658
|
+
Icon_default,
|
|
1659
|
+
{
|
|
1660
|
+
position: "absolute",
|
|
1661
|
+
right: iconSideSpace,
|
|
1662
|
+
name: rightIcon,
|
|
1663
|
+
nameIOS: rightIconIOS,
|
|
1664
|
+
size: iconSize,
|
|
1665
|
+
pointerEvents: "box-none"
|
|
1666
|
+
}
|
|
1667
|
+
)
|
|
1668
|
+
]
|
|
1572
1669
|
}
|
|
1573
1670
|
)
|
|
1574
1671
|
}
|
|
1575
1672
|
),
|
|
1576
|
-
suffix && /* @__PURE__ */ (0,
|
|
1673
|
+
suffix && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1577
1674
|
View_default,
|
|
1578
1675
|
{
|
|
1579
1676
|
isRow: true,
|
|
@@ -1587,19 +1684,19 @@ var InputFieldComponent = (0, import_react10.forwardRef)(
|
|
|
1587
1684
|
borderColor: theme2.colors.border,
|
|
1588
1685
|
paddingHorizontal: readyPaddingHorizontal,
|
|
1589
1686
|
onPress: onPressSuffix,
|
|
1590
|
-
children: typeof suffix === "string" ? /* @__PURE__ */ (0,
|
|
1687
|
+
children: typeof suffix === "string" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1591
1688
|
Text_default,
|
|
1592
1689
|
{
|
|
1593
1690
|
fontWeight: 700,
|
|
1594
1691
|
lineHeight,
|
|
1595
|
-
marginTop:
|
|
1692
|
+
marginTop: import_react_native9.Platform.OS === "ios" && onPressSuffix ? readyPaddingVertical : void 0,
|
|
1596
1693
|
children: suffix
|
|
1597
1694
|
}
|
|
1598
1695
|
) : suffix
|
|
1599
1696
|
}
|
|
1600
1697
|
)
|
|
1601
1698
|
] }),
|
|
1602
|
-
infoMessage && /* @__PURE__ */ (0,
|
|
1699
|
+
infoMessage && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1603
1700
|
Animate_default.Text,
|
|
1604
1701
|
{
|
|
1605
1702
|
fontSize: 14,
|
|
@@ -1611,7 +1708,7 @@ var InputFieldComponent = (0, import_react10.forwardRef)(
|
|
|
1611
1708
|
children: infoMessage
|
|
1612
1709
|
}
|
|
1613
1710
|
),
|
|
1614
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
1711
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1615
1712
|
Animate_default.Text,
|
|
1616
1713
|
{
|
|
1617
1714
|
fontSize: 14,
|
|
@@ -1628,8 +1725,8 @@ var InputFieldComponent = (0, import_react10.forwardRef)(
|
|
|
1628
1725
|
);
|
|
1629
1726
|
}
|
|
1630
1727
|
);
|
|
1631
|
-
InputFieldComponent.email = (0,
|
|
1632
|
-
return /* @__PURE__ */ (0,
|
|
1728
|
+
InputFieldComponent.email = (0, import_react12.forwardRef)(function Email(props, ref) {
|
|
1729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1633
1730
|
InputFieldComponent,
|
|
1634
1731
|
{
|
|
1635
1732
|
placeholder: "your@email.here",
|
|
@@ -1642,8 +1739,8 @@ InputFieldComponent.email = (0, import_react10.forwardRef)(function Email(props,
|
|
|
1642
1739
|
}
|
|
1643
1740
|
);
|
|
1644
1741
|
});
|
|
1645
|
-
InputFieldComponent.password = (0,
|
|
1646
|
-
return /* @__PURE__ */ (0,
|
|
1742
|
+
InputFieldComponent.password = (0, import_react12.forwardRef)(function Password(props, ref) {
|
|
1743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1647
1744
|
InputFieldComponent,
|
|
1648
1745
|
{
|
|
1649
1746
|
secureTextEntry: true,
|
|
@@ -1656,9 +1753,12 @@ InputFieldComponent.password = (0, import_react10.forwardRef)(function Password(
|
|
|
1656
1753
|
}
|
|
1657
1754
|
);
|
|
1658
1755
|
});
|
|
1659
|
-
InputFieldComponent.
|
|
1660
|
-
|
|
1661
|
-
|
|
1756
|
+
InputFieldComponent.search = (0, import_react12.forwardRef)(function Search(props, ref) {
|
|
1757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(InputFieldComponent, { placeholder: "Search...", leftIcon: "magnifyingGlass", ...props, ref });
|
|
1758
|
+
});
|
|
1759
|
+
InputFieldComponent.code = (0, import_react12.forwardRef)(function Password2({ isSmall, ...props }, ref) {
|
|
1760
|
+
const theme2 = (0, import_react_better_core10.useTheme)();
|
|
1761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1662
1762
|
InputFieldComponent,
|
|
1663
1763
|
{
|
|
1664
1764
|
flex: 1,
|
|
@@ -1673,29 +1773,30 @@ InputFieldComponent.code = (0, import_react10.forwardRef)(function Password2({ i
|
|
|
1673
1773
|
}
|
|
1674
1774
|
);
|
|
1675
1775
|
});
|
|
1676
|
-
var InputField = (0,
|
|
1776
|
+
var InputField = (0, import_react12.memo)(InputFieldComponent);
|
|
1677
1777
|
InputField.email = InputFieldComponent.email;
|
|
1678
1778
|
InputField.password = InputFieldComponent.password;
|
|
1779
|
+
InputField.search = InputFieldComponent.search;
|
|
1679
1780
|
InputField.code = InputFieldComponent.code;
|
|
1680
1781
|
var InputField_default = InputField;
|
|
1681
1782
|
|
|
1682
1783
|
// src/components/StatusBar.tsx
|
|
1683
|
-
var
|
|
1684
|
-
var
|
|
1685
|
-
var
|
|
1686
|
-
var
|
|
1784
|
+
var import_react13 = require("react");
|
|
1785
|
+
var import_react_better_core11 = require("react-better-core");
|
|
1786
|
+
var import_react_native10 = require("react-native");
|
|
1787
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1687
1788
|
function StatusBar({ darkStatusBar, hidden, barStyle, androidBarStyle, iOSBarStyle }) {
|
|
1688
|
-
const theme2 = (0,
|
|
1689
|
-
return /* @__PURE__ */ (0,
|
|
1690
|
-
|
|
1789
|
+
const theme2 = (0, import_react_better_core11.useTheme)();
|
|
1790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1791
|
+
import_react_native10.StatusBar,
|
|
1691
1792
|
{
|
|
1692
1793
|
backgroundColor: darkStatusBar ? theme2.colors.backgroundSecondary : void 0,
|
|
1693
|
-
barStyle: barStyle ?? (
|
|
1794
|
+
barStyle: barStyle ?? (import_react_native10.Platform.OS === "android" ? androidBarStyle : iOSBarStyle),
|
|
1694
1795
|
hidden
|
|
1695
1796
|
}
|
|
1696
1797
|
);
|
|
1697
1798
|
}
|
|
1698
|
-
var StatusBar_default = (0,
|
|
1799
|
+
var StatusBar_default = (0, import_react13.memo)(StatusBar);
|
|
1699
1800
|
|
|
1700
1801
|
// src/plugins/asyncStorage.ts
|
|
1701
1802
|
var defaultAsyncStoragePluginOptions = {};
|
|
@@ -1714,6 +1815,7 @@ var asyncStoragePlugin = (options) => ({
|
|
|
1714
1815
|
Animate,
|
|
1715
1816
|
BetterComponentsProvider,
|
|
1716
1817
|
Button,
|
|
1818
|
+
Icon,
|
|
1717
1819
|
Image,
|
|
1718
1820
|
InputField,
|
|
1719
1821
|
Loader,
|