@draftbit/core 43.4.11-d2edf8.3 → 43.4.13-33318c.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 +21 -5
- package/lib/commonjs/components/Accordion/AccordionItem.js.map +1 -1
- package/lib/commonjs/components/Checkbox/Checkbox.js +23 -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/Container.js +14 -0
- package/lib/commonjs/components/Container.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/Picker/PickerComponent.android.js +20 -6
- package/lib/commonjs/components/Picker/PickerComponent.android.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/RowBodyIcon.js.map +1 -1
- package/lib/commonjs/components/RowHeadlineImageIcon.js.map +1 -1
- package/lib/commonjs/components/TextField.js +24 -7
- package/lib/commonjs/components/TextField.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mappings/ActionSheetCancel.js.map +1 -1
- package/lib/commonjs/mappings/ActionSheetItem.js.map +1 -1
- package/lib/commonjs/mappings/CardContainer.js.map +1 -1
- package/lib/commonjs/mappings/Carousel.js.map +1 -1
- package/lib/commonjs/mappings/Checkbox.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/ImageBackground.js.map +1 -1
- package/lib/commonjs/mappings/MapMarker.js.map +1 -1
- package/lib/commonjs/mappings/ProgressBar.js.map +1 -1
- package/lib/commonjs/mappings/RowBodyIcon.js.map +1 -1
- package/lib/commonjs/mappings/RowHeadlineImageIcon.js.map +1 -1
- package/lib/commonjs/mappings/Slider.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 +23 -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/Container.js +14 -0
- package/lib/module/components/Container.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/DatePicker/DatePickerComponent.web.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/TextField.js +1 -0
- 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/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/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 +22 -6
- package/src/components/Checkbox/Checkbox.tsx +25 -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/Container.js +13 -0
- package/src/components/Container.tsx +14 -0
- 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 +1 -0
- package/src/components/TextField.tsx +2 -0
- package/src/mappings/CheckboxRow.js +26 -7
- package/src/mappings/CheckboxRow.ts +28 -6
|
@@ -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",
|
|
@@ -5,6 +5,19 @@ import Elevation from "./Elevation";
|
|
|
5
5
|
const Container = ({ useThemeGutterPadding, borderColor, borderWidth, backgroundColor, backgroundImage, backgroundImageResizeMode, elevation, style, children, theme, // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
6
6
|
...rest }) => {
|
|
7
7
|
const { flex, flexGrow, flexWrap, flexBasis, flexShrink, flexDirection, alignContent, justifyContent, alignItems, padding, paddingTop, paddingBottom, paddingLeft, paddingRight, paddingVertical, paddingHorizontal, ...styleProp } = StyleSheet.flatten(style) || {};
|
|
8
|
+
console.log("Container props", {
|
|
9
|
+
useThemeGutterPadding,
|
|
10
|
+
borderColor,
|
|
11
|
+
borderWidth,
|
|
12
|
+
backgroundColor,
|
|
13
|
+
backgroundImage,
|
|
14
|
+
backgroundImageResizeMode,
|
|
15
|
+
elevation,
|
|
16
|
+
style,
|
|
17
|
+
children,
|
|
18
|
+
theme,
|
|
19
|
+
rest: { ...rest },
|
|
20
|
+
});
|
|
8
21
|
const containerStyle = {
|
|
9
22
|
backgroundColor,
|
|
10
23
|
borderColor,
|
|
@@ -59,6 +59,20 @@ const Container: React.FC<Props> = ({
|
|
|
59
59
|
...styleProp
|
|
60
60
|
} = StyleSheet.flatten(style) || {};
|
|
61
61
|
|
|
62
|
+
console.log("Container props", {
|
|
63
|
+
useThemeGutterPadding,
|
|
64
|
+
borderColor,
|
|
65
|
+
borderWidth,
|
|
66
|
+
backgroundColor,
|
|
67
|
+
backgroundImage,
|
|
68
|
+
backgroundImageResizeMode,
|
|
69
|
+
elevation,
|
|
70
|
+
style,
|
|
71
|
+
children,
|
|
72
|
+
theme,
|
|
73
|
+
rest: { ...rest },
|
|
74
|
+
});
|
|
75
|
+
|
|
62
76
|
const containerStyle: StyleProp<ViewStyle> = {
|
|
63
77
|
backgroundColor,
|
|
64
78
|
borderColor,
|
|
@@ -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
|
}}
|
|
@@ -133,6 +133,7 @@ class TextField extends React.Component {
|
|
|
133
133
|
return this._root && this._root.blur();
|
|
134
134
|
}
|
|
135
135
|
render() {
|
|
136
|
+
console.log("TextFielf props", this.props);
|
|
136
137
|
const { Icon, type = "underline", disabled = false, label, error = false, leftIconName, leftIconMode, rightIconName, assistiveText, underlineColor: underlineColorProp, multiline = false, numberOfLines = 4, style, theme: { colors, typography, roundness, disabledOpacity }, render = (props) => React.createElement(NativeTextInput, { ...props }), ...rest } = this.props;
|
|
137
138
|
const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
|
|
138
139
|
const OUTLINE_MINIMIZED_LABEL_Y_OFFSET = -(16 * 0.5 + 4);
|
|
@@ -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
|
};
|