@draftbit/core 46.7.9-28aa70.2 → 46.7.9-3887c4.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/DatePicker/DatePicker.js +14 -1
- package/lib/commonjs/components/Divider.js +14 -1
- package/lib/commonjs/components/Elevation.js +14 -2
- package/lib/commonjs/components/NumberInput.js +10 -10
- package/lib/commonjs/components/Picker/Picker.js +10 -3
- package/lib/commonjs/components/Picker/PickerComponent.android.js +20 -3
- package/lib/commonjs/components/Portal/Portal.js +2 -6
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/index.js +0 -13
- package/lib/commonjs/mappings/Accordion.js +1 -0
- package/lib/commonjs/mappings/AccordionItem.js +1 -0
- package/lib/commonjs/mappings/ActionSheet.js +1 -0
- package/lib/commonjs/mappings/ActionSheetCancel.js +1 -0
- package/lib/commonjs/mappings/ActionSheetItem.js +1 -0
- package/lib/commonjs/mappings/DatePicker.js +8 -2
- package/lib/commonjs/mappings/LinearGradient.js +1 -0
- package/lib/commonjs/mappings/MapCallout.js +1 -0
- package/lib/commonjs/mappings/MapMarker.js +1 -0
- package/lib/commonjs/mappings/MapView.js +1 -0
- package/lib/commonjs/mappings/Picker.js +5 -0
- package/lib/commonjs/mappings/Swiper.js +1 -0
- package/lib/commonjs/mappings/SwiperItem.js +2 -1
- package/lib/commonjs/mappings/TextArea.js +1 -0
- package/lib/commonjs/mappings/TextField.js +1 -0
- package/lib/module/components/AnimatedCircularProgress.js +13 -1
- package/lib/module/components/DatePicker/DatePicker.js +15 -2
- package/lib/module/components/NumberInput.js +10 -10
- package/lib/module/components/Picker/Picker.js +11 -4
- package/lib/module/components/StepIndicator.js +18 -58
- package/lib/module/index.js +0 -1
- package/lib/module/mappings/Accordion.js +2 -1
- package/lib/module/mappings/AccordionItem.js +2 -1
- package/lib/module/mappings/ActionSheet.js +2 -1
- package/lib/module/mappings/ActionSheetCancel.js +2 -1
- package/lib/module/mappings/ActionSheetItem.js +2 -1
- package/lib/module/mappings/DatePicker.js +9 -3
- package/lib/module/mappings/LinearGradient.js +2 -1
- package/lib/module/mappings/MapCallout.js +2 -1
- package/lib/module/mappings/MapMarker.js +2 -1
- package/lib/module/mappings/MapView.js +2 -1
- package/lib/module/mappings/Picker.js +6 -1
- package/lib/module/mappings/Swiper.js +2 -1
- package/lib/module/mappings/SwiperItem.js +3 -2
- package/lib/module/mappings/TextArea.js +2 -1
- package/lib/module/mappings/TextField.js +1 -0
- package/lib/typescript/src/components/DatePicker/DatePicker.d.ts +1 -0
- package/lib/typescript/src/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/lib/typescript/src/components/Picker/Picker.d.ts +1 -0
- package/lib/typescript/src/components/Picker/Picker.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +0 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Accordion.d.ts +1 -0
- package/lib/typescript/src/mappings/Accordion.d.ts.map +1 -1
- package/lib/typescript/src/mappings/AccordionItem.d.ts +1 -0
- package/lib/typescript/src/mappings/AccordionItem.d.ts.map +1 -1
- package/lib/typescript/src/mappings/ActionSheet.d.ts +1 -0
- package/lib/typescript/src/mappings/ActionSheet.d.ts.map +1 -1
- package/lib/typescript/src/mappings/ActionSheetCancel.d.ts +1 -0
- package/lib/typescript/src/mappings/ActionSheetCancel.d.ts.map +1 -1
- package/lib/typescript/src/mappings/ActionSheetItem.d.ts +1 -0
- package/lib/typescript/src/mappings/ActionSheetItem.d.ts.map +1 -1
- package/lib/typescript/src/mappings/DatePicker.d.ts +10 -0
- package/lib/typescript/src/mappings/DatePicker.d.ts.map +1 -1
- package/lib/typescript/src/mappings/LinearGradient.d.ts +1 -0
- package/lib/typescript/src/mappings/LinearGradient.d.ts.map +1 -1
- package/lib/typescript/src/mappings/MapCallout.d.ts +1 -0
- package/lib/typescript/src/mappings/MapCallout.d.ts.map +1 -1
- package/lib/typescript/src/mappings/MapMarker.d.ts +1 -0
- package/lib/typescript/src/mappings/MapMarker.d.ts.map +1 -1
- package/lib/typescript/src/mappings/MapView.d.ts +1 -0
- package/lib/typescript/src/mappings/MapView.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Picker.d.ts +10 -0
- package/lib/typescript/src/mappings/Picker.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Swiper.d.ts +1 -0
- package/lib/typescript/src/mappings/Swiper.d.ts.map +1 -1
- package/lib/typescript/src/mappings/SwiperItem.d.ts +1 -0
- package/lib/typescript/src/mappings/SwiperItem.d.ts.map +1 -1
- package/lib/typescript/src/mappings/TextArea.d.ts +1 -0
- package/lib/typescript/src/mappings/TextArea.d.ts.map +1 -1
- package/lib/typescript/src/mappings/TextField.d.ts +1 -1
- package/lib/typescript/src/mappings/TextField.d.ts.map +1 -1
- package/package.json +3 -4
- package/src/components/DatePicker/DatePicker.js +8 -3
- package/src/components/DatePicker/DatePicker.tsx +10 -1
- package/src/components/NumberInput.js +9 -9
- package/src/components/NumberInput.tsx +11 -11
- package/src/components/Picker/Picker.js +9 -3
- package/src/components/Picker/Picker.tsx +14 -2
- package/src/index.js +0 -1
- package/src/index.tsx +0 -2
- package/src/mappings/Accordion.js +10 -1
- package/src/mappings/Accordion.ts +10 -0
- package/src/mappings/AccordionItem.js +2 -1
- package/src/mappings/AccordionItem.ts +2 -0
- package/src/mappings/ActionSheet.js +2 -1
- package/src/mappings/ActionSheet.ts +7 -1
- package/src/mappings/ActionSheetCancel.js +2 -1
- package/src/mappings/ActionSheetCancel.ts +2 -0
- package/src/mappings/ActionSheetItem.js +2 -1
- package/src/mappings/ActionSheetItem.ts +2 -0
- package/src/mappings/DatePicker.js +8 -2
- package/src/mappings/DatePicker.ts +8 -1
- package/src/mappings/LinearGradient.js +6 -1
- package/src/mappings/LinearGradient.ts +6 -0
- package/src/mappings/MapCallout.js +2 -1
- package/src/mappings/MapCallout.ts +2 -0
- package/src/mappings/MapMarker.js +2 -1
- package/src/mappings/MapMarker.ts +2 -0
- package/src/mappings/MapView.js +2 -1
- package/src/mappings/MapView.ts +2 -0
- package/src/mappings/Picker.js +6 -1
- package/src/mappings/Picker.ts +6 -0
- package/src/mappings/Swiper.js +10 -1
- package/src/mappings/Swiper.ts +10 -0
- package/src/mappings/SwiperItem.js +2 -1
- package/src/mappings/SwiperItem.ts +5 -1
- package/src/mappings/TextArea.js +10 -1
- package/src/mappings/TextArea.ts +10 -0
- package/src/mappings/TextField.js +9 -0
- package/src/mappings/TextField.ts +9 -0
- package/lib/commonjs/components/DeckSwiper/DeckSwiper.js +0 -73
- package/lib/commonjs/components/DeckSwiper/DeckSwiperCard.js +0 -35
- package/lib/commonjs/components/DeckSwiper/index.js +0 -20
- package/lib/commonjs/mappings/DeckSwiper.js +0 -52
- package/lib/commonjs/mappings/DeckSwiperCard.js +0 -16
- package/lib/module/components/DeckSwiper/DeckSwiper.js +0 -65
- package/lib/module/components/DeckSwiper/DeckSwiperCard.js +0 -27
- package/lib/module/components/DeckSwiper/index.js +0 -2
- package/lib/module/mappings/DeckSwiper.js +0 -45
- package/lib/module/mappings/DeckSwiperCard.js +0 -9
- package/lib/typescript/src/components/DeckSwiper/DeckSwiper.d.ts +0 -15
- package/lib/typescript/src/components/DeckSwiper/DeckSwiper.d.ts.map +0 -1
- package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.d.ts +0 -13
- package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.d.ts.map +0 -1
- package/lib/typescript/src/components/DeckSwiper/index.d.ts +0 -3
- package/lib/typescript/src/components/DeckSwiper/index.d.ts.map +0 -1
- package/lib/typescript/src/mappings/DeckSwiper.d.ts +0 -83
- package/lib/typescript/src/mappings/DeckSwiper.d.ts.map +0 -1
- package/lib/typescript/src/mappings/DeckSwiperCard.d.ts +0 -9
- package/lib/typescript/src/mappings/DeckSwiperCard.d.ts.map +0 -1
- package/src/components/DeckSwiper/DeckSwiper.js +0 -34
- package/src/components/DeckSwiper/DeckSwiper.tsx +0 -93
- package/src/components/DeckSwiper/DeckSwiperCard.js +0 -22
- package/src/components/DeckSwiper/DeckSwiperCard.tsx +0 -42
- package/src/components/DeckSwiper/index.js +0 -2
- package/src/components/DeckSwiper/index.tsx +0 -2
- package/src/mappings/DeckSwiper.js +0 -45
- package/src/mappings/DeckSwiper.ts +0 -54
- package/src/mappings/DeckSwiperCard.js +0 -9
- package/src/mappings/DeckSwiperCard.ts +0 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwiperItem.d.ts","sourceRoot":"","sources":["../../../../src/mappings/SwiperItem.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SwiperItem.d.ts","sourceRoot":"","sources":["../../../../src/mappings/SwiperItem.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS;;;;;;;CAOrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../../../../src/mappings/TextArea.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../../../../src/mappings/TextArea.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgSrB,CAAC"}
|
|
@@ -6,6 +6,7 @@ export declare const SEED_DATA: ({
|
|
|
6
6
|
preview_image_url: string;
|
|
7
7
|
supports_list_render: boolean;
|
|
8
8
|
triggers: string[];
|
|
9
|
+
stylesPanelSections: string[];
|
|
9
10
|
props: {
|
|
10
11
|
type: {
|
|
11
12
|
label: string;
|
|
@@ -310,7 +311,6 @@ export declare const SEED_DATA: ({
|
|
|
310
311
|
};
|
|
311
312
|
};
|
|
312
313
|
layout: {};
|
|
313
|
-
stylesPanelSections?: undefined;
|
|
314
314
|
} | {
|
|
315
315
|
name: string;
|
|
316
316
|
tag: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../../src/mappings/TextField.ts"],"names":[],"mappings":"AA6TA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../../src/mappings/TextField.ts"],"names":[],"mappings":"AA6TA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAyGrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.7.9-
|
|
3
|
+
"version": "46.7.9-3887c4.2+3887c44",
|
|
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-
|
|
44
|
+
"@draftbit/types": "^46.7.9-3887c4.2+3887c44",
|
|
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": "
|
|
94
|
+
"gitHead": "3887c445e1c88beaf72bbb1f68574c495ee25108"
|
|
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;
|
|
@@ -132,7 +137,7 @@ const DatePicker = ({ Icon, style, theme: { colors, typography, roundness, disab
|
|
|
132
137
|
? labelSize
|
|
133
138
|
: typography.caption.fontSize;
|
|
134
139
|
const hasActiveOutline = focused;
|
|
135
|
-
let inputTextColor, activeColor, underlineColor, borderColor, placeholderColor, containerStyle, backgroundColor, inputStyle;
|
|
140
|
+
let inputTextColor, activeColor, underlineColor, borderColor = inputBorderColor, placeholderColor, containerStyle, backgroundColor, inputStyle;
|
|
136
141
|
inputTextColor = colors.strong;
|
|
137
142
|
if (disabled) {
|
|
138
143
|
activeColor = colors.light;
|
|
@@ -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;
|
|
@@ -232,7 +241,7 @@ const DatePicker: React.FC<React.PropsWithChildren<Props>> = ({
|
|
|
232
241
|
let inputTextColor,
|
|
233
242
|
activeColor,
|
|
234
243
|
underlineColor,
|
|
235
|
-
borderColor,
|
|
244
|
+
borderColor = inputBorderColor,
|
|
236
245
|
placeholderColor,
|
|
237
246
|
containerStyle: StyleProp<ViewStyle>,
|
|
238
247
|
backgroundColor,
|
|
@@ -20,16 +20,8 @@ const NumberInput = ({ onChangeText, value, defaultValue, ...props }) => {
|
|
|
20
20
|
return valueToFormat.toString();
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
return "
|
|
23
|
+
return "";
|
|
24
24
|
};
|
|
25
|
-
// set currentStringNumberValue as defaultValue prop if there is a differnce on first render only
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
const defaultStringNumberValue = formatValueToStringNumber(defaultValue);
|
|
28
|
-
if (currentStringNumberValue !== defaultStringNumberValue) {
|
|
29
|
-
setCurrentStringNumberValue(defaultStringNumberValue);
|
|
30
|
-
}
|
|
31
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
32
|
-
}, []);
|
|
33
25
|
const handleChangeText = (newValue) => {
|
|
34
26
|
const newStringNumberValue = formatValueToStringNumber(newValue);
|
|
35
27
|
const number = parseFloat(newStringNumberValue);
|
|
@@ -44,6 +36,14 @@ const NumberInput = ({ onChangeText, value, defaultValue, ...props }) => {
|
|
|
44
36
|
}
|
|
45
37
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
46
38
|
}, [value]);
|
|
39
|
+
// set currentStringNumberValue as defaultValue prop if there is a differnce on first render only
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
const defaultStringNumberValue = formatValueToStringNumber(defaultValue);
|
|
42
|
+
if (currentStringNumberValue !== defaultStringNumberValue) {
|
|
43
|
+
setCurrentStringNumberValue(defaultStringNumberValue);
|
|
44
|
+
}
|
|
45
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
46
|
+
}, []);
|
|
47
47
|
return (React.createElement(TextInput, { keyboardType: "numeric", value: currentStringNumberValue, onChangeText: handleChangeText, ...props }));
|
|
48
48
|
};
|
|
49
49
|
export default NumberInput;
|
|
@@ -31,19 +31,9 @@ const NumberInput: FC<Props> = ({
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
return "
|
|
34
|
+
return "";
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
// set currentStringNumberValue as defaultValue prop if there is a differnce on first render only
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
const defaultStringNumberValue = formatValueToStringNumber(defaultValue);
|
|
40
|
-
|
|
41
|
-
if (currentStringNumberValue !== defaultStringNumberValue) {
|
|
42
|
-
setCurrentStringNumberValue(defaultStringNumberValue);
|
|
43
|
-
}
|
|
44
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
45
|
-
}, []);
|
|
46
|
-
|
|
47
37
|
const handleChangeText = (newValue: string) => {
|
|
48
38
|
const newStringNumberValue = formatValueToStringNumber(newValue);
|
|
49
39
|
const number = parseFloat(newStringNumberValue);
|
|
@@ -62,6 +52,16 @@ const NumberInput: FC<Props> = ({
|
|
|
62
52
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
63
53
|
}, [value]);
|
|
64
54
|
|
|
55
|
+
// set currentStringNumberValue as defaultValue prop if there is a differnce on first render only
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
const defaultStringNumberValue = formatValueToStringNumber(defaultValue);
|
|
58
|
+
|
|
59
|
+
if (currentStringNumberValue !== defaultStringNumberValue) {
|
|
60
|
+
setCurrentStringNumberValue(defaultStringNumberValue);
|
|
61
|
+
}
|
|
62
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
63
|
+
}, []);
|
|
64
|
+
|
|
65
65
|
return (
|
|
66
66
|
<TextInput
|
|
67
67
|
keyboardType="numeric"
|
|
@@ -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";
|
|
@@ -32,10 +32,11 @@ function normalizeOptions(options) {
|
|
|
32
32
|
}
|
|
33
33
|
const { width: deviceWidth, height: deviceHeight } = Dimensions.get("screen");
|
|
34
34
|
const isIos = Platform.OS === "ios";
|
|
35
|
+
const isWeb = Platform.OS === "web";
|
|
35
36
|
const unstyledColor = "rgba(165, 173, 183, 1)";
|
|
36
37
|
const disabledColor = "rgb(240, 240, 240)";
|
|
37
38
|
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", }) => {
|
|
39
|
+
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
40
|
var _a, _b;
|
|
40
41
|
const androidPickerRef = React.useRef(undefined);
|
|
41
42
|
const [internalValue, setInternalValue] = React.useState(value || defaultValue);
|
|
@@ -59,6 +60,11 @@ const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style,
|
|
|
59
60
|
(_a = androidPickerRef === null || androidPickerRef === void 0 ? void 0 : androidPickerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
60
61
|
}
|
|
61
62
|
}, [pickerVisible, androidPickerRef]);
|
|
63
|
+
React.useEffect(() => {
|
|
64
|
+
if (pickerVisible && autoDismissKeyboard) {
|
|
65
|
+
Keyboard.dismiss();
|
|
66
|
+
}
|
|
67
|
+
}, [pickerVisible, autoDismissKeyboard]);
|
|
62
68
|
const normalizedOptions = normalizeOptions(options);
|
|
63
69
|
const pickerOptions = placeholder
|
|
64
70
|
? [{ value: placeholder, label: placeholder }, ...normalizedOptions]
|
|
@@ -186,7 +192,7 @@ const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style,
|
|
|
186
192
|
React.createElement(View, { style: styles.iosPickerContent },
|
|
187
193
|
React.createElement(Button, { Icon: Icon, type: "text", onPress: togglePickerVisible, style: styles.iosButton }, "Close"),
|
|
188
194
|
React.createElement(NativePicker, { style: styles.iosNativePicker, selectedValue: internalValue, onValueChange: handleValueChange }, pickerOptions.map((option) => (React.createElement(NativePicker.Item, { label: option.label, value: option.value, key: option.value })))))))) : null,
|
|
189
|
-
!isIos && pickerVisible ? (React.createElement(NativePicker, { enabled:
|
|
195
|
+
!isIos && (pickerVisible || isWeb) ? (React.createElement(NativePicker, { enabled: !disabled, selectedValue: internalValue, onValueChange: handleValueChange, style: styles.nonIosPicker, ref: androidPickerRef, onBlur: () => setPickerVisible(false) }, pickerOptions.map((option) => (React.createElement(NativePicker.Item, { label: option.label, value: option.value, key: option.value }))))) : null));
|
|
190
196
|
};
|
|
191
197
|
const styles = StyleSheet.create({
|
|
192
198
|
marginsContainer: {
|
|
@@ -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
|
};
|
|
@@ -84,6 +86,8 @@ function normalizeOptions(options: PickerProps["options"]): PickerOption[] {
|
|
|
84
86
|
|
|
85
87
|
const { width: deviceWidth, height: deviceHeight } = Dimensions.get("screen");
|
|
86
88
|
const isIos = Platform.OS === "ios";
|
|
89
|
+
const isWeb = Platform.OS === "web";
|
|
90
|
+
|
|
87
91
|
const unstyledColor = "rgba(165, 173, 183, 1)";
|
|
88
92
|
const disabledColor = "rgb(240, 240, 240)";
|
|
89
93
|
const errorColor = "rgba(255, 69, 100, 1)";
|
|
@@ -107,6 +111,7 @@ const Picker: React.FC<PickerProps> = ({
|
|
|
107
111
|
placeholderTextColor = unstyledColor,
|
|
108
112
|
rightIconName,
|
|
109
113
|
type = "solid",
|
|
114
|
+
autoDismissKeyboard = true,
|
|
110
115
|
}) => {
|
|
111
116
|
const androidPickerRef = React.useRef<any | undefined>(undefined);
|
|
112
117
|
|
|
@@ -138,6 +143,12 @@ const Picker: React.FC<PickerProps> = ({
|
|
|
138
143
|
}
|
|
139
144
|
}, [pickerVisible, androidPickerRef]);
|
|
140
145
|
|
|
146
|
+
React.useEffect(() => {
|
|
147
|
+
if (pickerVisible && autoDismissKeyboard) {
|
|
148
|
+
Keyboard.dismiss();
|
|
149
|
+
}
|
|
150
|
+
}, [pickerVisible, autoDismissKeyboard]);
|
|
151
|
+
|
|
141
152
|
const normalizedOptions = normalizeOptions(options);
|
|
142
153
|
|
|
143
154
|
const pickerOptions = placeholder
|
|
@@ -374,9 +385,10 @@ const Picker: React.FC<PickerProps> = ({
|
|
|
374
385
|
) : null}
|
|
375
386
|
|
|
376
387
|
{/* nonIosPicker */}
|
|
377
|
-
{
|
|
388
|
+
{/* Web version is collapsed by default, always show to allow direct expand */}
|
|
389
|
+
{!isIos && (pickerVisible || isWeb) ? (
|
|
378
390
|
<NativePicker
|
|
379
|
-
enabled={
|
|
391
|
+
enabled={!disabled}
|
|
380
392
|
selectedValue={internalValue}
|
|
381
393
|
onValueChange={handleValueChange}
|
|
382
394
|
style={styles.nonIosPicker}
|
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,9 +1,18 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createNumberProp, createIconProp, createTextProp, createStaticBoolProp, createColorProp, } from "@draftbit/types";
|
|
1
|
+
import { COMPONENT_TYPES, createNumberProp, createIconProp, createTextProp, createStaticBoolProp, createColorProp, StylesPanelSections, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Accordion",
|
|
4
4
|
tag: "AccordionGroup",
|
|
5
5
|
description: "An expandable container containing components",
|
|
6
6
|
category: COMPONENT_TYPES.container,
|
|
7
|
+
stylesPanelSections: [
|
|
8
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
9
|
+
StylesPanelSections.Background,
|
|
10
|
+
StylesPanelSections.Size,
|
|
11
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
12
|
+
StylesPanelSections.Position,
|
|
13
|
+
StylesPanelSections.Borders,
|
|
14
|
+
StylesPanelSections.Effects,
|
|
15
|
+
],
|
|
7
16
|
layout: {
|
|
8
17
|
paddingTop: 8,
|
|
9
18
|
paddingRight: 8,
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
createTextProp,
|
|
6
6
|
createStaticBoolProp,
|
|
7
7
|
createColorProp,
|
|
8
|
+
StylesPanelSections,
|
|
8
9
|
} from "@draftbit/types";
|
|
9
10
|
|
|
10
11
|
export const SEED_DATA = {
|
|
@@ -12,6 +13,15 @@ export const SEED_DATA = {
|
|
|
12
13
|
tag: "AccordionGroup",
|
|
13
14
|
description: "An expandable container containing components",
|
|
14
15
|
category: COMPONENT_TYPES.container,
|
|
16
|
+
stylesPanelSections: [
|
|
17
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
18
|
+
StylesPanelSections.Background,
|
|
19
|
+
StylesPanelSections.Size,
|
|
20
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
21
|
+
StylesPanelSections.Position,
|
|
22
|
+
StylesPanelSections.Borders,
|
|
23
|
+
StylesPanelSections.Effects,
|
|
24
|
+
],
|
|
15
25
|
layout: {
|
|
16
26
|
paddingTop: 8,
|
|
17
27
|
paddingRight: 8,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createIconProp, createTextProp, createColorProp, } from "@draftbit/types";
|
|
1
|
+
import { COMPONENT_TYPES, createIconProp, createTextProp, createColorProp, CONTAINER_COMPONENT_STYLES_SECTIONS, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Accordion Item",
|
|
4
4
|
tag: "AccordionItem",
|
|
5
5
|
description: "Item to be used in Accordion",
|
|
6
6
|
category: COMPONENT_TYPES.deprecated,
|
|
7
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
7
8
|
props: {
|
|
8
9
|
icon: createIconProp(),
|
|
9
10
|
label: createTextProp({
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
createIconProp,
|
|
4
4
|
createTextProp,
|
|
5
5
|
createColorProp,
|
|
6
|
+
CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
6
7
|
} from "@draftbit/types";
|
|
7
8
|
|
|
8
9
|
export const SEED_DATA = {
|
|
@@ -10,6 +11,7 @@ export const SEED_DATA = {
|
|
|
10
11
|
tag: "AccordionItem",
|
|
11
12
|
description: "Item to be used in Accordion",
|
|
12
13
|
category: COMPONENT_TYPES.deprecated,
|
|
14
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
13
15
|
props: {
|
|
14
16
|
icon: createIconProp(),
|
|
15
17
|
label: createTextProp({
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createStaticBoolProp, GROUPS } from "@draftbit/types";
|
|
1
|
+
import { COMPONENT_TYPES, createStaticBoolProp, GROUPS, StylesPanelSections, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Action Sheet",
|
|
4
4
|
tag: "ActionSheet",
|
|
5
5
|
description: "Action Sheet container",
|
|
6
6
|
category: COMPONENT_TYPES.actionsheet,
|
|
7
|
+
stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins],
|
|
7
8
|
props: {
|
|
8
9
|
visible: createStaticBoolProp({
|
|
9
10
|
group: GROUPS.data,
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
COMPONENT_TYPES,
|
|
3
|
+
createStaticBoolProp,
|
|
4
|
+
GROUPS,
|
|
5
|
+
StylesPanelSections,
|
|
6
|
+
} from "@draftbit/types";
|
|
2
7
|
|
|
3
8
|
export const SEED_DATA = {
|
|
4
9
|
name: "Action Sheet",
|
|
5
10
|
tag: "ActionSheet",
|
|
6
11
|
description: "Action Sheet container",
|
|
7
12
|
category: COMPONENT_TYPES.actionsheet,
|
|
13
|
+
stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins],
|
|
8
14
|
props: {
|
|
9
15
|
visible: createStaticBoolProp({
|
|
10
16
|
group: GROUPS.data,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createActionProp, createColorProp, createTextProp, GROUPS, Triggers, } from "@draftbit/types";
|
|
1
|
+
import { COMPONENT_TYPES, createActionProp, createColorProp, createTextProp, GROUPS, Triggers, StylesPanelSections, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Action Sheet Cancel",
|
|
4
4
|
tag: "ActionSheetCancel",
|
|
5
5
|
description: "Action Sheet cancel",
|
|
6
|
+
stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins],
|
|
6
7
|
category: COMPONENT_TYPES.actionsheet,
|
|
7
8
|
triggers: [Triggers.OnPress],
|
|
8
9
|
props: {
|
|
@@ -5,12 +5,14 @@ import {
|
|
|
5
5
|
createTextProp,
|
|
6
6
|
GROUPS,
|
|
7
7
|
Triggers,
|
|
8
|
+
StylesPanelSections,
|
|
8
9
|
} from "@draftbit/types";
|
|
9
10
|
|
|
10
11
|
export const SEED_DATA = {
|
|
11
12
|
name: "Action Sheet Cancel",
|
|
12
13
|
tag: "ActionSheetCancel",
|
|
13
14
|
description: "Action Sheet cancel",
|
|
15
|
+
stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins],
|
|
14
16
|
category: COMPONENT_TYPES.actionsheet,
|
|
15
17
|
triggers: [Triggers.OnPress],
|
|
16
18
|
props: {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createActionProp, createColorProp, createTextProp, GROUPS, Triggers, } from "@draftbit/types";
|
|
1
|
+
import { COMPONENT_TYPES, createActionProp, createColorProp, createTextProp, GROUPS, Triggers, StylesPanelSections, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Action Sheet Item",
|
|
4
4
|
tag: "ActionSheetItem",
|
|
5
5
|
description: "Action Sheet item",
|
|
6
6
|
category: COMPONENT_TYPES.actionsheet,
|
|
7
|
+
stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins],
|
|
7
8
|
triggers: [Triggers.OnPress],
|
|
8
9
|
layout: {
|
|
9
10
|
textAlign: "center",
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
createTextProp,
|
|
6
6
|
GROUPS,
|
|
7
7
|
Triggers,
|
|
8
|
+
StylesPanelSections,
|
|
8
9
|
} from "@draftbit/types";
|
|
9
10
|
|
|
10
11
|
export const SEED_DATA = {
|
|
@@ -12,6 +13,7 @@ export const SEED_DATA = {
|
|
|
12
13
|
tag: "ActionSheetItem",
|
|
13
14
|
description: "Action Sheet item",
|
|
14
15
|
category: COMPONENT_TYPES.actionsheet,
|
|
16
|
+
stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins],
|
|
15
17
|
triggers: [Triggers.OnPress],
|
|
16
18
|
layout: {
|
|
17
19
|
textAlign: "center",
|
|
@@ -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",
|
|
@@ -31,7 +31,8 @@ const SEED_DATA_PROPS = {
|
|
|
31
31
|
label: "Border Color",
|
|
32
32
|
}),
|
|
33
33
|
borderColorActive: createColorProp({
|
|
34
|
-
label: "Border Color",
|
|
34
|
+
label: "Active Border Color",
|
|
35
|
+
description: "Color of border when date picker is active",
|
|
35
36
|
}),
|
|
36
37
|
format: {
|
|
37
38
|
label: "Format",
|
|
@@ -171,6 +172,11 @@ export const SEED_DATA = [
|
|
|
171
172
|
required: true,
|
|
172
173
|
group: GROUPS.basic,
|
|
173
174
|
},
|
|
175
|
+
autoDismissKeyboard: createStaticBoolProp({
|
|
176
|
+
label: "Auto dismiss keyboard",
|
|
177
|
+
description: "Automatically dismiss keyboard when DatePicker is opened",
|
|
178
|
+
defaultValue: true,
|
|
179
|
+
}),
|
|
174
180
|
},
|
|
175
181
|
},
|
|
176
182
|
];
|
|
@@ -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 = {
|
|
@@ -42,7 +43,8 @@ const SEED_DATA_PROPS = {
|
|
|
42
43
|
label: "Border Color",
|
|
43
44
|
}),
|
|
44
45
|
borderColorActive: createColorProp({
|
|
45
|
-
label: "Border Color",
|
|
46
|
+
label: "Active Border Color",
|
|
47
|
+
description: "Color of border when date picker is active",
|
|
46
48
|
}),
|
|
47
49
|
format: {
|
|
48
50
|
label: "Format",
|
|
@@ -185,6 +187,11 @@ export const SEED_DATA = [
|
|
|
185
187
|
required: true,
|
|
186
188
|
group: GROUPS.basic,
|
|
187
189
|
},
|
|
190
|
+
autoDismissKeyboard: createStaticBoolProp({
|
|
191
|
+
label: "Auto dismiss keyboard",
|
|
192
|
+
description: "Automatically dismiss keyboard when DatePicker is opened",
|
|
193
|
+
defaultValue: true,
|
|
194
|
+
}),
|
|
188
195
|
},
|
|
189
196
|
},
|
|
190
197
|
];
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { createColorProp, FORM_TYPES, GROUPS, PROP_TYPES, } from "@draftbit/types";
|
|
1
|
+
import { createColorProp, FORM_TYPES, GROUPS, PROP_TYPES, StylesPanelSections, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Linear Gradient",
|
|
4
4
|
tag: "LinearGradient",
|
|
5
5
|
description: "Linear Gradient Component",
|
|
6
6
|
layout: { width: "100%", height: "100%" },
|
|
7
|
+
stylesPanelSections: [
|
|
8
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
9
|
+
StylesPanelSections.Borders,
|
|
10
|
+
StylesPanelSections.Effects,
|
|
11
|
+
],
|
|
7
12
|
props: {
|
|
8
13
|
endY: {
|
|
9
14
|
group: GROUPS.basic,
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
FORM_TYPES,
|
|
4
4
|
GROUPS,
|
|
5
5
|
PROP_TYPES,
|
|
6
|
+
StylesPanelSections,
|
|
6
7
|
} from "@draftbit/types";
|
|
7
8
|
|
|
8
9
|
export const SEED_DATA = {
|
|
@@ -10,6 +11,11 @@ export const SEED_DATA = {
|
|
|
10
11
|
tag: "LinearGradient",
|
|
11
12
|
description: "Linear Gradient Component",
|
|
12
13
|
layout: { width: "100%", height: "100%" },
|
|
14
|
+
stylesPanelSections: [
|
|
15
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
16
|
+
StylesPanelSections.Borders,
|
|
17
|
+
StylesPanelSections.Effects,
|
|
18
|
+
],
|
|
13
19
|
props: {
|
|
14
20
|
endY: {
|
|
15
21
|
group: GROUPS.basic,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createActionProp, createBoolProp, GROUPS, Triggers, } from "@draftbit/types";
|
|
1
|
+
import { COMPONENT_TYPES, createActionProp, createBoolProp, GROUPS, Triggers, CONTAINER_COMPONENT_STYLES_SECTIONS, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Map Callout",
|
|
4
4
|
tag: "MapCallout",
|
|
5
5
|
packageName: "@draftbit/maps",
|
|
6
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
6
7
|
description: "An info window to display on top of a marker when it is clicked",
|
|
7
8
|
category: COMPONENT_TYPES.map,
|
|
8
9
|
triggers: [Triggers.OnPress],
|
|
@@ -4,12 +4,14 @@ import {
|
|
|
4
4
|
createBoolProp,
|
|
5
5
|
GROUPS,
|
|
6
6
|
Triggers,
|
|
7
|
+
CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
7
8
|
} from "@draftbit/types";
|
|
8
9
|
|
|
9
10
|
export const SEED_DATA = {
|
|
10
11
|
name: "Map Callout",
|
|
11
12
|
tag: "MapCallout",
|
|
12
13
|
packageName: "@draftbit/maps",
|
|
14
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
13
15
|
description:
|
|
14
16
|
"An info window to display on top of a marker when it is clicked",
|
|
15
17
|
category: COMPONENT_TYPES.map,
|