@draftbit/core 49.3.2-6494ea.2 → 49.3.2-bc13e1.2
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/lib/commonjs/components/PinInput/PinInput.js +1 -1
- package/lib/commonjs/components/TextInput.js +1 -1
- package/lib/typescript/src/components/PinInput/PinInput.js +2 -5
- package/lib/typescript/src/components/PinInput/PinInput.js.map +1 -1
- package/lib/typescript/src/components/TextInput.d.ts +1 -0
- package/lib/typescript/src/components/TextInput.js +7 -3
- package/lib/typescript/src/components/TextInput.js.map +1 -1
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/components/PinInput/PinInput.js +2 -5
- package/src/components/PinInput/PinInput.js.map +1 -1
- package/src/components/PinInput/PinInput.tsx +0 -5
- package/src/components/TextInput.js +7 -3
- package/src/components/TextInput.js.map +1 -1
- package/src/components/TextInput.tsx +18 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "49.3.2-
|
|
3
|
+
"version": "49.3.2-bc13e1.2+bc13e16",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"types": "lib/typescript/src/index.d.ts",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/types": "^49.3.2-
|
|
44
|
+
"@draftbit/types": "^49.3.2-bc13e1.2+bc13e16",
|
|
45
45
|
"@expo/vector-icons": "^13.0.0",
|
|
46
46
|
"@gorhom/bottom-sheet": "5.0.0-alpha.7",
|
|
47
47
|
"@material-ui/core": "^4.11.0",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
],
|
|
113
113
|
"testEnvironment": "node"
|
|
114
114
|
},
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "bc13e16f4fb0f2ea3539588759b3dc94440fb93f"
|
|
116
116
|
}
|
|
@@ -5,7 +5,7 @@ import { CodeField, useClearByFocusCell, } from "react-native-confirmation-code-
|
|
|
5
5
|
import { withTheme } from "../../theming";
|
|
6
6
|
import PinInputText from "./PinInputText";
|
|
7
7
|
import { extractStyles } from "../../utilities";
|
|
8
|
-
const PinInput = React.forwardRef(({ theme, onInputFull, cellCount = 4, clearOnCellFocus = true, blurOnFull = true, renderItem, value, onChangeText, focusedBorderColor = theme.colors.primary, focusedBackgroundColor, focusedBorderWidth, focusedTextColor,
|
|
8
|
+
const PinInput = React.forwardRef(({ theme, onInputFull, cellCount = 4, clearOnCellFocus = true, blurOnFull = true, renderItem, value, onChangeText, focusedBorderColor = theme.colors.primary, focusedBackgroundColor, focusedBorderWidth, focusedTextColor, style, ...rest }, ref) => {
|
|
9
9
|
const newPinInputRef = React.useRef(null);
|
|
10
10
|
// Use the provided ref or default to new ref when not provided
|
|
11
11
|
const pinInputRef = ref
|
|
@@ -28,9 +28,6 @@ const PinInput = React.forwardRef(({ theme, onInputFull, cellCount = 4, clearOnC
|
|
|
28
28
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
29
29
|
}, [value, cellCount, blurOnFull, pinInputRef]);
|
|
30
30
|
const renderCell = (cellValue, index, isFocused) => {
|
|
31
|
-
if (secureTextEntry && cellValue) {
|
|
32
|
-
cellValue = "•";
|
|
33
|
-
}
|
|
34
31
|
const cell = (renderItem === null || renderItem === void 0 ? void 0 : renderItem({ cellValue, index, isFocused })) || (React.createElement(View, { testID: "default-code-input-cell", style: [
|
|
35
32
|
styles.cell,
|
|
36
33
|
{ borderColor: theme.colors.disabled },
|
|
@@ -62,7 +59,7 @@ const PinInput = React.forwardRef(({ theme, onInputFull, cellCount = 4, clearOnC
|
|
|
62
59
|
{ height: "100%" },
|
|
63
60
|
//@ts-ignore Web specific prop. Removes default blue outline that appears on the hidden TextInput
|
|
64
61
|
Platform.OS === "web" ? { outlineWidth: 0 } : {},
|
|
65
|
-
], InputComponent: TextInput, cellCount: cellCount, renderCell: ({ symbol: cellValue, index, isFocused }) => (React.createElement(React.Fragment, { key: index }, renderCell(cellValue, index, isFocused))),
|
|
62
|
+
], InputComponent: TextInput, cellCount: cellCount, renderCell: ({ symbol: cellValue, index, isFocused }) => (React.createElement(React.Fragment, { key: index }, renderCell(cellValue, index, isFocused))), ...rest }));
|
|
66
63
|
});
|
|
67
64
|
const styles = StyleSheet.create({
|
|
68
65
|
rootContainer: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PinInput.js","sourceRoot":"","sources":["PinInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAKL,IAAI,EACJ,UAAU,EACV,QAAQ,GACT,MAAM,cAAc,CAAC;AACtB,OAAO,SAA6B,MAAM,cAAc,CAAC;AACzD,OAAO,EACL,SAAS,EACT,mBAAmB,GACpB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAsBhD,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAC/B,CACE,EACE,KAAK,EACL,WAAW,EACX,SAAS,GAAG,CAAC,EACb,gBAAgB,GAAG,IAAI,EACvB,UAAU,GAAG,IAAI,EACjB,UAAU,EACV,KAAK,EACL,YAAY,EACZ,kBAAkB,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,EACzC,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,
|
|
1
|
+
{"version":3,"file":"PinInput.js","sourceRoot":"","sources":["PinInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAKL,IAAI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,IAAI,EAAE,CAAC;KACR;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,EAAE;KACb;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -53,7 +53,6 @@ const PinInput = React.forwardRef<NativeTextInput, PinInputProps>(
|
|
|
53
53
|
focusedBackgroundColor,
|
|
54
54
|
focusedBorderWidth,
|
|
55
55
|
focusedTextColor,
|
|
56
|
-
secureTextEntry,
|
|
57
56
|
style,
|
|
58
57
|
...rest
|
|
59
58
|
},
|
|
@@ -89,9 +88,6 @@ const PinInput = React.forwardRef<NativeTextInput, PinInputProps>(
|
|
|
89
88
|
index: number,
|
|
90
89
|
isFocused: boolean
|
|
91
90
|
) => {
|
|
92
|
-
if (secureTextEntry && cellValue) {
|
|
93
|
-
cellValue = "•";
|
|
94
|
-
}
|
|
95
91
|
const cell = renderItem?.({ cellValue, index, isFocused }) || (
|
|
96
92
|
<View
|
|
97
93
|
testID="default-code-input-cell"
|
|
@@ -151,7 +147,6 @@ const PinInput = React.forwardRef<NativeTextInput, PinInputProps>(
|
|
|
151
147
|
{renderCell(cellValue, index, isFocused)}
|
|
152
148
|
</React.Fragment>
|
|
153
149
|
)}
|
|
154
|
-
secureTextEntry={secureTextEntry}
|
|
155
150
|
{...rest}
|
|
156
151
|
/>
|
|
157
152
|
);
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { TextInput as NativeTextInput, } from "react-native";
|
|
2
|
+
import { TextInput as NativeTextInput, Platform, } from "react-native";
|
|
3
3
|
import { useDebounce, useOnUpdate } from "../hooks";
|
|
4
|
-
const TextInput = React.forwardRef(({ onChangeTextDelayed, changeTextDelay = 500, value, ...rest }, ref) => {
|
|
4
|
+
const TextInput = React.forwardRef(({ onChangeTextDelayed, changeTextDelay = 500, webShowOutline = true, style, value, ...rest }, ref) => {
|
|
5
5
|
const delayedValue = useDebounce(value, changeTextDelay);
|
|
6
6
|
useOnUpdate(() => {
|
|
7
7
|
if (delayedValue !== undefined) {
|
|
8
8
|
onChangeTextDelayed === null || onChangeTextDelayed === void 0 ? void 0 : onChangeTextDelayed(delayedValue);
|
|
9
9
|
}
|
|
10
10
|
}, [delayedValue]);
|
|
11
|
-
return (React.createElement(NativeTextInput, { testID: "native-text-input", ref: ref, value: value,
|
|
11
|
+
return (React.createElement(NativeTextInput, { testID: "native-text-input", ref: ref, value: value, style: [
|
|
12
|
+
//@ts-ignore Web specific prop. Removes default blue outline that appears on the hidden TextInput
|
|
13
|
+
Platform.OS === "web" && !webShowOutline ? { outlineWidth: 0 } : {},
|
|
14
|
+
style,
|
|
15
|
+
], ...rest }));
|
|
12
16
|
});
|
|
13
17
|
export default TextInput;
|
|
14
18
|
//# sourceMappingURL=TextInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.js","sourceRoot":"","sources":["TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,SAAS,IAAI,eAAe,
|
|
1
|
+
{"version":3,"file":"TextInput.js","sourceRoot":"","sources":["TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,SAAS,IAAI,eAAe,EAE5B,QAAQ,GACT,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAQpD,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAChC,CACE,EACE,mBAAmB,EACnB,eAAe,GAAG,GAAG,EACrB,cAAc,GAAG,IAAI,EACrB,KAAK,EACL,KAAK,EACL,GAAG,IAAI,EACR,EACD,GAAG,EACH,EAAE;IACF,MAAM,YAAY,GAAG,WAAW,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;IAEzD,WAAW,CAAC,GAAG,EAAE;QACf,IAAI,YAAY,KAAK,SAAS,EAAE;YAC9B,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAG,YAAY,CAAC,CAAC;SACrC;IACH,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,OAAO,CACL,oBAAC,eAAe,IACd,MAAM,EAAC,mBAAmB,EAC1B,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE;YACL,iGAAiG;YACjG,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;YACnE,KAAK;SACN,KACG,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -2,16 +2,28 @@ import React from "react";
|
|
|
2
2
|
import {
|
|
3
3
|
TextInput as NativeTextInput,
|
|
4
4
|
TextInputProps as NativeTextInputProps,
|
|
5
|
+
Platform,
|
|
5
6
|
} from "react-native";
|
|
6
7
|
import { useDebounce, useOnUpdate } from "../hooks";
|
|
7
8
|
|
|
8
9
|
export interface TextInputProps extends NativeTextInputProps {
|
|
10
|
+
webShowOutline?: boolean;
|
|
9
11
|
onChangeTextDelayed?: (text: string) => void;
|
|
10
12
|
changeTextDelay?: number;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
const TextInput = React.forwardRef<NativeTextInput, TextInputProps>(
|
|
14
|
-
(
|
|
16
|
+
(
|
|
17
|
+
{
|
|
18
|
+
onChangeTextDelayed,
|
|
19
|
+
changeTextDelay = 500,
|
|
20
|
+
webShowOutline = true,
|
|
21
|
+
style,
|
|
22
|
+
value,
|
|
23
|
+
...rest
|
|
24
|
+
},
|
|
25
|
+
ref
|
|
26
|
+
) => {
|
|
15
27
|
const delayedValue = useDebounce(value, changeTextDelay);
|
|
16
28
|
|
|
17
29
|
useOnUpdate(() => {
|
|
@@ -25,6 +37,11 @@ const TextInput = React.forwardRef<NativeTextInput, TextInputProps>(
|
|
|
25
37
|
testID="native-text-input"
|
|
26
38
|
ref={ref}
|
|
27
39
|
value={value}
|
|
40
|
+
style={[
|
|
41
|
+
//@ts-ignore Web specific prop. Removes default blue outline that appears on the hidden TextInput
|
|
42
|
+
Platform.OS === "web" && !webShowOutline ? { outlineWidth: 0 } : {},
|
|
43
|
+
style,
|
|
44
|
+
]}
|
|
28
45
|
{...rest}
|
|
29
46
|
/>
|
|
30
47
|
);
|