@hero-design/rn 8.103.4 → 8.103.5

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,4 +1,4 @@
1
- (node:3329) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
1
+ (node:3289) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
2
2
  (Use `node --trace-warnings ...` to show where the warning was created)
3
3
  
4
4
  src/index.ts → lib/index.js, es/index.js...
@@ -15,9 +15,9 @@ node_modules/d3-selection/src/selection/index.js -> node_modules/d3-selection/sr
15
15
     ~~~~~~~~~~~~~~~~~~~
16
16
  
17
17
  (!) [plugin node-resolve] preferring built-in module 'events' over local alternative at '/home/runner/work/hero-design/hero-design/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning.or passing a function to 'preferBuiltins' to provide more fine-grained control over which built-in modules to prefer.
18
- created lib/index.js, es/index.js in 1m 11.1s
18
+ created lib/index.js, es/index.js in 1m 15.3s
19
19
  
20
20
  /home/runner/work/hero-design/hero-design/packages/rn/src/locales/en_AU.ts, /home/runner/work/hero-design/hero-design/packages/rn/src/locales/en_CA.ts, /home/runner/work/hero-design/hero-design/packages/rn/src/locales/index.ts, /home/runner/work/hero-design/hero-design/packages/rn/src/locales/types.ts → ., ....
21
21
  (!) Generated empty chunks
22
22
  "locales/types" and "locales/types"
23
- created ., . in 22.1s
23
+ created ., . in 20.9s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @hero-design/rn
2
2
 
