@draftbit/core 48.4.9-85e6e7.2 → 48.4.9-a58004.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.
Files changed (54) hide show
  1. package/lib/commonjs/components/Picker/PickerInputContainer.js +1 -1
  2. package/lib/commonjs/components/Picker/dropdown/DropDownPicker.js +1 -0
  3. package/lib/commonjs/components/Picker/dropdown/MultiSelectPicker.js +1 -0
  4. package/lib/commonjs/components/Picker/index.js +1 -1
  5. package/lib/commonjs/index.js +1 -1
  6. package/lib/typescript/src/components/Picker/NativePicker.d.ts +2 -2
  7. package/lib/typescript/src/components/Picker/NativePicker.js +1 -1
  8. package/lib/typescript/src/components/Picker/NativePicker.js.map +1 -1
  9. package/lib/typescript/src/components/Picker/PickerCommon.d.ts +25 -2
  10. package/lib/typescript/src/components/Picker/PickerCommon.js.map +1 -1
  11. package/lib/typescript/src/components/Picker/PickerInputContainer.d.ts +1 -1
  12. package/lib/typescript/src/components/Picker/PickerInputContainer.js +16 -5
  13. package/lib/typescript/src/components/Picker/PickerInputContainer.js.map +1 -1
  14. package/lib/typescript/src/components/Picker/dropdown/DropDownPicker.d.ts +6 -0
  15. package/lib/typescript/src/components/Picker/dropdown/DropDownPicker.js +44 -0
  16. package/lib/typescript/src/components/Picker/dropdown/DropDownPicker.js.map +1 -0
  17. package/lib/typescript/src/components/Picker/dropdown/MultiSelectPicker.d.ts +6 -0
  18. package/lib/typescript/src/components/Picker/dropdown/MultiSelectPicker.js +9 -0
  19. package/lib/typescript/src/components/Picker/dropdown/MultiSelectPicker.js.map +1 -0
  20. package/lib/typescript/src/components/Picker/index.d.ts +6 -4
  21. package/lib/typescript/src/components/Picker/index.js +6 -3
  22. package/lib/typescript/src/components/Picker/index.js.map +1 -1
  23. package/lib/typescript/src/index.d.ts +1 -1
  24. package/lib/typescript/src/index.js +1 -1
  25. package/lib/typescript/src/index.js.map +1 -1
  26. package/lib/typescript/tsconfig.tsbuildinfo +1 -1
  27. package/package.json +3 -3
  28. package/src/components/Picker/NativePicker.js +1 -1
  29. package/src/components/Picker/NativePicker.js.map +1 -1
  30. package/src/components/Picker/NativePicker.tsx +6 -2
  31. package/src/components/Picker/PickerCommon.js.map +1 -1
  32. package/src/components/Picker/PickerCommon.ts +28 -2
  33. package/src/components/Picker/PickerInputContainer.js +16 -5
  34. package/src/components/Picker/PickerInputContainer.js.map +1 -1
  35. package/src/components/Picker/PickerInputContainer.tsx +17 -8
  36. package/src/components/Picker/dropdown/DropDownPicker.js +44 -0
  37. package/src/components/Picker/dropdown/DropDownPicker.js.map +1 -0
  38. package/src/components/Picker/dropdown/DropDownPicker.tsx +122 -0
  39. package/src/components/Picker/dropdown/MultiSelectPicker.js +9 -0
  40. package/src/components/Picker/dropdown/MultiSelectPicker.js.map +1 -0
  41. package/src/components/Picker/dropdown/MultiSelectPicker.tsx +16 -0
  42. package/src/components/Picker/index.js +6 -3
  43. package/src/components/Picker/index.js.map +1 -1
  44. package/src/components/Picker/index.tsx +8 -5
  45. package/src/index.js +1 -1
  46. package/src/index.js.map +1 -1
  47. package/src/index.tsx +1 -1
  48. package/lib/commonjs/components/Picker/DropDownPicker.js +0 -1
  49. package/lib/typescript/src/components/Picker/DropDownPicker.d.ts +0 -4
  50. package/lib/typescript/src/components/Picker/DropDownPicker.js +0 -27
  51. package/lib/typescript/src/components/Picker/DropDownPicker.js.map +0 -1
  52. package/src/components/Picker/DropDownPicker.js +0 -27
  53. package/src/components/Picker/DropDownPicker.js.map +0 -1
  54. package/src/components/Picker/DropDownPicker.tsx +0 -66
@@ -1,66 +0,0 @@
1
- import * as React from "react";
2
- import { Keyboard } from "react-native";
3
- import { useDeepCompareEffect, useDeepCompareMemo } from "../../utilities";
4
- import { CommonPickerProps, normalizeToPickerOptions } from "./PickerCommon";
5
- import PickerInputContainer from "./PickerInputContainer";
6
- import DropDownPickerComponent from "react-native-dropdown-picker";
7
-
8
- const DropDownPicker: React.FC<CommonPickerProps> = ({
9
- options: optionsProp = [],
10
- onValueChange,
11
- Icon,
12
- placeholder,
13
- value,
14
- autoDismissKeyboard = true,
15
- ...rest
16
- }) => {
17
- const [pickerVisible, setPickerVisible] = React.useState(false);
18
- const [internalValue, setInternalValue] = React.useState<string | number>();
19
-
20
- const options = useDeepCompareMemo(
21
- () =>
22
- normalizeToPickerOptions(optionsProp).map((option) => ({
23
- label: option.label.toString(),
24
- value: option.value,
25
- })),
26
- [optionsProp]
27
- );
28
-
29
- useDeepCompareEffect(() => {
30
- onValueChange?.(internalValue || "");
31
- }, [internalValue, onValueChange]);
32
-
33
- React.useEffect(() => {
34
- if (pickerVisible && autoDismissKeyboard) {
35
- Keyboard.dismiss();
36
- }
37
- }, [pickerVisible, autoDismissKeyboard]);
38
-
39
- return (
40
- <PickerInputContainer
41
- Icon={Icon}
42
- placeholder={placeholder}
43
- selectedValue={value}
44
- options={options}
45
- onPress={() => setPickerVisible(!pickerVisible)}
46
- zIndex={pickerVisible ? 100 : undefined} // Guarantees drop down is rendered above all sibling components
47
- {...rest}
48
- >
49
- <DropDownPickerComponent
50
- open={pickerVisible}
51
- setOpen={setPickerVisible}
52
- value={value || null}
53
- setValue={setInternalValue}
54
- items={options}
55
- placeholder={placeholder}
56
- listMode="SCROLLVIEW"
57
- style={{ display: "none" }} // This is the style of the input container
58
- dropDownContainerStyle={{}}
59
- />
60
- </PickerInputContainer>
61
- );
62
- };
63
-
64
- // const styles = StyleSheet.create({});
65
-
66
- export default DropDownPicker;