@hero-design/rn 8.138.2 → 8.139.0
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/CHANGELOG.md +8 -0
- package/es/index.js +7 -9
- package/lib/index.js +7 -9
- package/package.json +1 -1
- package/src/components/Select/MultiSelect/index.tsx +2 -5
- package/src/components/Select/SingleSelect/index.tsx +2 -5
- package/src/components/Select/types.ts +4 -0
- package/src/components/TextInput/index.tsx +5 -1
- package/types/components/Select/types.d.ts +4 -0
- package/types/components/TextInput/index.d.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @hero-design/rn
|
|
2
2
|
|
|
3
|
+
## 8.139.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#5555](https://github.com/Thinkei/hero-design/pull/5555) [`aca4be8`](https://github.com/Thinkei/hero-design/commit/aca4be85efca246d0ff27d27fe694bed5950fd7c) Thanks [@ttkien](https://github.com/ttkien)! - [Select] Add `disabled` option to `assistiveInfoConfig` so the assistive info trigger no longer follows the select's disabled state by default
|
|
8
|
+
|
|
9
|
+
- [#5555](https://github.com/Thinkei/hero-design/pull/5555) [`aca4be8`](https://github.com/Thinkei/hero-design/commit/aca4be85efca246d0ff27d27fe694bed5950fd7c) Thanks [@ttkien](https://github.com/ttkien)! - [TextInput] Add `disabled` option to `assistiveInfoConfig` so the assistive info trigger no longer follows the field's disabled/readonly/loading state by default
|
|
10
|
+
|
|
3
11
|
## 8.138.2
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/es/index.js
CHANGED
|
@@ -21769,7 +21769,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref8, ref) {
|
|
|
21769
21769
|
onPress: assistiveInfoConfig.onPress,
|
|
21770
21770
|
label: assistiveInfoConfig.label,
|
|
21771
21771
|
testID: assistiveInfoConfig.testID,
|
|
21772
|
-
disabled:
|
|
21772
|
+
disabled: assistiveInfoConfig.disabled
|
|
21773
21773
|
}), /*#__PURE__*/React__default.createElement(StyledErrorAndHelpTextContainer, null, /*#__PURE__*/React__default.createElement(StyledErrorAndMaxLengthContainer, null, renderErrorOrHelpText({
|
|
21774
21774
|
error: error,
|
|
21775
21775
|
helpText: helpText
|
|
@@ -27940,11 +27940,10 @@ function MultiSelect(_ref) {
|
|
|
27940
27940
|
useEffect(function () {
|
|
27941
27941
|
setSelectingValue(value);
|
|
27942
27942
|
}, [open, value]);
|
|
27943
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(View, {
|
|
27944
|
-
pointerEvents: !editable || disabled || inputProps !== null && inputProps !== void 0 && inputProps.loading ? 'none' : 'auto'
|
|
27945
|
-
}, /*#__PURE__*/React__default.createElement(TouchableOpacity, {
|
|
27943
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(View, null, /*#__PURE__*/React__default.createElement(TouchableOpacity, {
|
|
27946
27944
|
onPress: onPress,
|
|
27947
|
-
testID: "multi-select-touchable-opacity"
|
|
27945
|
+
testID: "multi-select-touchable-opacity",
|
|
27946
|
+
disabled: !editable || disabled || (inputProps === null || inputProps === void 0 ? void 0 : inputProps.loading)
|
|
27948
27947
|
}, /*#__PURE__*/React__default.createElement(View, null, /*#__PURE__*/React__default.createElement(TextInput, _extends$1({}, inputProps, {
|
|
27949
27948
|
label: label,
|
|
27950
27949
|
value: renderSelectedValue ? rawValue : displayedValue,
|
|
@@ -28147,11 +28146,10 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
28147
28146
|
}
|
|
28148
28147
|
return undefined;
|
|
28149
28148
|
}, [editable, disabled, open]);
|
|
28150
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(View, {
|
|
28151
|
-
pointerEvents: !editable || disabled || inputProps !== null && inputProps !== void 0 && inputProps.loading ? 'none' : 'auto'
|
|
28152
|
-
}, /*#__PURE__*/React__default.createElement(TouchableOpacity, {
|
|
28149
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(View, null, /*#__PURE__*/React__default.createElement(TouchableOpacity, {
|
|
28153
28150
|
onPress: onPress,
|
|
28154
|
-
testID: "single-select-touchable-opacity"
|
|
28151
|
+
testID: "single-select-touchable-opacity",
|
|
28152
|
+
disabled: !editable || disabled || (inputProps === null || inputProps === void 0 ? void 0 : inputProps.loading)
|
|
28155
28153
|
}, /*#__PURE__*/React__default.createElement(View, null, /*#__PURE__*/React__default.createElement(TextInput, _extends$1({}, inputProps, {
|
|
28156
28154
|
label: label,
|
|
28157
28155
|
value: renderSelectedValue ? rawValue : displayedValue,
|
package/lib/index.js
CHANGED
|
@@ -21798,7 +21798,7 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref8, ref) {
|
|
|
21798
21798
|
onPress: assistiveInfoConfig.onPress,
|
|
21799
21799
|
label: assistiveInfoConfig.label,
|
|
21800
21800
|
testID: assistiveInfoConfig.testID,
|
|
21801
|
-
disabled:
|
|
21801
|
+
disabled: assistiveInfoConfig.disabled
|
|
21802
21802
|
}), /*#__PURE__*/React__namespace.default.createElement(StyledErrorAndHelpTextContainer, null, /*#__PURE__*/React__namespace.default.createElement(StyledErrorAndMaxLengthContainer, null, renderErrorOrHelpText({
|
|
21803
21803
|
error: error,
|
|
21804
21804
|
helpText: helpText
|
|
@@ -27969,11 +27969,10 @@ function MultiSelect(_ref) {
|
|
|
27969
27969
|
React.useEffect(function () {
|
|
27970
27970
|
setSelectingValue(value);
|
|
27971
27971
|
}, [open, value]);
|
|
27972
|
-
return /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, /*#__PURE__*/React__namespace.default.createElement(reactNative.View, {
|
|
27973
|
-
pointerEvents: !editable || disabled || inputProps !== null && inputProps !== void 0 && inputProps.loading ? 'none' : 'auto'
|
|
27974
|
-
}, /*#__PURE__*/React__namespace.default.createElement(reactNative.TouchableOpacity, {
|
|
27972
|
+
return /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, /*#__PURE__*/React__namespace.default.createElement(reactNative.View, null, /*#__PURE__*/React__namespace.default.createElement(reactNative.TouchableOpacity, {
|
|
27975
27973
|
onPress: onPress,
|
|
27976
|
-
testID: "multi-select-touchable-opacity"
|
|
27974
|
+
testID: "multi-select-touchable-opacity",
|
|
27975
|
+
disabled: !editable || disabled || (inputProps === null || inputProps === void 0 ? void 0 : inputProps.loading)
|
|
27977
27976
|
}, /*#__PURE__*/React__namespace.default.createElement(reactNative.View, null, /*#__PURE__*/React__namespace.default.createElement(TextInput, _extends$1({}, inputProps, {
|
|
27978
27977
|
label: label,
|
|
27979
27978
|
value: renderSelectedValue ? rawValue : displayedValue,
|
|
@@ -28176,11 +28175,10 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
28176
28175
|
}
|
|
28177
28176
|
return undefined;
|
|
28178
28177
|
}, [editable, disabled, open]);
|
|
28179
|
-
return /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, /*#__PURE__*/React__namespace.default.createElement(reactNative.View, {
|
|
28180
|
-
pointerEvents: !editable || disabled || inputProps !== null && inputProps !== void 0 && inputProps.loading ? 'none' : 'auto'
|
|
28181
|
-
}, /*#__PURE__*/React__namespace.default.createElement(reactNative.TouchableOpacity, {
|
|
28178
|
+
return /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, /*#__PURE__*/React__namespace.default.createElement(reactNative.View, null, /*#__PURE__*/React__namespace.default.createElement(reactNative.TouchableOpacity, {
|
|
28182
28179
|
onPress: onPress,
|
|
28183
|
-
testID: "single-select-touchable-opacity"
|
|
28180
|
+
testID: "single-select-touchable-opacity",
|
|
28181
|
+
disabled: !editable || disabled || (inputProps === null || inputProps === void 0 ? void 0 : inputProps.loading)
|
|
28184
28182
|
}, /*#__PURE__*/React__namespace.default.createElement(reactNative.View, null, /*#__PURE__*/React__namespace.default.createElement(TextInput, _extends$1({}, inputProps, {
|
|
28185
28183
|
label: label,
|
|
28186
28184
|
value: renderSelectedValue ? rawValue : displayedValue,
|
package/package.json
CHANGED
|
@@ -105,14 +105,11 @@ function MultiSelect<V, T extends SelectOptionType<V>>({
|
|
|
105
105
|
}, [open, value]);
|
|
106
106
|
return (
|
|
107
107
|
<>
|
|
108
|
-
<View
|
|
109
|
-
pointerEvents={
|
|
110
|
-
!editable || disabled || inputProps?.loading ? 'none' : 'auto'
|
|
111
|
-
}
|
|
112
|
-
>
|
|
108
|
+
<View>
|
|
113
109
|
<TouchableOpacity
|
|
114
110
|
onPress={onPress}
|
|
115
111
|
testID="multi-select-touchable-opacity"
|
|
112
|
+
disabled={!editable || disabled || inputProps?.loading}
|
|
116
113
|
>
|
|
117
114
|
{
|
|
118
115
|
// prevent users from focusing TextInput
|
|
@@ -88,14 +88,11 @@ const SingleSelect = <V, T extends SelectOptionType<V>>({
|
|
|
88
88
|
|
|
89
89
|
return (
|
|
90
90
|
<>
|
|
91
|
-
<View
|
|
92
|
-
pointerEvents={
|
|
93
|
-
!editable || disabled || inputProps?.loading ? 'none' : 'auto'
|
|
94
|
-
}
|
|
95
|
-
>
|
|
91
|
+
<View>
|
|
96
92
|
<TouchableOpacity
|
|
97
93
|
onPress={onPress}
|
|
98
94
|
testID="single-select-touchable-opacity"
|
|
95
|
+
disabled={!editable || disabled || inputProps?.loading}
|
|
99
96
|
>
|
|
100
97
|
{
|
|
101
98
|
// prevent users from focusing TextInput
|
|
@@ -105,10 +105,14 @@ export interface SelectProps<V, T extends SelectOptionType<V>>
|
|
|
105
105
|
/**
|
|
106
106
|
* Optional assistive info trigger config. When provided, an info icon is rendered
|
|
107
107
|
* below the field. `onPress` is called when the trigger is tapped.
|
|
108
|
+
* The trigger is always enabled regardless of the field's state (disabled, readonly,
|
|
109
|
+
* loading) so users can still access contextual help. Set `disabled: true` to
|
|
110
|
+
* explicitly suppress the trigger.
|
|
108
111
|
*/
|
|
109
112
|
assistiveInfoConfig?: {
|
|
110
113
|
onPress: () => void;
|
|
111
114
|
label?: string;
|
|
112
115
|
testID?: string;
|
|
116
|
+
disabled?: boolean;
|
|
113
117
|
};
|
|
114
118
|
}
|
|
@@ -145,11 +145,15 @@ export interface TextInputProps extends NativeTextInputProps {
|
|
|
145
145
|
/**
|
|
146
146
|
* Optional assistive info trigger config. When provided, an info icon is rendered
|
|
147
147
|
* below the field. `onPress` is called when the trigger is tapped.
|
|
148
|
+
* The trigger is always enabled regardless of the field's state (disabled, readonly,
|
|
149
|
+
* loading) so users can still access contextual help. Set `disabled: true` to
|
|
150
|
+
* explicitly suppress the trigger.
|
|
148
151
|
*/
|
|
149
152
|
assistiveInfoConfig?: {
|
|
150
153
|
onPress: () => void;
|
|
151
154
|
label?: string;
|
|
152
155
|
testID?: string;
|
|
156
|
+
disabled?: boolean;
|
|
153
157
|
};
|
|
154
158
|
}
|
|
155
159
|
|
|
@@ -592,7 +596,7 @@ const TextInput = forwardRef<TextInputHandles, TextInputProps>(
|
|
|
592
596
|
onPress={assistiveInfoConfig.onPress}
|
|
593
597
|
label={assistiveInfoConfig.label}
|
|
594
598
|
testID={assistiveInfoConfig.testID}
|
|
595
|
-
disabled={
|
|
599
|
+
disabled={assistiveInfoConfig.disabled}
|
|
596
600
|
/>
|
|
597
601
|
)}
|
|
598
602
|
<StyledErrorAndHelpTextContainer>
|
|
@@ -84,10 +84,14 @@ export interface SelectProps<V, T extends SelectOptionType<V>> extends Pick<Text
|
|
|
84
84
|
/**
|
|
85
85
|
* Optional assistive info trigger config. When provided, an info icon is rendered
|
|
86
86
|
* below the field. `onPress` is called when the trigger is tapped.
|
|
87
|
+
* The trigger is always enabled regardless of the field's state (disabled, readonly,
|
|
88
|
+
* loading) so users can still access contextual help. Set `disabled: true` to
|
|
89
|
+
* explicitly suppress the trigger.
|
|
87
90
|
*/
|
|
88
91
|
assistiveInfoConfig?: {
|
|
89
92
|
onPress: () => void;
|
|
90
93
|
label?: string;
|
|
91
94
|
testID?: string;
|
|
95
|
+
disabled?: boolean;
|
|
92
96
|
};
|
|
93
97
|
}
|
|
@@ -97,11 +97,15 @@ export interface TextInputProps extends NativeTextInputProps {
|
|
|
97
97
|
/**
|
|
98
98
|
* Optional assistive info trigger config. When provided, an info icon is rendered
|
|
99
99
|
* below the field. `onPress` is called when the trigger is tapped.
|
|
100
|
+
* The trigger is always enabled regardless of the field's state (disabled, readonly,
|
|
101
|
+
* loading) so users can still access contextual help. Set `disabled: true` to
|
|
102
|
+
* explicitly suppress the trigger.
|
|
100
103
|
*/
|
|
101
104
|
assistiveInfoConfig?: {
|
|
102
105
|
onPress: () => void;
|
|
103
106
|
label?: string;
|
|
104
107
|
testID?: string;
|
|
108
|
+
disabled?: boolean;
|
|
105
109
|
};
|
|
106
110
|
}
|
|
107
111
|
export declare const getState: ({ disabled, error, editable, loading, isEmptyValue, }: {
|