expo-checkbox 2.2.1 → 2.2.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.
package/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoCheckbox.web.d.ts","sourceRoot":"","sources":["../src/ExpoCheckbox.web.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,EAAE,iBAAiB,EAAiB,MAAM,kBAAkB,CAAC;AAEpE,QAAA,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"ExpoCheckbox.web.d.ts","sourceRoot":"","sources":["../src/ExpoCheckbox.web.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,EAAE,iBAAiB,EAAiB,MAAM,kBAAkB,CAAC;AAEpE,QAAA,MAAM,YAAY,EAAE,iBA2CnB,CAAC;AA2DF,eAAe,YAAY,CAAC;AAO5B,eAAO,MAAM,IAAI,iBAAiB,CAAC"}
|
|
@@ -27,7 +27,8 @@ const ExpoCheckbox = (props) => {
|
|
|
27
27
|
value && disabled && styles.fakeControlCheckedAndDisabled,
|
|
28
28
|
] }));
|
|
29
29
|
const nativeControl = createElement('input', {
|
|
30
|
-
|
|
30
|
+
accessibilityChecked: value,
|
|
31
|
+
accessibilityDisabled: disabled,
|
|
31
32
|
checked: value,
|
|
32
33
|
disabled,
|
|
33
34
|
onChange: handleChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoCheckbox.web.js","sourceRoot":"","sources":["../src/ExpoCheckbox.web.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,aAAa;AACb,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,sBAAsB,IAAI,aAAa,EAAE,MAAM,cAAc,CAAC;AAIzF,MAAM,YAAY,GAAsB,CA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;KACzB;CACF,CAAC,CAAC;AAEH,eAAe,YAAY,CAAC;AAE5B,YAAY,CAAC,gBAAgB,GAAG,GAAG,EAAE;IACnC,OAAO,CAAC,IAAI,CAAC,kFAAkF,CAAC,CAAC;IACjG,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAG,cAAc,CAAC","sourcesContent":["/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * see: https://github.com/necolas/react-native-web\n */\n\nimport React, { useCallback } from 'react';\n// @ts-ignore\nimport { StyleSheet, View, unstable_createElement as createElement } from 'react-native';\n\nimport { CheckboxComponent, CheckboxEvent } from './Checkbox.types';\n\nconst ExpoCheckbox: CheckboxComponent = (props) => {\n const { color, disabled, onChange, onValueChange, style, value, ...other } = props;\n\n const handleChange = useCallback(\n (event: CheckboxEvent) => {\n const value = (event.nativeEvent.target as unknown as HTMLInputElement).checked;\n event.nativeEvent.value = value;\n onChange && onChange(event);\n onValueChange && onValueChange(value);\n },\n [onChange, onValueChange]\n );\n\n const fakeControl = (\n <View\n pointerEvents=\"none\"\n style={[\n styles.fakeControl,\n value && styles.fakeControlChecked,\n // custom color\n !!color && { backgroundColor: value ? color : undefined, borderColor: color },\n disabled && styles.fakeControlDisabled,\n value && disabled && styles.fakeControlCheckedAndDisabled,\n ]}\n />\n );\n\n const nativeControl = createElement('input', {\n accessibilityChecked: value,\n accessibilityDisabled: disabled,\n checked: value,\n disabled,\n onChange: handleChange,\n style: [styles.nativeControl, styles.cursorInherit],\n type: 'checkbox',\n });\n\n return (\n <View {...other} style={[styles.root, style, disabled && styles.cursorDefault]}>\n {nativeControl}\n {fakeControl}\n </View>\n );\n};\n\nExpoCheckbox.displayName = 'Checkbox';\n\nconst styles = StyleSheet.create({\n root: {\n // @ts-ignore\n cursor: 'pointer',\n height: 16,\n userSelect: 'none',\n width: 16,\n },\n cursorDefault: {\n // @ts-ignore\n cursor: 'default',\n },\n\n cursorInherit: {\n // @ts-ignore\n cursor: 'inherit',\n },\n fakeControl: {\n ...StyleSheet.absoluteFillObject,\n alignItems: 'center',\n backgroundColor: '#fff',\n borderColor: '#657786',\n borderRadius: 2,\n borderStyle: 'solid',\n borderWidth: 2,\n height: '100%',\n justifyContent: 'center',\n width: '100%',\n },\n fakeControlChecked: {\n backgroundColor: '#009688',\n // @ts-ignore\n backgroundImage:\n 'url(\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgdmVyc2lvbj0iMS4xIgogICB2aWV3Qm94PSIwIDAgMSAxIgogICBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWluWU1pbiBtZWV0Ij4KICA8cGF0aAogICAgIGQ9Ik0gMC4wNDAzODA1OSwwLjYyNjc3NjcgMC4xNDY0NDY2MSwwLjUyMDcxMDY4IDAuNDI5Mjg5MzIsMC44MDM1NTMzOSAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IE0gMC4yMTcxNTcyOSwwLjgwMzU1MzM5IDAuODUzNTUzMzksMC4xNjcxNTcyOSAwLjk1OTYxOTQxLDAuMjczMjIzMyAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IgogICAgIGlkPSJyZWN0Mzc4MCIKICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lIiAvPgo8L3N2Zz4K\")',\n backgroundRepeat: 'no-repeat',\n borderColor: '#009688',\n },\n fakeControlDisabled: {\n borderColor: '#CCD6DD',\n },\n fakeControlCheckedAndDisabled: {\n backgroundColor: '#AAB8C2',\n borderColor: '#AAB8C2',\n },\n nativeControl: {\n ...StyleSheet.absoluteFillObject,\n height: '100%',\n margin: 0,\n padding: 0,\n width: '100%',\n // @ts-ignore\n WebkitAppearance: 'none',\n },\n});\n\nexport default ExpoCheckbox;\n\nExpoCheckbox.isAvailableAsync = () => {\n console.warn('Checkbox.isAvailableAsync() is deprecated and will be removed in future releases');\n return Promise.resolve(true);\n};\n\nexport const name = 'ExpoCheckbox';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-checkbox",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"description": "Basic checkbox for iOS, Android, and web",
|
|
5
5
|
"main": "build/Checkbox.js",
|
|
6
6
|
"types": "build/Checkbox.d.ts",
|
|
@@ -30,10 +30,13 @@
|
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"homepage": "https://docs.expo.dev/versions/latest/sdk/checkbox",
|
|
32
32
|
"devDependencies": {
|
|
33
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
34
|
+
"@testing-library/react": "^13.4.0",
|
|
35
|
+
"@testing-library/react-native": "^11.3.0",
|
|
33
36
|
"expo-module-scripts": "^3.0.0"
|
|
34
37
|
},
|
|
35
38
|
"jest": {
|
|
36
|
-
"preset": "expo-module-scripts
|
|
39
|
+
"preset": "expo-module-scripts"
|
|
37
40
|
},
|
|
38
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "1a87dcc55895a9e16e3d4fd0fa78f2244c1d961f"
|
|
39
42
|
}
|
package/src/ExpoCheckbox.web.tsx
CHANGED
|
@@ -42,7 +42,8 @@ const ExpoCheckbox: CheckboxComponent = (props) => {
|
|
|
42
42
|
);
|
|
43
43
|
|
|
44
44
|
const nativeControl = createElement('input', {
|
|
45
|
-
|
|
45
|
+
accessibilityChecked: value,
|
|
46
|
+
accessibilityDisabled: disabled,
|
|
46
47
|
checked: value,
|
|
47
48
|
disabled,
|
|
48
49
|
onChange: handleChange,
|