@draftbit/core 43.4.11-ba6514.0 → 43.4.12-58730b.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.
- package/lib/commonjs/components/Accordion/AccordionGroup.js +2 -2
- package/lib/commonjs/components/Accordion/AccordionGroup.js.map +1 -1
- package/lib/commonjs/components/Accordion/AccordionItem.js +5 -21
- package/lib/commonjs/components/Accordion/AccordionItem.js.map +1 -1
- package/lib/commonjs/components/ActionSheet/ActionSheetCancel.js.map +1 -1
- package/lib/commonjs/components/Card.js.map +1 -1
- package/lib/commonjs/components/Checkbox/Checkbox.js +6 -6
- package/lib/commonjs/components/Checkbox/Checkbox.js.map +1 -1
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +142 -0
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js.map +1 -0
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +55 -46
- package/lib/commonjs/components/Checkbox/CheckboxRow.js.map +1 -1
- package/lib/commonjs/components/CircleImage.js +3 -17
- package/lib/commonjs/components/CircleImage.js.map +1 -1
- package/lib/commonjs/components/DatePicker/DatePicker.js +2 -9
- package/lib/commonjs/components/DatePicker/DatePicker.js.map +1 -1
- package/lib/commonjs/components/DeprecatedButton.js +4 -19
- package/lib/commonjs/components/DeprecatedButton.js.map +1 -1
- package/lib/commonjs/components/DeprecatedCardWrapper.js +2 -14
- package/lib/commonjs/components/DeprecatedCardWrapper.js.map +1 -1
- package/lib/commonjs/components/DeprecatedFAB.js +4 -20
- package/lib/commonjs/components/DeprecatedFAB.js.map +1 -1
- package/lib/commonjs/components/Divider.js +13 -3
- package/lib/commonjs/components/Divider.js.map +1 -1
- package/lib/commonjs/components/Elevation.js +14 -3
- package/lib/commonjs/components/Elevation.js.map +1 -1
- package/lib/commonjs/components/FAB.js +5 -19
- package/lib/commonjs/components/FAB.js.map +1 -1
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +10 -30
- package/lib/commonjs/components/Picker/PickerComponent.ios.js.map +1 -1
- package/lib/commonjs/components/Portal/Portal.js.map +1 -1
- package/lib/commonjs/components/Portal/PortalHost.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js.map +1 -1
- package/lib/commonjs/components/RadioButton/context.js +1 -1
- package/lib/commonjs/components/RadioButton/context.js.map +1 -1
- package/lib/commonjs/components/RadioButton/index.js.map +1 -1
- package/lib/commonjs/components/Slider.js +5 -22
- package/lib/commonjs/components/Slider.js.map +1 -1
- package/lib/commonjs/components/StarRating.js +5 -23
- package/lib/commonjs/components/StarRating.js.map +1 -1
- package/lib/commonjs/components/TextField.js +13 -26
- package/lib/commonjs/components/TextField.js.map +1 -1
- package/lib/commonjs/hooks.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mappings/AvatarEdit.js.map +1 -1
- package/lib/commonjs/mappings/CheckboxRow.js +25 -6
- package/lib/commonjs/mappings/CheckboxRow.js.map +1 -1
- package/lib/commonjs/mappings/FlatList.js.map +1 -1
- package/lib/commonjs/mappings/Icon.js +3 -1
- package/lib/commonjs/mappings/Icon.js.map +1 -1
- package/lib/commonjs/mappings/KeyboardAwareScrollView.js +48 -0
- package/lib/commonjs/mappings/KeyboardAwareScrollView.js.map +1 -0
- package/lib/commonjs/mappings/Modal.js.map +1 -1
- package/lib/commonjs/mappings/RowBodyIcon.js.map +1 -1
- package/lib/commonjs/mappings/Surface.js.map +1 -1
- package/lib/commonjs/mappings/Switch.js.map +1 -1
- package/lib/commonjs/styles/fonts.js.map +1 -1
- package/lib/commonjs/styles/overlay.js.map +1 -1
- package/lib/commonjs/theming.js.map +1 -1
- package/lib/module/components/Accordion/AccordionGroup.js +2 -2
- package/lib/module/components/Accordion/AccordionGroup.js.map +1 -1
- package/lib/module/components/Checkbox/Checkbox.js +6 -6
- package/lib/module/components/Checkbox/Checkbox.js.map +1 -1
- package/lib/module/components/Checkbox/CheckboxGroupRow.js +120 -0
- package/lib/module/components/Checkbox/CheckboxGroupRow.js.map +1 -0
- package/lib/module/components/Checkbox/CheckboxRow.js +53 -46
- package/lib/module/components/Checkbox/CheckboxRow.js.map +1 -1
- package/lib/module/components/DatePicker/DatePicker.js +3 -9
- package/lib/module/components/DatePicker/DatePicker.js.map +1 -1
- package/lib/module/components/RadioButton/RadioButtonRow.js +1 -1
- package/lib/module/components/RadioButton/RadioButtonRow.js.map +1 -1
- package/lib/module/components/RadioButton/index.js.map +1 -1
- package/lib/module/components/TextField.js +8 -5
- package/lib/module/components/TextField.js.map +1 -1
- package/lib/module/mappings/CheckboxRow.js +26 -7
- package/lib/module/mappings/CheckboxRow.js.map +1 -1
- package/lib/module/mappings/Icon.js +3 -1
- package/lib/module/mappings/Icon.js.map +1 -1
- package/lib/module/mappings/KeyboardAwareScrollView.js +39 -0
- package/lib/module/mappings/KeyboardAwareScrollView.js.map +1 -0
- package/lib/typescript/src/components/Checkbox/CheckboxGroupRow.d.ts +21 -0
- package/lib/typescript/src/components/Checkbox/CheckboxRow.d.ts +3 -7
- package/lib/typescript/src/mappings/CheckboxRow.d.ts +50 -9
- package/lib/typescript/src/mappings/Icon.d.ts +1 -1
- package/lib/typescript/src/mappings/KeyboardAwareScrollView.d.ts +82 -0
- package/package.json +2 -2
- package/src/components/Accordion/AccordionGroup.js +1 -1
- package/src/components/Accordion/AccordionGroup.tsx +1 -1
- package/src/components/Checkbox/Checkbox.js +6 -6
- package/src/components/Checkbox/Checkbox.tsx +8 -6
- package/src/components/Checkbox/CheckboxGroupRow.js +77 -0
- package/src/components/Checkbox/CheckboxGroupRow.tsx +152 -0
- package/src/components/Checkbox/CheckboxRow.js +33 -32
- package/src/components/Checkbox/CheckboxRow.tsx +67 -62
- package/src/components/DatePicker/DatePicker.js +2 -4
- package/src/components/DatePicker/DatePicker.tsx +1 -14
- package/src/components/RadioButton/RadioButtonRow.js +1 -1
- package/src/components/RadioButton/RadioButtonRow.tsx +1 -1
- package/src/components/TextField.js +5 -4
- package/src/components/TextField.tsx +6 -5
- package/src/mappings/CheckboxRow.js +26 -7
- package/src/mappings/CheckboxRow.ts +28 -6
- package/src/mappings/Icon.js +4 -1
- package/src/mappings/Icon.ts +4 -1
- package/src/mappings/KeyboardAwareScrollView.js +38 -0
- package/src/mappings/KeyboardAwareScrollView.ts +48 -0
|
@@ -7,85 +7,93 @@ import {
|
|
|
7
7
|
View,
|
|
8
8
|
Platform,
|
|
9
9
|
} from "react-native";
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
import { useCheckboxGroupContext } from "./context";
|
|
10
|
+
import { isString } from "lodash";
|
|
11
|
+
|
|
13
12
|
import type { IconSlot } from "../../interfaces/Icon";
|
|
14
|
-
import { Direction as GroupDirection } from "./context";
|
|
15
|
-
import Touchable from "../Touchable";
|
|
16
13
|
import { extractStyles } from "../../utilities";
|
|
14
|
+
import { usePrevious } from "../../hooks";
|
|
15
|
+
import Text from "../Text";
|
|
16
|
+
import Touchable from "../Touchable";
|
|
17
|
+
import Checkbox, { CheckboxProps } from "./Checkbox";
|
|
17
18
|
|
|
18
19
|
export enum Direction {
|
|
19
20
|
Row = "row",
|
|
20
21
|
RowReverse = "row-reverse",
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
export interface CheckboxRowProps extends
|
|
24
|
+
export interface CheckboxRowProps extends CheckboxProps {
|
|
24
25
|
label: string | React.ReactNode;
|
|
25
|
-
|
|
26
|
+
labelStyle?: StyleProp<TextStyle>;
|
|
26
27
|
labelContainerStyle: StyleProp<ViewStyle>;
|
|
27
28
|
checkboxStyle?: StyleProp<ViewStyle>;
|
|
28
|
-
labelStyle?: StyleProp<TextStyle>;
|
|
29
|
-
onPress?: (value: boolean) => void;
|
|
30
29
|
direction?: Direction;
|
|
31
|
-
color: string;
|
|
32
|
-
unselectedColor: string;
|
|
33
30
|
}
|
|
34
31
|
|
|
35
|
-
const getCheckboxAlignment = (
|
|
36
|
-
parentDirection: GroupDirection | undefined,
|
|
37
|
-
direction: Direction
|
|
38
|
-
) => {
|
|
39
|
-
if (parentDirection === GroupDirection.Horizontal) {
|
|
40
|
-
return direction === Direction.Row ? "flex-start" : "flex-end";
|
|
41
|
-
} else if (direction === Direction.RowReverse) {
|
|
42
|
-
return "flex-start";
|
|
43
|
-
} else {
|
|
44
|
-
return "flex-end";
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
|
|
48
32
|
const renderLabel = (
|
|
49
33
|
value: string | React.ReactNode,
|
|
50
34
|
labelStyle: StyleProp<TextStyle>,
|
|
51
35
|
textStyle: StyleProp<TextStyle>
|
|
52
36
|
) => {
|
|
53
|
-
if (
|
|
54
|
-
return <Text style={[
|
|
37
|
+
if (isString(value)) {
|
|
38
|
+
return <Text style={[textStyle, labelStyle]}>{value}</Text>;
|
|
55
39
|
} else {
|
|
56
40
|
return <>{value}</>;
|
|
57
41
|
}
|
|
58
42
|
};
|
|
59
43
|
|
|
60
44
|
const CheckboxRow: React.FC<CheckboxRowProps & IconSlot> = ({
|
|
61
|
-
Icon,
|
|
62
45
|
label = "Label",
|
|
63
|
-
status,
|
|
64
|
-
value,
|
|
65
|
-
onPress = () => {},
|
|
66
|
-
labelContainerStyle,
|
|
67
46
|
labelStyle,
|
|
47
|
+
labelContainerStyle,
|
|
68
48
|
checkboxStyle,
|
|
69
49
|
direction = Direction.Row,
|
|
70
|
-
|
|
71
|
-
|
|
50
|
+
Icon,
|
|
51
|
+
status,
|
|
52
|
+
disabled = false,
|
|
53
|
+
onPress,
|
|
54
|
+
onCheck,
|
|
55
|
+
onUncheck,
|
|
72
56
|
color,
|
|
73
57
|
uncheckedColor,
|
|
58
|
+
defaultValue,
|
|
59
|
+
checkedIcon,
|
|
60
|
+
uncheckedIcon,
|
|
61
|
+
size,
|
|
62
|
+
style,
|
|
74
63
|
...rest
|
|
75
64
|
}) => {
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
direction: parentDirection,
|
|
80
|
-
} = useCheckboxGroupContext();
|
|
65
|
+
const [internalValue, setInternalValue] = React.useState<boolean>(
|
|
66
|
+
status || defaultValue || false
|
|
67
|
+
);
|
|
81
68
|
|
|
82
|
-
|
|
83
|
-
|
|
69
|
+
React.useEffect(() => {
|
|
70
|
+
if (status != null) {
|
|
71
|
+
setInternalValue(status);
|
|
72
|
+
}
|
|
73
|
+
}, [status]);
|
|
74
|
+
|
|
75
|
+
// This special logic is to handle weird APIs like Airtable that return
|
|
76
|
+
// true or undefined for a boolean
|
|
77
|
+
const previousDefaultValue = usePrevious(defaultValue) as boolean | undefined;
|
|
78
|
+
|
|
79
|
+
React.useEffect(() => {
|
|
80
|
+
if (defaultValue !== previousDefaultValue) {
|
|
81
|
+
setInternalValue(Boolean(defaultValue));
|
|
82
|
+
}
|
|
83
|
+
}, [defaultValue, previousDefaultValue]);
|
|
84
84
|
|
|
85
85
|
const handlePress = () => {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
const newValue = !internalValue;
|
|
87
|
+
|
|
88
|
+
setInternalValue(newValue);
|
|
89
|
+
onPress?.(newValue);
|
|
90
|
+
|
|
91
|
+
if (newValue) {
|
|
92
|
+
onCheck?.();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (!newValue) {
|
|
96
|
+
onUncheck?.();
|
|
89
97
|
}
|
|
90
98
|
};
|
|
91
99
|
|
|
@@ -94,7 +102,7 @@ const CheckboxRow: React.FC<CheckboxRowProps & IconSlot> = ({
|
|
|
94
102
|
return (
|
|
95
103
|
<Touchable
|
|
96
104
|
onPress={handlePress}
|
|
97
|
-
style={[styles.mainParent, { flexDirection: direction }
|
|
105
|
+
style={[viewStyles, styles.mainParent, { flexDirection: direction }]}
|
|
98
106
|
disabled={disabled}
|
|
99
107
|
{...rest}
|
|
100
108
|
>
|
|
@@ -107,24 +115,21 @@ const CheckboxRow: React.FC<CheckboxRowProps & IconSlot> = ({
|
|
|
107
115
|
labelContainerStyle,
|
|
108
116
|
]}
|
|
109
117
|
>
|
|
110
|
-
{renderLabel(label,
|
|
111
|
-
</View>
|
|
112
|
-
<View
|
|
113
|
-
style={{
|
|
114
|
-
flex: 1,
|
|
115
|
-
alignItems: getCheckboxAlignment(parentDirection, direction),
|
|
116
|
-
}}
|
|
117
|
-
>
|
|
118
|
-
<Checkbox
|
|
119
|
-
Icon={Icon}
|
|
120
|
-
status={isChecked}
|
|
121
|
-
onPress={handlePress}
|
|
122
|
-
style={checkboxStyle}
|
|
123
|
-
disabled={disabled}
|
|
124
|
-
color={color}
|
|
125
|
-
uncheckedColor={uncheckedColor}
|
|
126
|
-
/>
|
|
118
|
+
{renderLabel(label, textStyles, labelStyle)}
|
|
127
119
|
</View>
|
|
120
|
+
|
|
121
|
+
<Checkbox
|
|
122
|
+
Icon={Icon}
|
|
123
|
+
status={internalValue}
|
|
124
|
+
style={checkboxStyle}
|
|
125
|
+
disabled={disabled}
|
|
126
|
+
onPress={handlePress}
|
|
127
|
+
color={color}
|
|
128
|
+
uncheckedColor={uncheckedColor}
|
|
129
|
+
checkedIcon={checkedIcon}
|
|
130
|
+
uncheckedIcon={uncheckedIcon}
|
|
131
|
+
size={size}
|
|
132
|
+
/>
|
|
128
133
|
</Touchable>
|
|
129
134
|
);
|
|
130
135
|
};
|
|
@@ -136,7 +141,7 @@ const styles = StyleSheet.create({
|
|
|
136
141
|
paddingStart: 20,
|
|
137
142
|
minHeight: 50,
|
|
138
143
|
paddingEnd: 20,
|
|
139
|
-
|
|
144
|
+
display: "flex",
|
|
140
145
|
...Platform.select({
|
|
141
146
|
web: {
|
|
142
147
|
cursor: "pointer",
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { View, Animated, Text, StyleSheet,
|
|
2
|
+
import { View, Animated, Text, StyleSheet, I18nManager, TextInput as NativeTextInput, } 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";
|
|
6
6
|
import Portal from "../Portal/Portal";
|
|
7
|
-
import Button from "../DeprecatedButton";
|
|
8
7
|
import Touchable from "../Touchable";
|
|
9
8
|
import DateTimePicker from "./DatePickerComponent";
|
|
10
9
|
const AnimatedText = Animated.createAnimatedComponent(Text);
|
|
@@ -325,9 +324,8 @@ const DatePicker = ({ Icon, style, theme: { colors, typography, roundness, disab
|
|
|
325
324
|
paddingRight: insets.right,
|
|
326
325
|
},
|
|
327
326
|
] },
|
|
328
|
-
Platform.OS === "ios" && (React.createElement(Button, { Icon: Icon, type: "text", onPress: toggleVisibility, style: styles.closeButton }, "Close")),
|
|
329
327
|
React.createElement(DateTimePicker, { value: getValidDate(), mode: mode, isVisible: pickerVisible, toggleVisibility: toggleVisibility, onChange: (_event, data) => {
|
|
330
|
-
|
|
328
|
+
toggleVisibility();
|
|
331
329
|
setValue(data);
|
|
332
330
|
onDateChange(data);
|
|
333
331
|
} })))))));
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
StyleProp,
|
|
8
8
|
ViewStyle,
|
|
9
9
|
TextStyle,
|
|
10
|
-
Platform,
|
|
11
10
|
TextInputProps,
|
|
12
11
|
ImageStyle,
|
|
13
12
|
I18nManager,
|
|
@@ -19,7 +18,6 @@ import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
|
19
18
|
import dateFormat from "dateformat";
|
|
20
19
|
import { withTheme } from "../../theming";
|
|
21
20
|
import Portal from "../Portal/Portal";
|
|
22
|
-
import Button from "../DeprecatedButton";
|
|
23
21
|
import Touchable from "../Touchable";
|
|
24
22
|
import DateTimePicker from "./DatePickerComponent";
|
|
25
23
|
|
|
@@ -496,24 +494,13 @@ const DatePicker: React.FC<Props> = ({
|
|
|
496
494
|
},
|
|
497
495
|
]}
|
|
498
496
|
>
|
|
499
|
-
{Platform.OS === "ios" && (
|
|
500
|
-
<Button
|
|
501
|
-
Icon={Icon}
|
|
502
|
-
type="text"
|
|
503
|
-
onPress={toggleVisibility}
|
|
504
|
-
style={styles.closeButton}
|
|
505
|
-
>
|
|
506
|
-
Close
|
|
507
|
-
</Button>
|
|
508
|
-
)}
|
|
509
|
-
|
|
510
497
|
<DateTimePicker
|
|
511
498
|
value={getValidDate()}
|
|
512
499
|
mode={mode}
|
|
513
500
|
isVisible={pickerVisible}
|
|
514
501
|
toggleVisibility={toggleVisibility}
|
|
515
502
|
onChange={(_event: any, data: any) => {
|
|
516
|
-
|
|
503
|
+
toggleVisibility();
|
|
517
504
|
setValue(data);
|
|
518
505
|
onDateChange(data);
|
|
519
506
|
}}
|
|
@@ -231,6 +231,7 @@ class TextField extends React.Component {
|
|
|
231
231
|
: leftIconMode === "outset"
|
|
232
232
|
? 16
|
|
233
233
|
: 0,
|
|
234
|
+
marginLeft: leftIconMode === "inset" && type === "solid" ? 16 : 0,
|
|
234
235
|
};
|
|
235
236
|
const labelStyle = {
|
|
236
237
|
...typography.subtitle1,
|
|
@@ -355,10 +356,10 @@ class TextField extends React.Component {
|
|
|
355
356
|
opacity: hasActiveOutline ? this.state.labeled : 1,
|
|
356
357
|
},
|
|
357
358
|
], numberOfLines: 1 }, label))) : null,
|
|
358
|
-
leftIconName && leftIconMode === "inset" ? (React.createElement(
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
359
|
+
leftIconName && leftIconMode === "inset" ? (React.createElement(View, { style: {
|
|
360
|
+
justifyContent: type === "solid" ? "center" : undefined,
|
|
361
|
+
} },
|
|
362
|
+
React.createElement(Icon, { ...leftIconProps, style: leftIconStyle }))) : null,
|
|
362
363
|
render({
|
|
363
364
|
ref: (c) => {
|
|
364
365
|
this._root = c;
|
|
@@ -359,6 +359,7 @@ class TextField extends React.Component<Props, State> {
|
|
|
359
359
|
: leftIconMode === "outset"
|
|
360
360
|
? 16
|
|
361
361
|
: 0,
|
|
362
|
+
marginLeft: leftIconMode === "inset" && type === "solid" ? 16 : 0,
|
|
362
363
|
};
|
|
363
364
|
|
|
364
365
|
const labelStyle = {
|
|
@@ -536,13 +537,13 @@ class TextField extends React.Component<Props, State> {
|
|
|
536
537
|
) : null}
|
|
537
538
|
|
|
538
539
|
{leftIconName && leftIconMode === "inset" ? (
|
|
539
|
-
<
|
|
540
|
-
{...leftIconProps}
|
|
540
|
+
<View
|
|
541
541
|
style={{
|
|
542
|
-
|
|
543
|
-
marginLeft: type === "solid" ? 16 : 0,
|
|
542
|
+
justifyContent: type === "solid" ? "center" : undefined,
|
|
544
543
|
}}
|
|
545
|
-
|
|
544
|
+
>
|
|
545
|
+
<Icon {...leftIconProps} style={leftIconStyle} />
|
|
546
|
+
</View>
|
|
546
547
|
) : null}
|
|
547
548
|
|
|
548
549
|
{render({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createTextProp, createTextStyle, createRowDirectionProp, createFieldNameProp, COMPONENT_TYPES, Triggers, createColorProp, } from "@draftbit/types";
|
|
1
|
+
import { createBoolProp, createTextProp, createTextStyle, createRowDirectionProp, createFieldNameProp, createIconProp, createStaticNumberProp, COMPONENT_TYPES, Triggers, createColorProp, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Checkbox Row",
|
|
4
4
|
tag: "CheckboxRow",
|
|
@@ -6,8 +6,13 @@ export const SEED_DATA = {
|
|
|
6
6
|
layout: {
|
|
7
7
|
minHeight: 50,
|
|
8
8
|
},
|
|
9
|
-
triggers: [Triggers.OnPress],
|
|
9
|
+
triggers: [Triggers.OnPress, Triggers.OnCheck, Triggers.OnUncheck],
|
|
10
10
|
props: {
|
|
11
|
+
fieldName: createFieldNameProp({
|
|
12
|
+
defaultValue: "checkboxRowValue",
|
|
13
|
+
valuePropName: "value",
|
|
14
|
+
handlerPropName: "onPress",
|
|
15
|
+
}),
|
|
11
16
|
label: createTextProp({
|
|
12
17
|
label: "Label",
|
|
13
18
|
description: "Label to show with the checkbox",
|
|
@@ -21,11 +26,6 @@ export const SEED_DATA = {
|
|
|
21
26
|
editable: false,
|
|
22
27
|
}),
|
|
23
28
|
direction: createRowDirectionProp(),
|
|
24
|
-
fieldName: createFieldNameProp({
|
|
25
|
-
defaultValue: "checkboxRowValue",
|
|
26
|
-
valuePropName: "value",
|
|
27
|
-
handlerPropName: "onPress",
|
|
28
|
-
}),
|
|
29
29
|
color: createColorProp({
|
|
30
30
|
description: "Color for the button (used when the checkbox is checked)",
|
|
31
31
|
}),
|
|
@@ -33,5 +33,24 @@ export const SEED_DATA = {
|
|
|
33
33
|
label: "Unselected Color",
|
|
34
34
|
description: "Color for the button when the checkbox is unchecked",
|
|
35
35
|
}),
|
|
36
|
+
disabled: createBoolProp({
|
|
37
|
+
label: "Disabled",
|
|
38
|
+
description: "Whether the checkbox is disabled",
|
|
39
|
+
}),
|
|
40
|
+
size: createStaticNumberProp({
|
|
41
|
+
label: "Size",
|
|
42
|
+
description: "Specifies the size of the icon",
|
|
43
|
+
defaultValue: null,
|
|
44
|
+
}),
|
|
45
|
+
checkedIcon: createIconProp({
|
|
46
|
+
label: "Checked Icon",
|
|
47
|
+
description: 'Icon to show when the checkbox status is "checked"',
|
|
48
|
+
defaultValue: null,
|
|
49
|
+
}),
|
|
50
|
+
uncheckedIcon: createIconProp({
|
|
51
|
+
label: "Unchecked Icon",
|
|
52
|
+
description: 'Icon to show when the checkbox status is "unchecked"',
|
|
53
|
+
defaultValue: null,
|
|
54
|
+
}),
|
|
36
55
|
},
|
|
37
56
|
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
+
createBoolProp,
|
|
2
3
|
createTextProp,
|
|
3
4
|
createTextStyle,
|
|
4
5
|
createRowDirectionProp,
|
|
5
6
|
createFieldNameProp,
|
|
7
|
+
createIconProp,
|
|
8
|
+
createStaticNumberProp,
|
|
6
9
|
COMPONENT_TYPES,
|
|
7
10
|
Triggers,
|
|
8
11
|
createColorProp,
|
|
@@ -15,8 +18,13 @@ export const SEED_DATA = {
|
|
|
15
18
|
layout: {
|
|
16
19
|
minHeight: 50,
|
|
17
20
|
},
|
|
18
|
-
triggers: [Triggers.OnPress],
|
|
21
|
+
triggers: [Triggers.OnPress, Triggers.OnCheck, Triggers.OnUncheck],
|
|
19
22
|
props: {
|
|
23
|
+
fieldName: createFieldNameProp({
|
|
24
|
+
defaultValue: "checkboxRowValue",
|
|
25
|
+
valuePropName: "value",
|
|
26
|
+
handlerPropName: "onPress",
|
|
27
|
+
}),
|
|
20
28
|
label: createTextProp({
|
|
21
29
|
label: "Label",
|
|
22
30
|
description: "Label to show with the checkbox",
|
|
@@ -30,11 +38,6 @@ export const SEED_DATA = {
|
|
|
30
38
|
editable: false,
|
|
31
39
|
}),
|
|
32
40
|
direction: createRowDirectionProp(),
|
|
33
|
-
fieldName: createFieldNameProp({
|
|
34
|
-
defaultValue: "checkboxRowValue",
|
|
35
|
-
valuePropName: "value",
|
|
36
|
-
handlerPropName: "onPress",
|
|
37
|
-
}),
|
|
38
41
|
color: createColorProp({
|
|
39
42
|
description: "Color for the button (used when the checkbox is checked)",
|
|
40
43
|
}),
|
|
@@ -42,5 +45,24 @@ export const SEED_DATA = {
|
|
|
42
45
|
label: "Unselected Color",
|
|
43
46
|
description: "Color for the button when the checkbox is unchecked",
|
|
44
47
|
}),
|
|
48
|
+
disabled: createBoolProp({
|
|
49
|
+
label: "Disabled",
|
|
50
|
+
description: "Whether the checkbox is disabled",
|
|
51
|
+
}),
|
|
52
|
+
size: createStaticNumberProp({
|
|
53
|
+
label: "Size",
|
|
54
|
+
description: "Specifies the size of the icon",
|
|
55
|
+
defaultValue: null,
|
|
56
|
+
}),
|
|
57
|
+
checkedIcon: createIconProp({
|
|
58
|
+
label: "Checked Icon",
|
|
59
|
+
description: 'Icon to show when the checkbox status is "checked"',
|
|
60
|
+
defaultValue: null,
|
|
61
|
+
}),
|
|
62
|
+
uncheckedIcon: createIconProp({
|
|
63
|
+
label: "Unchecked Icon",
|
|
64
|
+
description: 'Icon to show when the checkbox status is "unchecked"',
|
|
65
|
+
defaultValue: null,
|
|
66
|
+
}),
|
|
45
67
|
},
|
|
46
68
|
};
|
package/src/mappings/Icon.js
CHANGED
package/src/mappings/Icon.ts
CHANGED
|
@@ -13,7 +13,10 @@ export const SEED_DATA = {
|
|
|
13
13
|
category: COMPONENT_TYPES.basic,
|
|
14
14
|
layout: {},
|
|
15
15
|
props: {
|
|
16
|
-
name:
|
|
16
|
+
name: {
|
|
17
|
+
...createIconProp(),
|
|
18
|
+
group: GROUPS.data,
|
|
19
|
+
},
|
|
17
20
|
color: createColorProp(),
|
|
18
21
|
size: createNumberProp({
|
|
19
22
|
group: GROUPS.basic,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createStaticBoolProp, createStaticNumberProp, } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Keyboard Aware Scroll View",
|
|
4
|
+
tag: "KeyboardAwareScrollView",
|
|
5
|
+
description: "View that moves pushes the content when virtual keyboard is open.",
|
|
6
|
+
category: COMPONENT_TYPES.layout,
|
|
7
|
+
layout: {},
|
|
8
|
+
props: {
|
|
9
|
+
viewIsInsideTabBar: createStaticBoolProp({
|
|
10
|
+
label: "View Is Inside TabBar",
|
|
11
|
+
description: "Adds an extra offset that represents the TabBarIOS height.",
|
|
12
|
+
}),
|
|
13
|
+
enableAutomaticScroll: createStaticBoolProp({
|
|
14
|
+
label: "Enable Automatic Scroll",
|
|
15
|
+
description: "When focus in TextInput will scroll the position, default is enabled",
|
|
16
|
+
}),
|
|
17
|
+
extraHeight: createStaticNumberProp({
|
|
18
|
+
label: "Extra Height",
|
|
19
|
+
description: "Adds an extra offset when focusing the TextInputs",
|
|
20
|
+
}),
|
|
21
|
+
extraScrollHeight: createStaticNumberProp({
|
|
22
|
+
label: "Extra Scroll Height",
|
|
23
|
+
description: "Adds an extra offset to the keyboard. Useful if you want to stick elements above the keyboard",
|
|
24
|
+
}),
|
|
25
|
+
enableResetScrollToCoords: createStaticBoolProp({
|
|
26
|
+
label: "Enable Reset Scroll To Coordinates",
|
|
27
|
+
description: "Lets the user enable or disable automatic resetScrollToCoords",
|
|
28
|
+
}),
|
|
29
|
+
keyboardOpeningTime: createStaticNumberProp({
|
|
30
|
+
label: "Keyboard Opening Time",
|
|
31
|
+
description: "Sets the delay time before scrolling to new position, default is 250",
|
|
32
|
+
}),
|
|
33
|
+
enableOnAndroid: createStaticBoolProp({
|
|
34
|
+
label: "Enable On Android",
|
|
35
|
+
description: "Enable Android Support",
|
|
36
|
+
}),
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COMPONENT_TYPES,
|
|
3
|
+
createStaticBoolProp,
|
|
4
|
+
createStaticNumberProp,
|
|
5
|
+
} from "@draftbit/types";
|
|
6
|
+
|
|
7
|
+
export const SEED_DATA = {
|
|
8
|
+
name: "Keyboard Aware Scroll View",
|
|
9
|
+
tag: "KeyboardAwareScrollView",
|
|
10
|
+
description:
|
|
11
|
+
"View that moves pushes the content when virtual keyboard is open.",
|
|
12
|
+
category: COMPONENT_TYPES.layout,
|
|
13
|
+
layout: {},
|
|
14
|
+
props: {
|
|
15
|
+
viewIsInsideTabBar: createStaticBoolProp({
|
|
16
|
+
label: "View Is Inside TabBar",
|
|
17
|
+
description: "Adds an extra offset that represents the TabBarIOS height.",
|
|
18
|
+
}),
|
|
19
|
+
enableAutomaticScroll: createStaticBoolProp({
|
|
20
|
+
label: "Enable Automatic Scroll",
|
|
21
|
+
description:
|
|
22
|
+
"When focus in TextInput will scroll the position, default is enabled",
|
|
23
|
+
}),
|
|
24
|
+
extraHeight: createStaticNumberProp({
|
|
25
|
+
label: "Extra Height",
|
|
26
|
+
description: "Adds an extra offset when focusing the TextInputs",
|
|
27
|
+
}),
|
|
28
|
+
extraScrollHeight: createStaticNumberProp({
|
|
29
|
+
label: "Extra Scroll Height",
|
|
30
|
+
description:
|
|
31
|
+
"Adds an extra offset to the keyboard. Useful if you want to stick elements above the keyboard",
|
|
32
|
+
}),
|
|
33
|
+
enableResetScrollToCoords: createStaticBoolProp({
|
|
34
|
+
label: "Enable Reset Scroll To Coordinates",
|
|
35
|
+
description:
|
|
36
|
+
"Lets the user enable or disable automatic resetScrollToCoords",
|
|
37
|
+
}),
|
|
38
|
+
keyboardOpeningTime: createStaticNumberProp({
|
|
39
|
+
label: "Keyboard Opening Time",
|
|
40
|
+
description:
|
|
41
|
+
"Sets the delay time before scrolling to new position, default is 250",
|
|
42
|
+
}),
|
|
43
|
+
enableOnAndroid: createStaticBoolProp({
|
|
44
|
+
label: "Enable On Android",
|
|
45
|
+
description: "Enable Android Support",
|
|
46
|
+
}),
|
|
47
|
+
},
|
|
48
|
+
};
|