@draftbit/core 44.1.12 → 44.1.13-91822a.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.
Files changed (41) hide show
  1. package/lib/commonjs/components/Accordion/AccordionItem.js +21 -5
  2. package/lib/commonjs/components/Accordion/index.js.map +1 -1
  3. package/lib/commonjs/components/Picker/Picker.js +20 -46
  4. package/lib/commonjs/components/Picker/Picker.js.map +1 -1
  5. package/lib/commonjs/components/Picker/PickerComponent.android.js +59 -0
  6. package/lib/commonjs/components/Picker/PickerComponent.android.js.map +1 -0
  7. package/lib/commonjs/components/Picker/PickerComponent.ios.js +87 -0
  8. package/lib/commonjs/components/Picker/PickerComponent.ios.js.map +1 -0
  9. package/lib/commonjs/components/Picker/PickerComponent.web.js +59 -0
  10. package/lib/commonjs/components/Picker/PickerComponent.web.js.map +1 -0
  11. package/lib/commonjs/components/Portal/PortalManager.js.map +1 -1
  12. package/lib/commonjs/components/Swiper/Swiper.js.map +1 -1
  13. package/lib/commonjs/mappings/FAB.js.map +1 -1
  14. package/lib/commonjs/mappings/RadioButtonRow.js.map +1 -1
  15. package/lib/commonjs/mappings/RowBodyIcon.js.map +1 -1
  16. package/lib/commonjs/mappings/ScrollView.js.map +1 -1
  17. package/lib/commonjs/mappings/Slider.js.map +1 -1
  18. package/lib/commonjs/mappings/Swiper.js.map +1 -1
  19. package/lib/commonjs/mappings/View.js.map +1 -1
  20. package/lib/module/components/DatePicker/DatePickerComponent.web.js.map +1 -1
  21. package/lib/module/components/Picker/Picker.js +23 -46
  22. package/lib/module/components/Picker/Picker.js.map +1 -1
  23. package/lib/module/components/Picker/PickerComponent.android.js +41 -0
  24. package/lib/module/components/Picker/PickerComponent.android.js.map +1 -0
  25. package/lib/module/components/Picker/PickerComponent.ios.js +64 -0
  26. package/lib/module/components/Picker/PickerComponent.ios.js.map +1 -0
  27. package/lib/module/components/Picker/PickerComponent.web.js +41 -0
  28. package/lib/module/components/Picker/PickerComponent.web.js.map +1 -0
  29. package/lib/module/components/StepIndicator.js.map +1 -1
  30. package/lib/typescript/src/components/Picker/PickerComponent.android.d.ts +13 -0
  31. package/lib/typescript/src/components/Picker/PickerComponent.ios.d.ts +13 -0
  32. package/lib/typescript/src/components/Picker/PickerComponent.web.d.ts +13 -0
  33. package/package.json +2 -2
  34. package/src/components/Picker/Picker.js +20 -19
  35. package/src/components/Picker/Picker.tsx +27 -12
  36. package/src/components/Picker/PickerComponent.android.js +20 -0
  37. package/src/components/Picker/PickerComponent.android.tsx +59 -0
  38. package/src/components/Picker/PickerComponent.ios.js +40 -0
  39. package/src/components/Picker/PickerComponent.ios.tsx +86 -0
  40. package/src/components/Picker/PickerComponent.web.js +20 -0
  41. package/src/components/Picker/PickerComponent.web.tsx +59 -0
@@ -0,0 +1,20 @@
1
+ import * as React from "react";
2
+ import { StyleSheet, Dimensions } from "react-native";
3
+ import { Picker as NativePicker } from "@react-native-picker/picker";
4
+ const { width: deviceWidth, height: deviceHeight } = Dimensions.get("screen");
5
+ export const PickerComponent = ({ androidPickerRef, togglePickerVisible, pickerOptions, internalValue, handleValueChange, }) => {
6
+ return (React.createElement(NativePicker, { selectedValue: internalValue, onValueChange: handleValueChange, style: styles.nonIosPicker, ref: androidPickerRef, onBlur: togglePickerVisible }, pickerOptions.map((option) => (React.createElement(NativePicker.Item, { label: option.label, value: option.value, key: option.value })))));
7
+ };
8
+ const styles = StyleSheet.create({
9
+ nonIosPicker: {
10
+ opacity: 0,
11
+ position: "absolute",
12
+ top: 0,
13
+ left: 0,
14
+ right: 0,
15
+ bottom: 0,
16
+ width: "100%",
17
+ maxWidth: deviceWidth,
18
+ maxHeight: deviceHeight,
19
+ },
20
+ });
@@ -0,0 +1,59 @@
1
+ import * as React from "react";
2
+ import { StyleSheet, Dimensions } from "react-native";
3
+
4
+ import { Picker as NativePicker } from "@react-native-picker/picker";
5
+
6
+ import type { IconSlot } from "../../interfaces/Icon";
7
+
8
+ import { PickerOption } from "./Picker";
9
+
10
+ const { width: deviceWidth, height: deviceHeight } = Dimensions.get("screen");
11
+
12
+ interface PickerComponentProps {
13
+ Icon: IconSlot["Icon"];
14
+ androidPickerRef: React.RefObject<any>;
15
+ togglePickerVisible: () => void;
16
+ pickerOptions: PickerOption[];
17
+ internalValue: string | undefined;
18
+ handleValueChange: (newValue: string, itemIndex: number) => void;
19
+ }
20
+
21
+ export const PickerComponent: React.FC<PickerComponentProps> = ({
22
+ androidPickerRef,
23
+ togglePickerVisible,
24
+ pickerOptions,
25
+ internalValue,
26
+ handleValueChange,
27
+ }) => {
28
+ return (
29
+ <NativePicker
30
+ selectedValue={internalValue}
31
+ onValueChange={handleValueChange}
32
+ style={styles.nonIosPicker}
33
+ ref={androidPickerRef}
34
+ onBlur={togglePickerVisible}
35
+ >
36
+ {(pickerOptions as unknown as PickerOption[]).map((option) => (
37
+ <NativePicker.Item
38
+ label={option.label}
39
+ value={option.value}
40
+ key={option.value}
41
+ />
42
+ ))}
43
+ </NativePicker>
44
+ );
45
+ };
46
+
47
+ const styles = StyleSheet.create({
48
+ nonIosPicker: {
49
+ opacity: 0,
50
+ position: "absolute",
51
+ top: 0,
52
+ left: 0,
53
+ right: 0,
54
+ bottom: 0,
55
+ width: "100%",
56
+ maxWidth: deviceWidth,
57
+ maxHeight: deviceHeight,
58
+ },
59
+ });