3
+ ## 8.103.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#4068](https://github.com/Thinkei/hero-design/pull/4068) [`3fd150ed0925245f0c9df0956681f19becac09c7`](https://github.com/Thinkei/hero-design/commit/3fd150ed0925245f0c9df0956681f19becac09c7) Thanks [@ttkien](https://github.com/ttkien)! - [RichTextEditor] apply new TextInput
8
+ [TextInput] update typings
9
+
10
+ - [#4074](https://github.com/Thinkei/hero-design/pull/4074) [`3b1be909daf4d17abe49f37672ecde1ad048ae05`](https://github.com/Thinkei/hero-design/commit/3b1be909daf4d17abe49f37672ecde1ad048ae05) Thanks [@cuongnguyeneh](https://github.com/cuongnguyeneh)! - [PinInput] fix: android lagging issue by replacing keyboardType by inputMode prop
11
+
3
12
  ## 8.103.4
4
13
 
5
14
  ### Patch Changes
package/es/index.js CHANGED
@@ -19987,7 +19987,7 @@ var renderInput$1 = function renderInput(_ref3) {
19987
19987
  renderInputValue = _ref3.renderInputValue,
19988
19988
  ref = _ref3.ref,
19989
19989
  theme = _ref3.theme;
19990
- return renderInputValue ? renderInputValue(nativeInputProps) : /*#__PURE__*/React__default.createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
19990
+ return renderInputValue ? renderInputValue(nativeInputProps, ref) : /*#__PURE__*/React__default.createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
19991
19991
  themeVariant: variant,
19992
19992
  multiline: variant === 'textarea' || nativeInputProps.multiline,
19993
19993
  ref: ref,
@@ -23974,7 +23974,7 @@ var PinInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
23974
23974
  onFocus: focus,
23975
23975
  onBlur: blur,
23976
23976
  pointerEvents: "none",
23977
- keyboardType: "numeric",
23977
+ inputMode: "numeric",
23978
23978
  testID: "pin-hidden-input",
23979
23979
  textContentType: textContentType,
23980
23980
  autoComplete: autoComplete,
package/lib/index.js CHANGED
@@ -20016,7 +20016,7 @@ var renderInput$1 = function renderInput(_ref3) {
20016
20016
  renderInputValue = _ref3.renderInputValue,
20017
20017
  ref = _ref3.ref,
20018
20018
  theme = _ref3.theme;
20019
- return renderInputValue ? renderInputValue(nativeInputProps) : /*#__PURE__*/React__namespace.default.createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
20019
+ return renderInputValue ? renderInputValue(nativeInputProps, ref) : /*#__PURE__*/React__namespace.default.createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
20020
20020
  themeVariant: variant,
20021
20021
  multiline: variant === 'textarea' || nativeInputProps.multiline,
20022
20022
  ref: ref,
@@ -24003,7 +24003,7 @@ var PinInput = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
24003
24003
  onFocus: focus,
24004
24004
  onBlur: blur,
24005
24005
  pointerEvents: "none",
24006
- keyboardType: "numeric",
24006
+ inputMode: "numeric",
24007
24007
  testID: "pin-hidden-input",
24008
24008
  textContentType: textContentType,
24009
24009
  autoComplete: autoComplete,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "8.103.4",
3
+ "version": "8.103.5",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -258,7 +258,7 @@ exports[`rendering renders correctly 1`] = `
258
258
  <TextInput
259
259
  autoFocus={false}
260
260
  editable={true}
261
- keyboardType="numeric"
261
+ inputMode="numeric"
262
262
  onBlur={[Function]}
263
263
  onChangeText={[Function]}
264
264
  onFocus={[Function]}
@@ -573,7 +573,7 @@ exports[`rendering renders correctly when disabled 1`] = `
573
573
  <TextInput
574
574
  autoFocus={false}
575
575
  editable={false}
576
- keyboardType="numeric"
576
+ inputMode="numeric"
577
577
  onBlur={[Function]}
578
578
  onChangeText={[Function]}
579
579
  onFocus={[Function]}
@@ -1018,7 +1018,7 @@ exports[`rendering renders correctly when length is 6 and secure is false 1`] =
1018
1018
  <TextInput
1019
1019
  autoFocus={false}
1020
1020
  editable={true}
1021
- keyboardType="numeric"
1021
+ inputMode="numeric"
1022
1022
  onBlur={[Function]}
1023
1023
  onChangeText={[Function]}
1024
1024
  onFocus={[Function]}
@@ -1386,7 +1386,7 @@ exports[`rendering renders correctly when there is error 1`] = `
1386
1386
  <TextInput
1387
1387
  autoFocus={false}
1388
1388
  editable={true}
1389
- keyboardType="numeric"
1389
+ inputMode="numeric"
1390
1390
  onBlur={[Function]}
1391
1391
  onChangeText={[Function]}
1392
1392
  onFocus={[Function]}
@@ -1702,7 +1702,7 @@ exports[`rendering renders correctly with textContentType and autoComplete 1`] =
1702
1702
  autoComplete="one-time-code"
1703
1703
  autoFocus={false}
1704
1704
  editable={true}
1705
- keyboardType="numeric"
1705
+ inputMode="numeric"
1706
1706
  onBlur={[Function]}
1707
1707
  onChangeText={[Function]}
1708
1708
  onFocus={[Function]}
@@ -231,7 +231,7 @@ const PinInput = forwardRef<PinInputHandler, PinInputProps>(
231
231
  onFocus={focus}
232
232
  onBlur={blur}
233
233
  pointerEvents="none"
234
- keyboardType="numeric"
234
+ inputMode="numeric"
235
235
  testID="pin-hidden-input"
236
236
  textContentType={textContentType}
237
237
  autoComplete={autoComplete}
@@ -13,11 +13,13 @@ import {
13
13
  View,
14
14
  } from 'react-native';
15
15
  import type {
16
- TextInputProps as NativeTextInputProps,
16
+ TextInputProps as RNTextInputProps,
17
17
  StyleProp,
18
18
  ViewStyle,
19
19
  TextStyle,
20
20
  LayoutChangeEvent,
21
+ NativeSyntheticEvent,
22
+ TextInputFocusEventData,
21
23
  } from 'react-native';
22
24
  import {
23
25
  StyledTextInputContainer,
@@ -49,6 +51,23 @@ export type TextInputHandles = Pick<
49
51
 
50
52
  export type TextInputVariant = 'text' | 'textarea';
51
53
 
54
+ type NativeTextInputProps = Omit<RNTextInputProps, 'onFocus' | 'onBlur'> & {
55
+ onFocus?: (
56
+ event?: NativeSyntheticEvent<TextInputFocusEventData>
57
+ ) => void | undefined;
58
+ onBlur?: (
59
+ event?: NativeSyntheticEvent<TextInputFocusEventData>
60
+ ) => void | undefined;
61
+ };
62
+
63
+ export interface TextInputRef {
64
+ focus: () => void;
65
+ blur: () => void;
66
+ clear: () => void;
67
+ isFocused: () => boolean;
68
+ setNativeProps?: (props: RNTextInputProps) => void;
69
+ }
70
+
52
71
  export interface TextInputProps extends NativeTextInputProps {
53
72
  /**
54
73
  * Field label.
@@ -118,7 +137,10 @@ export interface TextInputProps extends NativeTextInputProps {
118
137
  /**
119
138
  * Customise input value renderer
120
139
  */
121
- renderInputValue?: (inputProps: NativeTextInputProps) => React.ReactNode;
140
+ renderInputValue?: (
141
+ inputProps: NativeTextInputProps,
142
+ ref?: React.ForwardedRef<TextInputRef>
143
+ ) => React.ReactNode;
122
144
  /**
123
145
  * Component ref.
124
146
  */
@@ -197,12 +219,15 @@ export const renderInput = ({
197
219
  variant: TextInputVariant;
198
220
  nativeInputProps: NativeTextInputProps;
199
221
  multiline?: boolean;
200
- renderInputValue?: (inputProps: NativeTextInputProps) => React.ReactNode;
222
+ renderInputValue?: (
223
+ inputProps: NativeTextInputProps,
224
+ ref?: React.Ref<TextInputRef>
225
+ ) => React.ReactNode;
201
226
  ref?: React.Ref<RNTextInput>;
202
227
  theme: Theme;
203
228
  }) => {
204
229
  return renderInputValue ? (
205
- renderInputValue(nativeInputProps)
230
+ renderInputValue(nativeInputProps, ref)
206
231
  ) : (
207
232
  <StyledTextInput
208
233
  {...nativeInputProps}
@@ -3,5 +3,10 @@ import DatePicker from './components/DatePicker/index.internal';
3
3
  import TimePicker from './components/TimePicker/index.internal';
4
4
 
5
5
  export * from '.';
6
+ export type {
7
+ MultiSelectProps,
8
+ SingleSelectProps,
9
+ DatePickerProps,
10
+ TimePickerProps,
11
+ } from './types.internal';
6
12
  export { Select, DatePicker, TimePicker };
7
- export type { MultiSelectProps, SingleSelectProps } from './types.internal';
@@ -1,10 +1,9 @@
1
+ import { DatePickerProps } from './components/DatePicker/index.internal';
1
2
  import type {
2
3
  SingleSelectProps,
3
4
  MultiSelectProps,
4
5
  } from './components/Select/index.internal';
5
-
6
- import type { DatePickerProps } from './components/DatePicker/index.internal';
7
- import type { TimePickerProps } from './components/TimePicker/index.internal';
6
+ import { TimePickerProps } from './components/TimePicker/index.internal';
8
7
 
9
8
  export * from './types';
10
9
 
@@ -4840,5 +4840,3 @@ var drawChart = (function (exports) {
4840
4840
  </body>
4841
4841
  </html>
4842
4842
 
4843
- ml>
4844
-