@draftbit/core 46.7.9-9ce779.2 → 46.7.9-cfda7d.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 (87) hide show
  1. package/lib/commonjs/components/Accordion/AccordionItem.js +23 -4
  2. package/lib/commonjs/components/AnimatedCircularProgress.js +12 -1
  3. package/lib/commonjs/components/Banner.js +23 -4
  4. package/lib/commonjs/components/Checkbox/context.js +1 -1
  5. package/lib/commonjs/components/CircleImage.js +15 -1
  6. package/lib/commonjs/components/DatePicker/DatePicker.js +6 -0
  7. package/lib/commonjs/components/DeprecatedCardWrapper.js +15 -1
  8. package/lib/commonjs/components/Elevation.js +14 -2
  9. package/lib/commonjs/components/Image.js +17 -2
  10. package/lib/commonjs/components/Picker/Picker.js +7 -1
  11. package/lib/commonjs/components/Picker/PickerComponent.ios.js +36 -11
  12. package/lib/commonjs/components/Picker/PickerComponent.web.js +20 -3
  13. package/lib/commonjs/components/Portal/PortalManager.js +8 -34
  14. package/lib/commonjs/components/ProgressBar.js +37 -7
  15. package/lib/commonjs/components/RadioButton/context.js +1 -1
  16. package/lib/commonjs/constants.js +1 -1
  17. package/lib/commonjs/index.js +0 -13
  18. package/lib/commonjs/mappings/DatePicker.js +6 -1
  19. package/lib/commonjs/mappings/Picker.js +5 -0
  20. package/lib/module/components/AnimatedCircularProgress.js +1 -13
  21. package/lib/module/components/Container.js +4 -17
  22. package/lib/module/components/DatePicker/DatePicker.js +7 -1
  23. package/lib/module/components/Divider.js +1 -18
  24. package/lib/module/components/Picker/Picker.js +8 -2
  25. package/lib/module/components/Picker/PickerComponent.web.js +3 -21
  26. package/lib/module/components/Pressable.js +2 -15
  27. package/lib/module/components/Slider.js +4 -21
  28. package/lib/module/components/StarRating.js +4 -24
  29. package/lib/module/components/StepIndicator.js +18 -58
  30. package/lib/module/components/Switch.js +10 -21
  31. package/lib/module/constants.js +0 -1
  32. package/lib/module/hooks.js +2 -1
  33. package/lib/module/index.js +0 -1
  34. package/lib/module/mappings/DatePicker.js +7 -2
  35. package/lib/module/mappings/Picker.js +6 -1
  36. package/lib/module/styles/overlay.js +3 -1
  37. package/lib/typescript/src/components/DatePicker/DatePicker.d.ts +1 -0
  38. package/lib/typescript/src/components/DatePicker/DatePicker.d.ts.map +1 -1
  39. package/lib/typescript/src/components/Picker/Picker.d.ts +1 -0
  40. package/lib/typescript/src/components/Picker/Picker.d.ts.map +1 -1
  41. package/lib/typescript/src/index.d.ts +0 -1
  42. package/lib/typescript/src/index.d.ts.map +1 -1
  43. package/lib/typescript/src/mappings/DatePicker.d.ts +10 -0
  44. package/lib/typescript/src/mappings/DatePicker.d.ts.map +1 -1
  45. package/lib/typescript/src/mappings/Picker.d.ts +10 -0
  46. package/lib/typescript/src/mappings/Picker.d.ts.map +1 -1
  47. package/package.json +3 -4
  48. package/src/components/DatePicker/DatePicker.js +7 -2
  49. package/src/components/DatePicker/DatePicker.tsx +9 -0
  50. package/src/components/Picker/Picker.js +7 -2
  51. package/src/components/Picker/Picker.tsx +9 -0
  52. package/src/index.js +0 -1
  53. package/src/index.tsx +0 -2
  54. package/src/mappings/DatePicker.js +6 -1
  55. package/src/mappings/DatePicker.ts +6 -0
  56. package/src/mappings/Picker.js +6 -1
  57. package/src/mappings/Picker.ts +6 -0
  58. package/lib/commonjs/components/DeckSwiper/DeckSwiper.js +0 -73
  59. package/lib/commonjs/components/DeckSwiper/DeckSwiperCard.js +0 -35
  60. package/lib/commonjs/components/DeckSwiper/index.js +0 -20
  61. package/lib/commonjs/mappings/DeckSwiper.js +0 -52
  62. package/lib/commonjs/mappings/DeckSwiperCard.js +0 -16
  63. package/lib/module/components/DeckSwiper/DeckSwiper.js +0 -65
  64. package/lib/module/components/DeckSwiper/DeckSwiperCard.js +0 -27
  65. package/lib/module/components/DeckSwiper/index.js +0 -2
  66. package/lib/module/mappings/DeckSwiper.js +0 -45
  67. package/lib/module/mappings/DeckSwiperCard.js +0 -9
  68. package/lib/typescript/src/components/DeckSwiper/DeckSwiper.d.ts +0 -15
  69. package/lib/typescript/src/components/DeckSwiper/DeckSwiper.d.ts.map +0 -1
  70. package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.d.ts +0 -13
  71. package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.d.ts.map +0 -1
  72. package/lib/typescript/src/components/DeckSwiper/index.d.ts +0 -3
  73. package/lib/typescript/src/components/DeckSwiper/index.d.ts.map +0 -1
  74. package/lib/typescript/src/mappings/DeckSwiper.d.ts +0 -83
  75. package/lib/typescript/src/mappings/DeckSwiper.d.ts.map +0 -1
  76. package/lib/typescript/src/mappings/DeckSwiperCard.d.ts +0 -9
  77. package/lib/typescript/src/mappings/DeckSwiperCard.d.ts.map +0 -1
  78. package/src/components/DeckSwiper/DeckSwiper.js +0 -34
  79. package/src/components/DeckSwiper/DeckSwiper.tsx +0 -93
  80. package/src/components/DeckSwiper/DeckSwiperCard.js +0 -22
  81. package/src/components/DeckSwiper/DeckSwiperCard.tsx +0 -42
  82. package/src/components/DeckSwiper/index.js +0 -2
  83. package/src/components/DeckSwiper/index.tsx +0 -2
  84. package/src/mappings/DeckSwiper.js +0 -45
  85. package/src/mappings/DeckSwiper.ts +0 -54
  86. package/src/mappings/DeckSwiperCard.js +0 -9
  87. package/src/mappings/DeckSwiperCard.ts +0 -13
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../../../src/components/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAKL,SAAS,EACT,SAAS,EACT,SAAS,EACT,cAAc,EAKf,MAAM,cAAc,CAAC;AAStB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAStD,aAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,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AS,CAAC,GAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/D,KAAK,EAAE,KAAK,CAAC;IAMb,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,KAAK,IAAI,CAAC;IACrC,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;IACpC,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,GAAG,QAAQ,GACV,cAAc,CAAC;;;;AAsgBjB,wBAAqC"}
@@ -26,6 +26,7 @@ export declare type PickerProps = {
26
26
  placeholderTextColor?: string;
27
27
  rightIconName?: string;
28
28
  type?: "solid" | "underline";
29
+ autoDismissKeyboard?: boolean;
29
30
  theme: Theme;
30
31
  Icon: IconSlot["Icon"];
31
32
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Picker.d.ts","sourceRoot":"","sources":["../../../../../src/components/Picker/Picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAKL,SAAS,EACT,SAAS,EAEV,MAAM,cAAc,CAAC;A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7 +31,6 @@ export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/A
31
31
  export { Swiper, SwiperItem } from "./components/Swiper";
32
32
  export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
33
33
  export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
34
- export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
35
34
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
36
35
  export { default as Picker } from "./components/Picker/Picker";
37
36
  export { default as ProgressBar } from "./components/ProgressBar";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,SAA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AC"}
@@ -18,6 +18,16 @@ export declare const SEED_DATA: {
18
18
  required: boolean;
19
19
  group: string;
20
20
  };
21
+ autoDismissKeyboard: {
22
+ label: string;
23
+ description: string;
24
+ formType: string;
25
+ propType: string;
26
+ defaultValue: boolean;
27
+ editable: boolean;
28
+ required: boolean;
29
+ group: string;
30
+ };
21
31
  mode: {
22
32
  label: string;
23
33
  description: string;
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../../src/mappings/DatePicker.ts"],"names":[],"mappings":"AA+JA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BrB,CAAC"}
1
+ {"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../../src/mappings/DatePicker.ts"],"names":[],"mappings":"AAgKA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCrB,CAAC"}
@@ -40,6 +40,16 @@ export declare const SEED_DATA: {
40
40
  formType: string;
41
41
  propType: string;
42
42
  };
43
+ autoDismissKeyboard: {
44
+ label: string;
45
+ description: string;
46
+ formType: string;
47
+ propType: string;
48
+ defaultValue: boolean;
49
+ editable: boolean;
50
+ required: boolean;
51
+ group: string;
52
+ };
43
53
  label: {
44
54
  group: string;
45
55
  label: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Picker.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Picker.ts"],"names":[],"mappings":"AA8HA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCrB,CAAC"}
1
+ {"version":3,"file":"Picker.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Picker.ts"],"names":[],"mappings":"AA+HA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCrB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.7.9-9ce779.2+9ce7799",
3
+ "version": "46.7.9-cfda7d.2+cfda7de",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -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": "^46.7.9-9ce779.2+9ce7799",
44
+ "@draftbit/types": "^46.7.9-cfda7d.2+cfda7de",
45
45
  "@material-ui/core": "^4.11.0",
46
46
  "@material-ui/pickers": "^3.2.10",
47
47
  "@react-native-community/slider": "4.2.3",
@@ -53,7 +53,6 @@
53
53
  "lodash.isnumber": "^3.0.3",
54
54
  "lodash.omit": "^4.5.0",
55
55
  "lodash.tonumber": "^4.0.3",
56
- "react-native-deck-swiper": "^2.0.12",
57
56
  "react-native-modal-datetime-picker": "^13.0.0",
58
57
  "react-native-svg": "12.3.0",
59
58
  "react-native-typography": "^1.4.1",
@@ -92,5 +91,5 @@
92
91
  ]
93
92
  ]
