@draftbit/core 49.4.0 → 49.4.2-183f10.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/TextInput.js +1 -1
- package/lib/typescript/src/components/TextInput.d.ts +1 -0
- package/lib/typescript/src/components/TextInput.js +2 -2
- 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/TextInput.js +2 -2
- package/src/components/TextInput.js.map +1 -1
- package/src/components/TextInput.tsx +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "49.4.
|
|
3
|
+
"version": "49.4.2-183f10.2+183f102",
|
|
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.2.
|
|
44
|
+
"@draftbit/types": "^49.4.2-183f10.2+183f102",
|
|
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",
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
],
|
|
114
114
|
"testEnvironment": "node"
|
|
115
115
|
},
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "183f1027182789e12e8d1a404315979809e85134"
|
|
117
117
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { TextInput as NativeTextInput, Platform, } from "react-native";
|
|
3
3
|
import { useDebounce, useOnUpdate } from "../hooks";
|
|
4
|
-
const TextInput = React.forwardRef(({ onChangeTextDelayed, changeTextDelay = 500, webShowOutline = true, style, value, ...rest }, ref) => {
|
|
4
|
+
const TextInput = React.forwardRef(({ onChangeTextDelayed, changeTextDelay = 500, webShowOutline = true, style, disabled, 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, style: [
|
|
11
|
+
return (React.createElement(NativeTextInput, { testID: "native-text-input", ref: ref, value: value, editable: !disabled, style: [
|
|
12
12
|
//@ts-ignore Web specific prop. Removes default blue outline that appears on the hidden TextInput
|
|
13
13
|
Platform.OS === "web" && !webShowOutline ? { outlineWidth: 0 } : {},
|
|
14
14
|
style,
|
|
@@ -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,EAE5B,QAAQ,GACT,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;
|
|
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;AASpD,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAChC,CACE,EACE,mBAAmB,EACnB,eAAe,GAAG,GAAG,EACrB,cAAc,GAAG,IAAI,EACrB,KAAK,EACL,QAAQ,EACR,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,QAAQ,EAAE,CAAC,QAAQ,EACnB,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"}
|
|
@@ -10,6 +10,7 @@ export interface TextInputProps extends NativeTextInputProps {
|
|
|
10
10
|
webShowOutline?: boolean;
|
|
11
11
|
onChangeTextDelayed?: (text: string) => void;
|
|
12
12
|
changeTextDelay?: number;
|
|
13
|
+
disabled?: boolean;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
const TextInput = React.forwardRef<NativeTextInput, TextInputProps>(
|
|
@@ -19,6 +20,7 @@ const TextInput = React.forwardRef<NativeTextInput, TextInputProps>(
|
|
|
19
20
|
changeTextDelay = 500,
|
|
20
21
|
webShowOutline = true,
|
|
21
22
|
style,
|
|
23
|
+
disabled,
|
|
22
24
|
value,
|
|
23
25
|
...rest
|
|
24
26
|
},
|
|
@@ -37,6 +39,7 @@ const TextInput = React.forwardRef<NativeTextInput, TextInputProps>(
|
|
|
37
39
|
testID="native-text-input"
|
|
38
40
|
ref={ref}
|
|
39
41
|
value={value}
|
|
42
|
+
editable={!disabled}
|
|
40
43
|
style={[
|
|
41
44
|
//@ts-ignore Web specific prop. Removes default blue outline that appears on the hidden TextInput
|
|
42
45
|
Platform.OS === "web" && !webShowOutline ? { outlineWidth: 0 } : {},
|