@draftbit/core 48.4.9-5b8587.2 → 48.4.9-85e6e7.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/lib/commonjs/components/Picker/DropDownPicker.js +1 -1
- package/lib/typescript/src/components/Picker/DropDownPicker.d.ts +2 -10
- package/lib/typescript/src/components/Picker/DropDownPicker.js +3 -7
- package/lib/typescript/src/components/Picker/DropDownPicker.js.map +1 -1
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/components/Picker/DropDownPicker.js +3 -7
- package/src/components/Picker/DropDownPicker.js.map +1 -1
- package/src/components/Picker/DropDownPicker.tsx +4 -22
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "48.4.9-
|
|
3
|
+
"version": "48.4.9-85e6e7.2+85e6e70",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"types": "lib/typescript/src/index.d.ts",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/types": "^48.4.9-
|
|
44
|
+
"@draftbit/types": "^48.4.9-85e6e7.2+85e6e70",
|
|
45
45
|
"@expo/vector-icons": "^13.0.0",
|
|
46
46
|
"@material-ui/core": "^4.11.0",
|
|
47
47
|
"@material-ui/pickers": "^3.2.10",
|
|
@@ -102,5 +102,5 @@
|
|
|
102
102
|
],
|
|
103
103
|
"testEnvironment": "node"
|
|
104
104
|
},
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "85e6e704ebcc7a00fe8419f8b2163e07fee1972d"
|
|
106
106
|
}
|
|
@@ -4,8 +4,7 @@ import { useDeepCompareEffect, useDeepCompareMemo } from "../../utilities";
|
|
|
4
4
|
import { normalizeToPickerOptions } from "./PickerCommon";
|
|
5
5
|
import PickerInputContainer from "./PickerInputContainer";
|
|
6
6
|
import DropDownPickerComponent from "react-native-dropdown-picker";
|
|
7
|
-
|
|
8
|
-
const DropDownPicker = ({ theme, options: optionsProp = [], onValueChange, Icon, placeholder, value, autoDismissKeyboard = true, selectedIconColor = theme.colors.strong, selectedIconName = "Feather/check", ...rest }) => {
|
|
7
|
+
const DropDownPicker = ({ options: optionsProp = [], onValueChange, Icon, placeholder, value, autoDismissKeyboard = true, ...rest }) => {
|
|
9
8
|
const [pickerVisible, setPickerVisible] = React.useState(false);
|
|
10
9
|
const [internalValue, setInternalValue] = React.useState();
|
|
11
10
|
const options = useDeepCompareMemo(() => normalizeToPickerOptions(optionsProp).map((option) => ({
|
|
@@ -21,11 +20,8 @@ const DropDownPicker = ({ theme, options: optionsProp = [], onValueChange, Icon,
|
|
|
21
20
|
}
|
|
22
21
|
}, [pickerVisible, autoDismissKeyboard]);
|
|
23
22
|
return (React.createElement(PickerInputContainer, { Icon: Icon, placeholder: placeholder, selectedValue: value, options: options, onPress: () => setPickerVisible(!pickerVisible), zIndex: pickerVisible ? 100 : undefined, ...rest },
|
|
24
|
-
React.createElement(DropDownPickerComponent, { open: pickerVisible, setOpen: setPickerVisible, value: value || null, setValue: setInternalValue, items: options, placeholder: placeholder, listMode: "SCROLLVIEW", style: { display: "none" }, dropDownContainerStyle: {
|
|
25
|
-
borderColor: theme.colors.divider,
|
|
26
|
-
backgroundColor: theme.colors.background,
|
|
27
|
-
}, textStyle: { color: theme.colors.strong }, TickIconComponent: () => (React.createElement(Icon, { name: selectedIconName, size: 20, color: selectedIconColor })) })));
|
|
23
|
+
React.createElement(DropDownPickerComponent, { open: pickerVisible, setOpen: setPickerVisible, value: value || null, setValue: setInternalValue, items: options, placeholder: placeholder, listMode: "SCROLLVIEW", style: { display: "none" }, dropDownContainerStyle: {} })));
|
|
28
24
|
};
|
|
29
25
|
// const styles = StyleSheet.create({});
|
|
30
|
-
export default
|
|
26
|
+
export default DropDownPicker;
|
|
31
27
|
//# sourceMappingURL=DropDownPicker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropDownPicker.js","sourceRoot":"","sources":["DropDownPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAqB,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"DropDownPicker.js","sourceRoot":"","sources":["DropDownPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAqB,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AAEnE,MAAM,cAAc,GAAgC,CAAC,EACnD,OAAO,EAAE,WAAW,GAAG,EAAE,EACzB,aAAa,EACb,IAAI,EACJ,WAAW,EACX,KAAK,EACL,mBAAmB,GAAG,IAAI,EAC1B,GAAG,IAAI,EACR,EAAE,EAAE;IACH,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAmB,CAAC;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CAAC,CAAC;AAEF,wCAAwC;AAExC,eAAe,cAAc,CAAC"}
|
|
@@ -4,25 +4,14 @@ import { useDeepCompareEffect, useDeepCompareMemo } from "../../utilities";
|
|
|
4
4
|
import { CommonPickerProps, normalizeToPickerOptions } from "./PickerCommon";
|
|
5
5
|
import PickerInputContainer from "./PickerInputContainer";
|
|
6
6
|
import DropDownPickerComponent from "react-native-dropdown-picker";
|
|
7
|
-
import { withTheme } from "../../theming";
|
|
8
|
-
import { Theme } from "../../styles/DefaultTheme";
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
selectedIconName?: string;
|
|
12
|
-
selectedIconColor?: string;
|
|
13
|
-
theme: Theme;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const DropDownPicker: React.FC<DropDownPickerProps> = ({
|
|
17
|
-
theme,
|
|
8
|
+
const DropDownPicker: React.FC<CommonPickerProps> = ({
|
|
18
9
|
options: optionsProp = [],
|
|
19
10
|
onValueChange,
|
|
20
11
|
Icon,
|
|
21
12
|
placeholder,
|
|
22
13
|
value,
|
|
23
14
|
autoDismissKeyboard = true,
|
|
24
|
-
selectedIconColor = theme.colors.strong,
|
|
25
|
-
selectedIconName = "Feather/check",
|
|
26
15
|
...rest
|
|
27
16
|
}) => {
|
|
28
17
|
const [pickerVisible, setPickerVisible] = React.useState(false);
|
|
@@ -65,15 +54,8 @@ const DropDownPicker: React.FC<DropDownPickerProps> = ({
|
|
|
65
54
|
items={options}
|
|
66
55
|
placeholder={placeholder}
|
|
67
56
|
listMode="SCROLLVIEW"
|
|
68
|
-
style={{ display: "none" }} //
|
|
69
|
-
dropDownContainerStyle={{
|
|
70
|
-
borderColor: theme.colors.divider,
|
|
71
|
-
backgroundColor: theme.colors.background,
|
|
72
|
-
}}
|
|
73
|
-
textStyle={{ color: theme.colors.strong }}
|
|
74
|
-
TickIconComponent={() => (
|
|
75
|
-
<Icon name={selectedIconName} size={20} color={selectedIconColor} />
|
|
76
|
-
)}
|
|
57
|
+
style={{ display: "none" }} // This is the style of the input container
|
|
58
|
+
dropDownContainerStyle={{}}
|
|
77
59
|
/>
|
|
78
60
|
</PickerInputContainer>
|
|
79
61
|
);
|
|
@@ -81,4 +63,4 @@ const DropDownPicker: React.FC<DropDownPickerProps> = ({
|
|
|
81
63
|
|
|
82
64
|
// const styles = StyleSheet.create({});
|
|
83
65
|
|
|
84
|
-
export default
|
|
66
|
+
export default DropDownPicker;
|