94
93
  },
95
- "gitHead": "9ce77999dd0ae314668a03f87c7e230da78d3787"
94
+ "gitHead": "cfda7def27e7e26316caa2a8e606a558656b1559"
96
95
  }
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { View, Animated, Text, StyleSheet, I18nManager, TextInput as NativeTextInput, } from "react-native";
2
+ import { View, Animated, Text, StyleSheet, I18nManager, TextInput as NativeTextInput, Keyboard, } from "react-native";
3
3
  import { useSafeAreaInsets } from "react-native-safe-area-context";
4
4
  import dateFormat from "dateformat";
5
5
  import { withTheme } from "../../theming";
@@ -25,7 +25,7 @@ const MONTHS = [
25
25
  "November",
26
26
  "December",
27
27
  ];
28
- const DatePicker = ({ Icon, style, theme: { colors, typography, roundness, disabledOpacity }, date, onDateChange = () => { }, defaultValue, disabled = false, mode = "date", format, type = "underline", leftIconName, rightIconName, leftIconMode = "inset", label, labelSize, labelColor, placeholder, borderColor: inputBorderColor, borderColorActive: inputBorderColorActive, ...props }) => {
28
+ const DatePicker = ({ Icon, style, theme: { colors, typography, roundness, disabledOpacity }, date, onDateChange = () => { }, defaultValue, disabled = false, mode = "date", format, type = "underline", leftIconName, rightIconName, leftIconMode = "inset", label, labelSize, labelColor, placeholder, borderColor: inputBorderColor, borderColorActive: inputBorderColorActive, autoDismissKeyboard = true, ...props }) => {
29
29
  const [value, setValue] = React.useState(date || defaultValue);
30
30
  React.useEffect(() => {
31
31
  if (defaultValue != null) {
@@ -113,6 +113,11 @@ const DatePicker = ({ Icon, style, theme: { colors, typography, roundness, disab
113
113
  clearTimeout(_showPlaceholder());
114
114
  };
115
115
  }, [focused, label, placeholder]);
116
+ React.useEffect(() => {
117
+ if (pickerVisible && autoDismissKeyboard) {
118
+ Keyboard.dismiss();
119
+ }
120
+ }, [pickerVisible, autoDismissKeyboard]);
116
121
  const _handleFocus = () => {
117
122
  if (disabled) {
118
123
  return;
@@ -12,6 +12,7 @@ import {
12
12
  I18nManager,
13
13
  LayoutChangeEvent,
14
14
  TextInput as NativeTextInput,
15
+ Keyboard,
15
16
  } from "react-native";
16
17
  import { useSafeAreaInsets } from "react-native-safe-area-context";
17
18
 
@@ -55,6 +56,7 @@ type Props = {
55
56
  rightIconName?: string;
56
57
  borderColor?: string;
57
58
  borderColorActive?: string;
59
+ autoDismissKeyboard?: boolean;
58
60
  } & IconSlot &
59
61
  TextInputProps;
60
62
 
@@ -93,6 +95,7 @@ const DatePicker: React.FC<React.PropsWithChildren<Props>> = ({
93
95
  placeholder,
94
96
  borderColor: inputBorderColor,
95
97
  borderColorActive: inputBorderColorActive,
98
+ autoDismissKeyboard = true,
96
99
  ...props
97
100
  }) => {
98
101
  const [value, setValue] = React.useState<any>(date || defaultValue);
@@ -204,6 +207,12 @@ const DatePicker: React.FC<React.PropsWithChildren<Props>> = ({
204
207
  };
205
208
  }, [focused, label, placeholder]);
206
209
 
210
+ React.useEffect(() => {
211
+ if (pickerVisible && autoDismissKeyboard) {
212
+ Keyboard.dismiss();
213
+ }
214
+ }, [pickerVisible, autoDismissKeyboard]);
215
+
207
216
  const _handleFocus = () => {
208
217
  if (disabled) {
209
218
  return;
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { View, StyleSheet, Text, Platform, Dimensions, } from "react-native";
2
+ import { View, StyleSheet, Text, Platform, Dimensions, Keyboard, } from "react-native";
3
3
  import { omit, pickBy, identity, isObject } from "lodash";
4
4
  import { SafeAreaView } from "react-native-safe-area-context";
5
5
  import { Picker as NativePicker } from "@react-native-picker/picker";
@@ -35,7 +35,7 @@ const isIos = Platform.OS === "ios";
35
35
  const unstyledColor = "rgba(165, 173, 183, 1)";
36
36
  const disabledColor = "rgb(240, 240, 240)";
37
37
  const errorColor = "rgba(255, 69, 100, 1)";
38
- const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style, placeholder, value, disabled = false, assistiveText, label, iconColor = unstyledColor, iconSize = 24, leftIconMode = "inset", leftIconName, placeholderTextColor = unstyledColor, rightIconName, type = "solid", }) => {
38
+ const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style, placeholder, value, disabled = false, assistiveText, label, iconColor = unstyledColor, iconSize = 24, leftIconMode = "inset", leftIconName, placeholderTextColor = unstyledColor, rightIconName, type = "solid", autoDismissKeyboard = true, }) => {
39
39
  var _a, _b;
40
40
  const androidPickerRef = React.useRef(undefined);
41
41
  const [internalValue, setInternalValue] = React.useState(value || defaultValue);
@@ -59,6 +59,11 @@ const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style,
59
59
  (_a = androidPickerRef === null || androidPickerRef === void 0 ? void 0 : androidPickerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
60
60
  }
61
61
  }, [pickerVisible, androidPickerRef]);
62
+ React.useEffect(() => {
63
+ if (pickerVisible && autoDismissKeyboard) {
64
+ Keyboard.dismiss();
65
+ }
66
+ }, [pickerVisible, autoDismissKeyboard]);
62
67
  const normalizedOptions = normalizeOptions(options);
63
68
  const pickerOptions = placeholder
64
69
  ? [{ value: placeholder, label: placeholder }, ...normalizedOptions]
@@ -7,6 +7,7 @@ import {
7
7
  ViewStyle,
8
8
  StyleProp,
9
9
  Dimensions,
10
+ Keyboard,
10
11
  } from "react-native";
11
12
  import { omit, pickBy, identity, isObject } from "lodash";
12
13
  import { SafeAreaView } from "react-native-safe-area-context";
@@ -48,6 +49,7 @@ export type PickerProps = {
48
49
  placeholderTextColor?: string;
49
50
  rightIconName?: string;
50
51
  type?: "solid" | "underline";
52
+ autoDismissKeyboard?: boolean;
51
53
  theme: Theme;
52
54
  Icon: IconSlot["Icon"];
53
55
  };
@@ -107,6 +109,7 @@ const Picker: React.FC<PickerProps> = ({
107
109
  placeholderTextColor = unstyledColor,
108
110
  rightIconName,
109
111
  type = "solid",
112
+ autoDismissKeyboard = true,
110
113
  }) => {
111
114
  const androidPickerRef = React.useRef<any | undefined>(undefined);
112
115
 
@@ -138,6 +141,12 @@ const Picker: React.FC<PickerProps> = ({
138
141
  }
139
142
  }, [pickerVisible, androidPickerRef]);
140
143
 
144
+ React.useEffect(() => {
145
+ if (pickerVisible && autoDismissKeyboard) {
146
+ Keyboard.dismiss();
147
+ }
148
+ }, [pickerVisible, autoDismissKeyboard]);
149
+
141
150
  const normalizedOptions = normalizeOptions(options);
142
151
 
143
152
  const pickerOptions = placeholder
package/src/index.js CHANGED
@@ -31,7 +31,6 @@ export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/A
31
31
  export { Swiper, SwiperItem } from "./components/Swiper";
32
32
  export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
33
33
  export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
34
- export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
35
34
  /* Deprecated: Fix or Delete! */
36
35
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
37
36
  export { default as Picker } from "./components/Picker/Picker";
package/src/index.tsx CHANGED
@@ -51,8 +51,6 @@ export {
51
51
  RadioButtonFieldGroup,
52
52
  } from "./components/RadioButton/index";
53
53
 
54
- export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
55
-
56
54
  /* Deprecated: Fix or Delete! */
57
55
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
58
56
  export { default as Picker } from "./components/Picker/Picker";
@@ -1,4 +1,4 @@
1
- import { COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, FIELD_NAME, GROUPS, Triggers, StylesPanelSections, createNumberProp, createColorProp, } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, FIELD_NAME, GROUPS, Triggers, StylesPanelSections, createNumberProp, createColorProp, createStaticBoolProp, } from "@draftbit/types";
2
2
  const SEED_DATA_PROPS = {
3
3
  mode: {
4
4
  label: "Mode",
@@ -171,6 +171,11 @@ export const SEED_DATA = [
171
171
  required: true,
172
172
  group: GROUPS.basic,
173
173
  },
174
+ autoDismissKeyboard: createStaticBoolProp({
175
+ label: "Auto dismiss keyboard",
176
+ description: "Automatically dismiss keyboard when DatePicker is opened",
177
+ defaultValue: true,
178
+ }),
174
179
  },
175
180
  },
176
181
  ];
@@ -8,6 +8,7 @@ import {
8
8
  StylesPanelSections,
9
9
  createNumberProp,
10
10
  createColorProp,
11
+ createStaticBoolProp,
11
12
  } from "@draftbit/types";
12
13
 
13
14
  const SEED_DATA_PROPS = {
@@ -185,6 +186,11 @@ export const SEED_DATA = [
185
186
  required: true,
186
187
  group: GROUPS.basic,
187
188
  },
189
+ autoDismissKeyboard: createStaticBoolProp({
190
+ label: "Auto dismiss keyboard",
191
+ description: "Automatically dismiss keyboard when DatePicker is opened",
192
+ defaultValue: true,
193
+ }),
188
194
  },
189
195
  },
190
196
  ];
@@ -1,4 +1,4 @@
1
- import { COMPONENT_TYPES, Triggers, GROUPS, FORM_TYPES, PROP_TYPES, FIELD_NAME, createIconSizeProp, createColorProp, StylesPanelSections, } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, Triggers, GROUPS, FORM_TYPES, PROP_TYPES, FIELD_NAME, createIconSizeProp, createColorProp, StylesPanelSections, createStaticBoolProp, } from "@draftbit/types";
2
2
  const SEED_DATA_PROPS = {
3
3
  label: {
4
4
  group: GROUPS.data,
@@ -142,6 +142,11 @@ export const SEED_DATA = [
142
142
  },
143
143
  iconSize: createIconSizeProp({ defaultValue: 24 }),
144
144
  iconColor: createColorProp({ label: "Icon Color" }),
145
+ autoDismissKeyboard: createStaticBoolProp({
146
+ label: "Auto dismiss keyboard",
147
+ description: "Automatically dismiss keyboard when Picker is opened",
148
+ defaultValue: true,
149
+ }),
145
150
  },
146
151
  layout: {},
147
152
  },
