@audira/carbon-react-native 1.0.0-beta.17 → 1.0.0-beta.18
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/checkbox/Checkbox.js +5 -5
- package/lib/commonjs/components/checkbox/Checkbox.js.map +1 -1
- package/lib/commonjs/components/checkbox-input/CheckboxInput.js +2 -2
- package/lib/commonjs/components/checkbox-input/CheckboxInput.js.map +1 -1
- package/lib/module/components/checkbox/Checkbox.js +5 -5
- package/lib/module/components/checkbox/Checkbox.js.map +1 -1
- package/lib/module/components/checkbox-input/CheckboxInput.js +2 -2
- package/lib/module/components/checkbox-input/CheckboxInput.js.map +1 -1
- package/lib/typescript/commonjs/components/checkbox/_RefBase.d.ts +2 -2
- package/lib/typescript/commonjs/components/checkbox/_RefBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/checkbox-input/_RefBase.d.ts +2 -2
- package/lib/typescript/commonjs/components/checkbox-input/_RefBase.d.ts.map +1 -1
- package/lib/typescript/module/components/checkbox/_RefBase.d.ts +2 -2
- package/lib/typescript/module/components/checkbox/_RefBase.d.ts.map +1 -1
- package/lib/typescript/module/components/checkbox-input/_RefBase.d.ts +2 -2
- package/lib/typescript/module/components/checkbox-input/_RefBase.d.ts.map +1 -1
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/checkbox/Checkbox.tsx +7 -7
- package/src/components/checkbox/_RefBase.ts +2 -2
- package/src/components/checkbox-input/CheckboxInput.tsx +2 -2
- package/src/components/checkbox-input/_RefBase.ts +2 -2
package/package.json
CHANGED
|
@@ -95,10 +95,10 @@ export const Checkbox = forwardRef<CheckboxRef, CheckboxProps>(
|
|
|
95
95
|
useCallback(event => {
|
|
96
96
|
onPress?.(event)
|
|
97
97
|
if(checkboxInputRef.current) {
|
|
98
|
-
checkboxInputRef.current.
|
|
99
|
-
checkboxInputRef.current.
|
|
98
|
+
checkboxInputRef.current.setChecked(
|
|
99
|
+
checkboxInputRef.current.checked === null
|
|
100
100
|
? true
|
|
101
|
-
: !checkboxInputRef.current.
|
|
101
|
+
: !checkboxInputRef.current.checked,
|
|
102
102
|
)
|
|
103
103
|
}
|
|
104
104
|
}, [
|
|
@@ -110,11 +110,11 @@ export const Checkbox = forwardRef<CheckboxRef, CheckboxProps>(
|
|
|
110
110
|
(viewRef.current ?? {
|
|
111
111
|
}) as View,
|
|
112
112
|
{
|
|
113
|
-
get
|
|
114
|
-
return checkboxInputRef.current!.
|
|
113
|
+
get checked() {
|
|
114
|
+
return checkboxInputRef.current!.checked
|
|
115
115
|
},
|
|
116
|
-
|
|
117
|
-
checkboxInputRef.current?.
|
|
116
|
+
setChecked(value_) {
|
|
117
|
+
checkboxInputRef.current?.setChecked(value_)
|
|
118
118
|
},
|
|
119
119
|
},
|
|
120
120
|
)
|
|
@@ -3,9 +3,9 @@ import type {
|
|
|
3
3
|
} from "../checkbox-input/CheckboxInputRef"
|
|
4
4
|
|
|
5
5
|
export interface RefBase {
|
|
6
|
-
readonly
|
|
6
|
+
readonly checked: CheckboxInputRef["checked"],
|
|
7
7
|
/**
|
|
8
8
|
* This method does nothing when `controlled` prop is true
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
setChecked: CheckboxInputRef["setChecked"],
|
|
11
11
|
}
|
|
@@ -162,10 +162,10 @@ export const CheckboxInput = forwardRef<CheckboxInputRef, CheckboxInputProps>(
|
|
|
162
162
|
return Object.assign<View, RefBase>(
|
|
163
163
|
viewRef.current as View,
|
|
164
164
|
{
|
|
165
|
-
get
|
|
165
|
+
get checked() {
|
|
166
166
|
return checked
|
|
167
167
|
},
|
|
168
|
-
|
|
168
|
+
setChecked(value_) {
|
|
169
169
|
if(!controlled && interactiveState !== "read_only") {
|
|
170
170
|
ref.current.onChangeEffect = true
|
|
171
171
|
setCheckedSelf(self => {
|
|
@@ -3,9 +3,9 @@ import type {
|
|
|
3
3
|
} from "./CheckboxInputState"
|
|
4
4
|
|
|
5
5
|
export interface RefBase {
|
|
6
|
-
readonly
|
|
6
|
+
readonly checked: CheckboxInputState,
|
|
7
7
|
/**
|
|
8
8
|
* This method does nothing when `controlled` prop is true
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
setChecked: (value: CheckboxInputState | ((value: CheckboxInputState) => CheckboxInputState)) => void,
|
|
11
11
|
}
|