@tamagui/focusable 1.0.1-beta.140 → 1.0.1-beta.141

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.
File without changes
File without changes
File without changes
File without changes
package/dist/cjs/index.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/esm/index.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -35,9 +35,8 @@ function focusableInputHOC(Component) {
35
35
  const finalProps = isInput ? {
36
36
  ...props,
37
37
  onChangeText(value) {
38
- var _a;
39
38
  inputValue.current = value;
40
- (_a = props.onChangeText) == null ? void 0 : _a.call(props, value);
39
+ props.onChangeText?.(value);
41
40
  }
42
41
  } : props;
43
42
  return <Component ref={combinedRefs} {...finalProps} />;
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/focusableInputHOC.tsx"],
4
4
  "sourcesContent": ["import { composeRefs } from '@tamagui/compose-refs'\nimport { isTamaguiComponent } from '@tamagui/core'\nimport React, { useRef } from 'react'\nimport { forwardRef, useCallback, useEffect } from 'react'\n\nimport { registerFocusable, unregisterFocusable } from './registerFocusable'\n\nexport function focusableInputHOC<A extends Function>(Component: A): A {\n return forwardRef(\n (\n props: {\n id?: string\n onChangeText?: (val: string) => void\n value?: string\n defaultValue?: string\n },\n ref\n ) => {\n const isInput = isTamaguiComponent(Component) && Component.staticConfig.isInput\n const inputValue = useRef(props.value || props.defaultValue || '')\n\n const inputRef = useCallback(\n (input) => {\n if (!props.id) return\n if (!input) return\n registerFocusable(props.id, {\n focus: input.focus,\n\n ...(isInput && {\n // react-native doesn't support programmatic .select()\n focusAndSelect() {\n input.focus()\n if (input.setSelection && typeof inputValue.current === 'string') {\n input.setSelection(0, inputValue.current.length)\n }\n },\n }),\n })\n },\n [props.id]\n )\n\n const combinedRefs = composeRefs(ref, inputRef)\n\n useEffect(() => {\n if (!props.id) return\n return () => {\n unregisterFocusable(props.id!)\n }\n }, [props.id])\n\n const finalProps = isInput\n ? {\n ...props,\n onChangeText(value) {\n inputValue.current = value\n props.onChangeText?.(value)\n },\n }\n : props\n\n return <Component ref={combinedRefs} {...finalProps} />\n }\n ) as any\n}\n"],
5
- "mappings": "AAAA;AACA;AACA;AACA;AAEA;AAEO,2BAA+C,WAAiB;AACrE,SAAO,WACL,CACE,OAMA,QACG;AACH,UAAM,UAAU,mBAAmB,SAAS,KAAK,UAAU,aAAa;AACxE,UAAM,aAAa,OAAO,MAAM,SAAS,MAAM,gBAAgB,EAAE;AAEjE,UAAM,WAAW,YACf,CAAC,UAAU;AACT,UAAI,CAAC,MAAM;AAAI;AACf,UAAI,CAAC;AAAO;AACZ,wBAAkB,MAAM,IAAI;AAAA,QAC1B,OAAO,MAAM;AAAA,QAEb,GAAI,WAAW;AAAA,UAEb,iBAAiB;AACf,kBAAM,MAAM;AACZ,gBAAI,MAAM,gBAAgB,OAAO,WAAW,YAAY,UAAU;AAChE,oBAAM,aAAa,GAAG,WAAW,QAAQ,MAAM;AAAA,YACjD;AAAA,UACF;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH,GACA,CAAC,MAAM,EAAE,CACX;AAEA,UAAM,eAAe,YAAY,KAAK,QAAQ;AAE9C,cAAU,MAAM;AACd,UAAI,CAAC,MAAM;AAAI;AACf,aAAO,MAAM;AACX,4BAAoB,MAAM,EAAG;AAAA,MAC/B;AAAA,IACF,GAAG,CAAC,MAAM,EAAE,CAAC;AAEb,UAAM,aAAa,UACf;AAAA,MACE,GAAG;AAAA,MACH,aAAa,OAAO;AAtDhC;AAuDc,mBAAW,UAAU;AACrB,oBAAM,iBAAN,+BAAqB;AAAA,MACvB;AAAA,IACF,IACA;AAEJ,WAAO,CAAC,UAAU,KAAK,kBAAkB,YAAY;AAAA,EACvD,CACF;AACF;",
5
+ "mappings": "AAAA;AACA;AACA;AACA;AAEA;AAEO,2BAA+C,WAAiB;AACrE,SAAO,WACL,CACE,OAMA,QACG;AACH,UAAM,UAAU,mBAAmB,SAAS,KAAK,UAAU,aAAa;AACxE,UAAM,aAAa,OAAO,MAAM,SAAS,MAAM,gBAAgB,EAAE;AAEjE,UAAM,WAAW,YACf,CAAC,UAAU;AACT,UAAI,CAAC,MAAM;AAAI;AACf,UAAI,CAAC;AAAO;AACZ,wBAAkB,MAAM,IAAI;AAAA,QAC1B,OAAO,MAAM;AAAA,QAEb,GAAI,WAAW;AAAA,UAEb,iBAAiB;AACf,kBAAM,MAAM;AACZ,gBAAI,MAAM,gBAAgB,OAAO,WAAW,YAAY,UAAU;AAChE,oBAAM,aAAa,GAAG,WAAW,QAAQ,MAAM;AAAA,YACjD;AAAA,UACF;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH,GACA,CAAC,MAAM,EAAE,CACX;AAEA,UAAM,eAAe,YAAY,KAAK,QAAQ;AAE9C,cAAU,MAAM;AACd,UAAI,CAAC,MAAM;AAAI;AACf,aAAO,MAAM;AACX,4BAAoB,MAAM,EAAG;AAAA,MAC/B;AAAA,IACF,GAAG,CAAC,MAAM,EAAE,CAAC;AAEb,UAAM,aAAa,UACf;AAAA,MACE,GAAG;AAAA,MACH,aAAa,OAAO;AAClB,mBAAW,UAAU;AACrB,cAAM,eAAe,KAAK;AAAA,MAC5B;AAAA,IACF,IACA;AAEJ,WAAO,CAAC,UAAU,KAAK,kBAAkB,YAAY;AAAA,EACvD,CACF;AACF;",
6
6
  "names": []
7
7
  }
package/dist/jsx/index.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/focusable",
3
- "version": "1.0.1-beta.140",
3
+ "version": "1.0.1-beta.141",
4
4
  "sideEffects": false,
5
5
  "source": "src/index.ts",
6
6
  "types": "./types/index.d.ts",
@@ -22,15 +22,15 @@
22
22
  "clean:build": "tamagui-build clean:build"
23
23
  },
24
24
  "dependencies": {
25
- "@tamagui/compose-refs": "^1.0.1-beta.140",
26
- "@tamagui/core": "^1.0.1-beta.140"
25
+ "@tamagui/compose-refs": "^1.0.1-beta.141",
26
+ "@tamagui/core": "^1.0.1-beta.141"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "react": "*",
30
30
  "react-dom": "*"
31
31
  },
32
32
  "devDependencies": {
33
- "@tamagui/build": "^1.0.1-beta.140",
33
+ "@tamagui/build": "^1.0.1-beta.141",
34
34
  "react": "*",
35
35
  "react-dom": "*"
36
36
  },