@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.
@@ -1 +1 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["onChangeTextDelayed","changeTextDelay","webShowOutline","style","value"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/TextInput.tsx";import React from"react";import{TextInput as NativeTextInput,Platform}from"react-native";import{useDebounce,useOnUpdate}from"../hooks";import{jsx as _jsx}from"react/jsx-runtime";var TextInput=React.forwardRef(function(_ref,ref){var onChangeTextDelayed=_ref.onChangeTextDelayed,_ref$changeTextDelay=_ref.changeTextDelay,changeTextDelay=_ref$changeTextDelay===void 0?500:_ref$changeTextDelay,_ref$webShowOutline=_ref.webShowOutline,webShowOutline=_ref$webShowOutline===void 0?true:_ref$webShowOutline,style=_ref.style,value=_ref.value,rest=_objectWithoutProperties(_ref,_excluded);var delayedValue=useDebounce(value,changeTextDelay);useOnUpdate(function(){if(delayedValue!==undefined){onChangeTextDelayed==null?void 0:onChangeTextDelayed(delayedValue);}},[delayedValue]);return _jsx(NativeTextInput,Object.assign({testID:"native-text-input",ref:ref,value:value,style:[Platform.OS==="web"&&!webShowOutline?{outlineWidth:0}:{},style]},rest));});export default TextInput;
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["onChangeTextDelayed","changeTextDelay","webShowOutline","style","disabled","value"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/TextInput.tsx";import React from"react";import{TextInput as NativeTextInput,Platform}from"react-native";import{useDebounce,useOnUpdate}from"../hooks";import{jsx as _jsx}from"react/jsx-runtime";var TextInput=React.forwardRef(function(_ref,ref){var onChangeTextDelayed=_ref.onChangeTextDelayed,_ref$changeTextDelay=_ref.changeTextDelay,changeTextDelay=_ref$changeTextDelay===void 0?500:_ref$changeTextDelay,_ref$webShowOutline=_ref.webShowOutline,webShowOutline=_ref$webShowOutline===void 0?true:_ref$webShowOutline,style=_ref.style,disabled=_ref.disabled,value=_ref.value,rest=_objectWithoutProperties(_ref,_excluded);var delayedValue=useDebounce(value,changeTextDelay);useOnUpdate(function(){if(delayedValue!==undefined){onChangeTextDelayed==null?void 0:onChangeTextDelayed(delayedValue);}},[delayedValue]);return _jsx(NativeTextInput,Object.assign({testID:"native-text-input",ref:ref,value:value,editable:!disabled,style:[Platform.OS==="web"&&!webShowOutline?{outlineWidth:0}:{},style]},rest));});export default TextInput;
@@ -4,6 +4,7 @@ export interface TextInputProps extends NativeTextInputProps {
4
4
  webShowOutline?: boolean;
5
5
  onChangeTextDelayed?: (text: string) => void;
6
6
  changeTextDelay?: number;
7
+ disabled?: boolean;
7
8
  }
8
9
  declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<NativeTextInput>>;
9
10
  export default TextInput;
@@ -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":["../../../../src/components/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"}
1
+ {"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../../src/components/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"}