@@ -8,6 +8,7 @@ import {
8
8
  createIconSizeProp,
9
9
  createColorProp,
10
10
  StylesPanelSections,
11
+ createStaticBoolProp,
11
12
  } from "@draftbit/types";
12
13
 
13
14
  const SEED_DATA_PROPS = {
@@ -157,6 +158,11 @@ export const SEED_DATA = [
157
158
  },
158
159
  iconSize: createIconSizeProp({ defaultValue: 24 }),
159
160
  iconColor: createColorProp({ label: "Icon Color" }),
161
+ autoDismissKeyboard: createStaticBoolProp({
162
+ label: "Auto dismiss keyboard",
163
+ description: "Automatically dismiss keyboard when Picker is opened",
164
+ defaultValue: true,
165
+ }),
160
166
  },
161
167
  layout: {},
162
168
  },
@@ -1,73 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _reactNative = require("react-native");
9
- var _reactNativeDeckSwiper = _interopRequireDefault(require("react-native-deck-swiper"));
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- const DeckSwiper = _ref => {
12
- let {
13
- onIndexChanged,
14
- onEndReached,
15
- startCardIndex = 0,
16
- infiniteSwiping = false,
17
- verticalEnabled = true,
18
- horizontalEnabled = true,
19
- visibleCardCount = 1,
20
- style,
21
- children
22
- } = _ref;
23
- const childrenArray = _react.default.useMemo(() => _react.default.Children.toArray(children), [children]);
24
-
25
- // an array of indices based on children count
26
- const cardsFillerData = _react.default.useMemo(() => Array.from(Array(childrenArray.length).keys()), [childrenArray]);
27
-
28
- /**
29
- * By default react-native-deck-swiper positions everything with absolute position
30
- * To overcome this, it is wrapped in a View to be able to add the component in any layout structure
31
- *
32
- * Since all children of that View are absolutley positioned, the View does not have a height and still looks and behaves weird
33
- * To fix/mitage this without setting a static height, the first card is rendered in invisible state to take up space
34
- * This effectivley makes the default height of the container be the height of the first card
35
- */
36
-
37
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
38
- style: styles.containerHeightFiller
39
- }, childrenArray.length && childrenArray[0]), /*#__PURE__*/_react.default.createElement(_reactNativeDeckSwiper.default, {
40
- cards: cardsFillerData,
41
- renderCard: (_, i) => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, childrenArray[i]),
42
- keyExtractor: card => card === null || card === void 0 ? void 0 : card.toString(),
43
- containerStyle: _reactNative.StyleSheet.flatten([styles.cardsContainer, style]),
44
- cardStyle: styles.card,
45
- onSwiped: onIndexChanged,
46
- onSwipedAll: onEndReached,
47
- cardIndex: startCardIndex,
48
- infinite: infiniteSwiping,
49
- verticalSwipe: verticalEnabled,
50
- horizontalSwipe: horizontalEnabled,
51
- showSecondCard: visibleCardCount > 1,
52
- stackSize: visibleCardCount,
53
- backgroundColor: "transparent",
54
- cardVerticalMargin: 0,
55
- cardHorizontalMargin: 0
56
- }));
57
- };
58
- const styles = _reactNative.StyleSheet.create({
59
- cardsContainer: {
60
- width: "100%"
61
- },
62
- card: {
63
- left: 0,
64
- right: 0,
65
- width: "auto",
66
- height: "auto"
67
- },
68
- containerHeightFiller: {
69
- opacity: 0.0
70
- }
71
- });
72
- var _default = DeckSwiper;
73
- exports.default = _default;
@@ -1,35 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _reactNative = require("react-native");
9
- var _theming = require("../../theming");
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- const DeckSwiperCard = _ref => {
12
- let {
13
- style,
14
- children,
15
- theme
16
- } = _ref;
17
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
18
- style: [styles.card, {
19
- backgroundColor: theme.colors.background,
20
- borderRadius: theme.borderRadius.global,
21
- borderColor: theme.colors.divider
22
- }, style]
23
- }, children);
24
- };
25
- const styles = _reactNative.StyleSheet.create({
26
- card: {
27
- flex: 1,
28
- alignItems: "center",
29
- justifyContent: "center",
30
- padding: 20,
31
- borderWidth: 2
32
- }
33
- });
34
- var _default = (0, _theming.withTheme)(DeckSwiperCard);
35
- exports.default = _default;
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "DeckSwiper", {
7
- enumerable: true,
8
- get: function () {
9
- return _DeckSwiper.default;
10
- }
11
- });
12
- Object.defineProperty(exports, "DeckSwiperCard", {
13
- enumerable: true,
14
- get: function () {
15
- return _DeckSwiperCard.default;
16
- }
17
- });
18
- var _DeckSwiper = _interopRequireDefault(require("./DeckSwiper"));
19
- var _DeckSwiperCard = _interopRequireDefault(require("./DeckSwiperCard"));
20
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -1,52 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.SEED_DATA = void 0;
7
- var _types = require("@draftbit/types");
8
- const SEED_DATA = {
9
- name: "Deck Swiper",
10
- tag: "DeckSwiper",
11
- description: "Deck swiper container",
12
- category: _types.COMPONENT_TYPES.swiper,
13
- stylesPanelSections: _types.BLOCK_STYLES_SECTIONS,
14
- triggers: [_types.Triggers.OnIndexChanged, _types.Triggers.OnEndReached],
15
- props: {
16
- onIndexChanged: (0, _types.createActionProp)({
17
- label: "On index changed",
18
- description: "Action to execute when swipe to new index"
19
- }),
20
- onEndReached: (0, _types.createActionProp)({
21
- label: "On end reached",
22
- description: "Action to execute when end of swiping reached"
23
- }),
24
- startCardIndex: (0, _types.createStaticNumberProp)({
25
- label: "Start card index",
26
- description: "Index of card to start swiping from",
27
- defaultValue: 0
28
- }),
29
- infiniteSwiping: (0, _types.createStaticBoolProp)({
30
- label: "Infinite swiping",
31
- description: "Whether to infinitley loop through cards or not"
32
- }),
33
- verticalEnabled: (0, _types.createStaticBoolProp)({
34
- label: "Vertical swipe enabled",
35
- description: "Whether cards should be swipeable vertically or not",
36
- defaultValue: true
37
- }),
38
- horizontalEnabled: (0, _types.createStaticBoolProp)({
39
- label: "Horizontal swipe enabled",
40
- description: "Whether cards should be swipeable horizontally or not",
41
- defaultValue: true
42
- }),
43
- visibleCardCount: (0, _types.createStaticNumberProp)({
44
- label: "Visible card count",
45
- description: "Number of cards visible behind (and including) the current card",
46
- defaultValue: 1,
47
- min: 1,
48
- step: 1
49
- })
50
- }
51
- };
52
- exports.SEED_DATA = SEED_DATA;
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.SEED_DATA = void 0;
7
- var _types = require("@draftbit/types");
8
- const SEED_DATA = {
9
- name: "Deck Swiper Card",
10
- tag: "DeckSwiperCard",
11
- description: "Single Deck Swiper Card item to be used in DeckSwiper",
12
- category: _types.COMPONENT_TYPES.swiper,
13
- stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
14
- props: {}
15
- };
16
- exports.SEED_DATA = SEED_DATA;
@@ -1,65 +0,0 @@
1
- import React from "react";
2
- import { StyleSheet, View } from "react-native";
3
- import DeckSwiperComponent from "react-native-deck-swiper";
4
- const DeckSwiper = _ref => {
5
- let {
6
- onIndexChanged,
7
- onEndReached,
8
- startCardIndex = 0,
9
- infiniteSwiping = false,
10
- verticalEnabled = true,
11
- horizontalEnabled = true,
12
- visibleCardCount = 1,
13
- style,
14
- children
15
- } = _ref;
16
- const childrenArray = React.useMemo(() => React.Children.toArray(children), [children]);
17
-
18
- // an array of indices based on children count
19
- const cardsFillerData = React.useMemo(() => Array.from(Array(childrenArray.length).keys()), [childrenArray]);
20
-
21
- /**
22
- * By default react-native-deck-swiper positions everything with absolute position
23
- * To overcome this, it is wrapped in a View to be able to add the component in any layout structure
24
- *
25
- * Since all children of that View are absolutley positioned, the View does not have a height and still looks and behaves weird
26
- * To fix/mitage this without setting a static height, the first card is rendered in invisible state to take up space
27
- * This effectivley makes the default height of the container be the height of the first card
28
- */
29
-
30
- return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(View, {
31
- style: styles.containerHeightFiller
32
- }, childrenArray.length && childrenArray[0]), /*#__PURE__*/React.createElement(DeckSwiperComponent, {
33
- cards: cardsFillerData,
34
- renderCard: (_, i) => /*#__PURE__*/React.createElement(React.Fragment, null, childrenArray[i]),
35
- keyExtractor: card => card === null || card === void 0 ? void 0 : card.toString(),
36
- containerStyle: StyleSheet.flatten([styles.cardsContainer, style]),
37
- cardStyle: styles.card,
38
- onSwiped: onIndexChanged,
39
- onSwipedAll: onEndReached,
40
- cardIndex: startCardIndex,
41
- infinite: infiniteSwiping,
42
- verticalSwipe: verticalEnabled,
43
- horizontalSwipe: horizontalEnabled,
44
- showSecondCard: visibleCardCount > 1,
45
- stackSize: visibleCardCount,
46
- backgroundColor: "transparent",
47
- cardVerticalMargin: 0,
48
- cardHorizontalMargin: 0
49
- }));
50
- };
51
- const styles = StyleSheet.create({
52
- cardsContainer: {
53
- width: "100%"
54
- },
55
- card: {
56
- left: 0,
57
- right: 0,
58
- width: "auto",
59
- height: "auto"
60
- },
61
- containerHeightFiller: {
62
- opacity: 0.0
63
- }
64
- });
65
- export default DeckSwiper;
@@ -1,27 +0,0 @@
1
- import React from "react";
2
- import { View, StyleSheet } from "react-native";
3
- import { withTheme } from "../../theming";
4
- const DeckSwiperCard = _ref => {
5
- let {
6
- style,
7
- children,
8
- theme
9
- } = _ref;
10
- return /*#__PURE__*/React.createElement(View, {
11
- style: [styles.card, {
12
- backgroundColor: theme.colors.background,
13
- borderRadius: theme.borderRadius.global,
14
- borderColor: theme.colors.divider
15
- }, style]
16
- }, children);
17
- };
18
- const styles = StyleSheet.create({
19
- card: {
20
- flex: 1,
21
- alignItems: "center",
22
- justifyContent: "center",
23
- padding: 20,
24
- borderWidth: 2
25
- }
26
- });
27
- export default withTheme(DeckSwiperCard);
@@ -1,2 +0,0 @@
1
- export { default as DeckSwiper } from "./DeckSwiper";
2
- export { default as DeckSwiperCard } from "./DeckSwiperCard";