@draftbit/core 43.4.15-43f83d.0 → 43.4.15-641e7e.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 +16 -17
- package/lib/commonjs/components/Accordion/AccordionGroup.js.map +1 -1
- package/lib/commonjs/components/Accordion/index.js.map +1 -1
- package/lib/commonjs/components/CardInline.js.map +1 -1
- package/lib/commonjs/components/Divider.js +3 -13
- package/lib/commonjs/components/Divider.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +10 -6
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js.map +1 -1
- package/lib/commonjs/mappings/Accordion.js +10 -14
- package/lib/commonjs/mappings/Accordion.js.map +1 -1
- package/lib/commonjs/mappings/RadioButtonRow.js.map +1 -1
- package/lib/commonjs/mappings/RowBodyIcon.js.map +1 -1
- package/lib/commonjs/mappings/RowHeadlineImageCaption.js.map +1 -1
- package/lib/commonjs/mappings/RowHeadlineImageIcon.js.map +1 -1
- package/lib/module/components/Accordion/AccordionGroup.js +17 -43
- package/lib/module/components/Accordion/AccordionGroup.js.map +1 -1
- package/lib/module/components/ActionSheet/ActionSheetItem.js.map +1 -1
- package/lib/module/components/HeaderLarge.js.map +1 -1
- package/lib/module/components/RadioButton/RadioButtonGroup.js +10 -6
- package/lib/module/components/RadioButton/RadioButtonGroup.js.map +1 -1
- package/lib/module/mappings/Accordion.js +10 -14
- package/lib/module/mappings/Accordion.js.map +1 -1
- package/lib/module/mappings/ActionSheetItem.js.map +1 -1
- package/lib/module/mappings/DatePicker.js.map +1 -1
- package/lib/typescript/src/components/Accordion/AccordionGroup.d.ts +23 -26
- package/lib/typescript/src/components/RadioButton/RadioButtonGroup.d.ts +1 -1
- package/lib/typescript/src/mappings/Accordion.d.ts +9 -20
- package/package.json +2 -2
- package/src/components/Accordion/AccordionGroup.js +9 -9
- package/src/components/Accordion/AccordionGroup.tsx +27 -50
- package/src/components/RadioButton/RadioButtonGroup.js +10 -6
- package/src/components/RadioButton/RadioButtonGroup.tsx +12 -8
- package/src/mappings/Accordion.js +9 -13
- package/src/mappings/Accordion.ts +9 -14
|
@@ -6,7 +6,7 @@ import { radioButtonGroupContext, Direction } from "./context";
|
|
|
6
6
|
export interface RadioButtonGroupProps {
|
|
7
7
|
direction?: Direction;
|
|
8
8
|
style?: StyleProp<ViewStyle>;
|
|
9
|
-
value: string;
|
|
9
|
+
value: string | number;
|
|
10
10
|
onValueChange?: (value: string) => void;
|
|
11
11
|
defaultValue?: string | number;
|
|
12
12
|
theme: Theme;
|
|
@@ -19,23 +19,27 @@ const RadioButtonGroup: React.FC<RadioButtonGroupProps> = ({
|
|
|
19
19
|
direction = Direction.Vertical,
|
|
20
20
|
value = "",
|
|
21
21
|
onValueChange,
|
|
22
|
-
defaultValue
|
|
22
|
+
defaultValue,
|
|
23
23
|
style,
|
|
24
24
|
children,
|
|
25
25
|
...rest
|
|
26
26
|
}) => {
|
|
27
|
-
const [internalValue, setInternalValue] = React.useState
|
|
27
|
+
const [internalValue, setInternalValue] = React.useState("");
|
|
28
28
|
|
|
29
29
|
React.useEffect(() => {
|
|
30
|
-
|
|
30
|
+
if (value != null) {
|
|
31
|
+
const realValue = getValueForRadioButton(value);
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
setInternalValue(realValue);
|
|
34
|
+
}
|
|
33
35
|
}, [value]);
|
|
34
36
|
|
|
35
37
|
React.useEffect(() => {
|
|
36
|
-
|
|
38
|
+
if (defaultValue != null) {
|
|
39
|
+
const realDefaultValue = getValueForRadioButton(defaultValue);
|
|
37
40
|
|
|
38
|
-
|
|
41
|
+
setInternalValue(realDefaultValue);
|
|
42
|
+
}
|
|
39
43
|
}, [defaultValue]);
|
|
40
44
|
|
|
41
45
|
const handleValueChange = (newValue: string | number) => {
|
|
@@ -61,7 +65,7 @@ const RadioButtonGroup: React.FC<RadioButtonGroupProps> = ({
|
|
|
61
65
|
<View style={[{ minHeight: 40 }, style]} {...rest}>
|
|
62
66
|
<Provider
|
|
63
67
|
value={{
|
|
64
|
-
value: internalValue
|
|
68
|
+
value: internalValue,
|
|
65
69
|
onValueChange: handleValueChange,
|
|
66
70
|
direction,
|
|
67
71
|
}}
|
|
@@ -12,30 +12,26 @@ export const SEED_DATA = {
|
|
|
12
12
|
fontSize: 16,
|
|
13
13
|
},
|
|
14
14
|
props: {
|
|
15
|
-
label: createTextProp({
|
|
16
|
-
label: "Label",
|
|
17
|
-
}),
|
|
18
|
-
expanded: createStaticBoolProp({
|
|
19
|
-
label: "Expanded",
|
|
20
|
-
description: "Whether the AccordionGroup should be initaially expanded or not",
|
|
21
|
-
}),
|
|
22
15
|
openColor: createColorProp({
|
|
23
16
|
label: "Open text color",
|
|
24
17
|
}),
|
|
25
18
|
closedColor: createColorProp({
|
|
26
|
-
label: "Closed text
|
|
19
|
+
label: "Closed text Color",
|
|
27
20
|
}),
|
|
28
21
|
caretColor: createColorProp({
|
|
29
22
|
label: "Caret color",
|
|
30
23
|
}),
|
|
31
|
-
caretSize: createNumberProp({
|
|
32
|
-
label: "Caret size",
|
|
33
|
-
defaultValue: 24,
|
|
34
|
-
}),
|
|
35
|
-
icon: createIconProp(),
|
|
36
24
|
iconSize: createNumberProp({
|
|
37
25
|
label: "Icon size",
|
|
38
26
|
defaultValue: 24,
|
|
39
27
|
}),
|
|
28
|
+
label: createTextProp({
|
|
29
|
+
label: "Label",
|
|
30
|
+
}),
|
|
31
|
+
expanded: createStaticBoolProp({
|
|
32
|
+
label: "Expanded",
|
|
33
|
+
description: "Whether the AccordionGroup should be expanded or not",
|
|
34
|
+
}),
|
|
35
|
+
icon: createIconProp(),
|
|
40
36
|
},
|
|
41
37
|
};
|
|
@@ -20,31 +20,26 @@ export const SEED_DATA = {
|
|
|
20
20
|
fontSize: 16,
|
|
21
21
|
},
|
|
22
22
|
props: {
|
|
23
|
-
label: createTextProp({
|
|
24
|
-
label: "Label",
|
|
25
|
-
}),
|
|
26
|
-
expanded: createStaticBoolProp({
|
|
27
|
-
label: "Expanded",
|
|
28
|
-
description:
|
|
29
|
-
"Whether the AccordionGroup should be initaially expanded or not",
|
|
30
|
-
}),
|
|
31
23
|
openColor: createColorProp({
|
|
32
24
|
label: "Open text color",
|
|
33
25
|
}),
|
|
34
26
|
closedColor: createColorProp({
|
|
35
|
-
label: "Closed text
|
|
27
|
+
label: "Closed text Color",
|
|
36
28
|
}),
|
|
37
29
|
caretColor: createColorProp({
|
|
38
30
|
label: "Caret color",
|
|
39
31
|
}),
|
|
40
|
-
caretSize: createNumberProp({
|
|
41
|
-
label: "Caret size",
|
|
42
|
-
defaultValue: 24,
|
|
43
|
-
}),
|
|
44
|
-
icon: createIconProp(),
|
|
45
32
|
iconSize: createNumberProp({
|
|
46
33
|
label: "Icon size",
|
|
47
34
|
defaultValue: 24,
|
|
48
35
|
}),
|
|
36
|
+
label: createTextProp({
|
|
37
|
+
label: "Label",
|
|
38
|
+
}),
|
|
39
|
+
expanded: createStaticBoolProp({
|
|
40
|
+
label: "Expanded",
|
|
41
|
+
description: "Whether the AccordionGroup should be expanded or not",
|
|
42
|
+
}),
|
|
43
|
+
icon: createIconProp(),
|
|
49
44
|
},
|
|
50
45
|
};
|