@draftbit/core 43.4.4-03ab3e.0 → 43.4.5-8f3f2c.1
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/FAB.js +5 -19
- package/lib/commonjs/components/FAB.js.map +1 -1
- package/lib/commonjs/components/HeaderOverline.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButton.js +9 -6
- package/lib/commonjs/components/RadioButton/RadioButton.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +18 -8
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +14 -9
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js.map +1 -1
- package/lib/commonjs/components/RadioButton/index.js.map +1 -1
- package/lib/commonjs/components/RowHeadlineImageIcon.js.map +1 -1
- package/lib/commonjs/components/StarRating.js +5 -4
- package/lib/commonjs/components/StarRating.js.map +1 -1
- package/lib/commonjs/components/Swiper/SwiperItem.js.map +1 -1
- package/lib/commonjs/components/Touchable.js +3 -16
- package/lib/commonjs/components/Touchable.js.map +1 -1
- package/lib/commonjs/hooks.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mappings/Accordion.js.map +1 -1
- package/lib/commonjs/mappings/LinearGradient.js +2 -2
- package/lib/commonjs/mappings/LinearGradient.js.map +1 -1
- package/lib/commonjs/styles/overlay.js.map +1 -1
- package/lib/commonjs/utilities.js +7 -0
- package/lib/commonjs/utilities.js.map +1 -1
- package/lib/module/components/RadioButton/RadioButton.js +8 -6
- package/lib/module/components/RadioButton/RadioButton.js.map +1 -1
- package/lib/module/components/RadioButton/RadioButtonGroup.js +17 -8
- package/lib/module/components/RadioButton/RadioButtonGroup.js.map +1 -1
- package/lib/module/components/RadioButton/RadioButtonRow.js +15 -10
- package/lib/module/components/RadioButton/RadioButtonRow.js.map +1 -1
- package/lib/module/components/Swiper/Swiper.js.map +1 -1
- package/lib/module/mappings/FAB.js.map +1 -1
- package/lib/module/mappings/LinearGradient.js +2 -2
- package/lib/module/mappings/LinearGradient.js.map +1 -1
- package/lib/module/mappings/RowHeadlineImageCaption.js.map +1 -1
- package/lib/module/utilities.js +4 -0
- package/lib/module/utilities.js.map +1 -1
- package/lib/typescript/src/components/RadioButton/RadioButton.d.ts +1 -1
- package/lib/typescript/src/components/RadioButton/RadioButtonGroup.d.ts +1 -1
- package/lib/typescript/src/utilities.d.ts +1 -0
- package/package.json +2 -2
- package/src/components/RadioButton/RadioButton.js +9 -5
- package/src/components/RadioButton/RadioButton.tsx +12 -9
- package/src/components/RadioButton/RadioButtonGroup.js +14 -8
- package/src/components/RadioButton/RadioButtonGroup.tsx +21 -12
- package/src/components/RadioButton/RadioButtonRow.js +15 -9
- package/src/components/RadioButton/RadioButtonRow.tsx +19 -13
- package/src/mappings/LinearGradient.js +2 -2
- package/src/mappings/LinearGradient.ts +2 -2
- package/src/utilities.js +11 -0
- package/src/utilities.ts +8 -0
|
@@ -15,6 +15,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
17
|
|
|
18
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
|
+
|
|
18
20
|
const FAB = _ref => {
|
|
19
21
|
let {
|
|
20
22
|
onPress,
|
|
@@ -38,7 +40,7 @@ const FAB = _ref => {
|
|
|
38
40
|
borderRadius: size / 2,
|
|
39
41
|
overflow: "hidden"
|
|
40
42
|
}, style]
|
|
41
|
-
}, /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
43
|
+
}, /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
|
|
42
44
|
onPress: onPress,
|
|
43
45
|
disabled: loading || disabled,
|
|
44
46
|
android_ripple: {
|
|
@@ -56,9 +58,8 @@ const FAB = _ref => {
|
|
|
56
58
|
borderRadius: size / 2,
|
|
57
59
|
backgroundColor
|
|
58
60
|
}];
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, null, loading ? /*#__PURE__*/React.createElement(_reactNative.ActivityIndicator, {
|
|
61
|
+
}
|
|
62
|
+
}, props), /*#__PURE__*/React.createElement(_reactNative.View, null, loading ? /*#__PURE__*/React.createElement(_reactNative.ActivityIndicator, {
|
|
62
63
|
style: size > 50 ? {
|
|
63
64
|
marginTop: 2,
|
|
64
65
|
marginLeft: 2
|
|
@@ -88,20 +89,5 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
88
89
|
|
|
89
90
|
var _default = (0, _theming.withTheme)(FAB);
|
|
90
91
|
|
|
91
|
-
exports.default = _default;
|
|
92
|
-
//# sourceMappingURL=FAB.js.map backgroundColor: "#5a45ff",
|
|
93
|
-
justifyContent: "center",
|
|
94
|
-
alignItems: "center",
|
|
95
|
-
..._reactNative.Platform.select({
|
|
96
|
-
web: {
|
|
97
|
-
cursor: "pointer",
|
|
98
|
-
userSelect: "none"
|
|
99
|
-
}
|
|
100
|
-
})
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
var _default = (0, _theming.withTheme)(FAB);
|
|
105
|
-
|
|
106
92
|
exports.default = _default;
|
|
107
93
|
//# sourceMappingURL=FAB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FAB.
|
|
1
|
+
{"version":3,"sources":["FAB.tsx"],"names":["FAB","onPress","disabled","loading","iconName","style","theme","iconColor","bgColor","size","Icon","props","backgroundColor","colors","primary","color","width","height","borderRadius","overflow","radius","pressed","styles","button","opacity","marginTop","marginLeft","undefined","StyleSheet","create","justifyContent","alignItems","Platform","select","web","cursor","userSelect"],"mappings":";;;;;;;AAAA;;AACA;;AAUA;;;;;;;;AAiBA,MAAMA,GAAoB,GAAG,QAYvB;AAAA,MAZwB;AAC5BC,IAAAA,OAD4B;AAE5BC,IAAAA,QAF4B;AAG5BC,IAAAA,OAH4B;AAI5BC,IAAAA,QAAQ,GAAG,mBAJiB;AAK5BC,IAAAA,KAL4B;AAM5BC,IAAAA,KAN4B;AAO5BC,IAAAA,SAP4B;AAQ5BC,IAAAA,OAR4B;AAS5BC,IAAAA,IAAI,GAAG,EATqB;AAU5BC,IAAAA,IAV4B;AAW5B,OAAGC;AAXyB,GAYxB;AACJ,QAAMC,eAAe,GAAGJ,OAAO,IAAIF,KAAK,CAACO,MAAN,CAAaC,OAAhD;AACA,QAAMC,KAAK,GAAGR,SAAS,IAAI,MAA3B;AAEA,sBACE,oBAAC,iBAAD;AACE,IAAA,KAAK,EAAE,CACL;AACES,MAAAA,KAAK,EAAEP,IADT;AAEEQ,MAAAA,MAAM,EAAER,IAFV;AAGES,MAAAA,YAAY,EAAET,IAAI,GAAG,CAHvB;AAIEU,MAAAA,QAAQ,EAAE;AAJZ,KADK,EAOLd,KAPK;AADT,kBAWE,oBAAC,sBAAD;AACE,IAAA,OAAO,EAAEJ,OADX;AAEE,IAAA,QAAQ,EAAEE,OAAO,IAAID,QAFvB;AAGE,IAAA,cAAc,EAAE;AACda,MAAAA,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,GAAV,C","sourcesContent":["import * as React from \"react\";\nimport {\n View,\n StyleSheet,\n Pressable,\n ActivityIndicator,\n StyleProp,\n ViewStyle,\n PressableProps,\n Platform,\n} from \"react-native\";\nimport { withTheme } from \"../theming\";\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\n\ntype Props = {\n disabled?: boolean;\n loading?: boolean;\n size?: number;\n bgColor?: string;\n iconColor?: string;\n iconName?: string;\n onPress: () => void;\n theme: Theme;\n style?: StyleProp<ViewStyle>;\n} & PressableProps &\n IconSlot;\n\nconst FAB: React.FC<Props> = ({\n onPress,\n disabled,\n loading,\n iconName = \"MaterialIcons/add\",\n style,\n theme,\n iconColor,\n bgColor,\n size = 50,\n Icon,\n ...props\n}) => {\n const backgroundColor = bgColor || theme.colors.primary;\n const color = iconColor || \"#FFF\";\n\n return (\n <View\n style={[\n {\n width: size,\n height: size,\n borderRadius: size / 2,\n overflow: \"hidden\",\n },\n style,\n ]}\n >\n <Pressable\n onPress={onPress}\n disabled={loading || disabled}\n android_ripple={{\n color: \"#333\",\n radius: size / 4,\n }}\n style={({ pressed }) => {\n return [\n styles.button,\n {\n opacity: pressed || disabled ? 0.75 : 1,\n width: size,\n height: size,\n borderRadius: size / 2,\n backgroundColor,\n },\n ];\n }}\n {...props}\n >\n <View>\n {loading ? (\n <ActivityIndicator\n style={size > 50 ? { marginTop: 2, marginLeft: 2 } : undefined}\n size={size <= 50 ? \"small\" : \"large\"}\n color={color}\n />\n ) : (\n <Icon name={iconName} size={size} color={color} />\n )}\n </View>\n </Pressable>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n button: {\n backgroundColor: \"#5a45ff\",\n justifyContent: \"center\",\n alignItems: \"center\",\n ...Platform.select({\n web: {\n cursor: \"pointer\",\n userSelect: \"none\",\n },\n }),\n },\n});\n\nexport default withTheme(FAB);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["HeaderOverline.
|
|
1
|
+
{"version":3,"sources":["HeaderOverline.js"],"names":["HeaderOverline","Icon","title","buttonText","icon","onPress","style","theme","colors","typography","React","createElement","Header","titleTypeStyle","overline","titleColor","light","toUpperCase","dividerTopMargin"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;;;AACA,MAAMA,cAAc,GAAG,QAAmG;AAAA,MAAlG;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,KAAR;AAAeC,IAAAA,UAAf;AAA2BC,IAAAA,IAA3B;AAAiCC,IAAAA,OAAO,GAAG,MAAM,CAAG,CAApD;AAAsDC,IAAAA,KAAtD;AAA6DC,IAAAA,KAAK,EAAE;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV;AAApE,GAAkG;AACtH,sBAAQC,KAAK,CAACC,aAAN,CAAoBC,eAApB,EAA4B;AAAEX,IAAAA,IAAI,EAAEA,IAAR;AAAcY,IAAAA,cAAc,EAAEJ,UAAU,CAACK,QAAzC;AAAmDC,IAAAA,UAAU,EAAEP,MAAM,CAACQ,KAAtE;AAA6Ed,IAAAA,KAAK,EAAEA,KAAK,IAAIA,KAAK,CAACe,WAAN,EAA7F;AAAkHd,IAAAA,UAAU,EAAEA,UAA9H;AAA0IC,IAAAA,IAAI,EAAEA,IAAhJ;AAAsJc,IAAAA,gBAAgB,EAAE,EAAxK;AAA4Kb,IAAAA,OAAO,EAAEA,OAArL;AAA8LC,IAAAA,KAAK,EAAEA;AAArM,GAA5B,CAAR;AACH,CAFD;;eAGe,wBAAUN,cAAV,C","sourcesContent":["import * as React from \"react\";\nimport { withTheme } from \"../theming\";\nimport Header from \"./Header\";\nconst HeaderOverline = ({ Icon, title, buttonText, icon, onPress = () => { }, style, theme: { colors, typography }, }) => {\n return (React.createElement(Header, { Icon: Icon, titleTypeStyle: typography.overline, titleColor: colors.light, title: title && title.toUpperCase(), buttonText: buttonText, icon: icon, dividerTopMargin: 12, onPress: onPress, style: style }));\n};\nexport default withTheme(HeaderOverline);\n"]}
|
|
@@ -11,6 +11,8 @@ var _Config = _interopRequireDefault(require("../Config"));
|
|
|
11
11
|
|
|
12
12
|
var _IconButton = _interopRequireDefault(require("../IconButton"));
|
|
13
13
|
|
|
14
|
+
var _utilities = require("../../utilities");
|
|
15
|
+
|
|
14
16
|
var _context = require("./context");
|
|
15
17
|
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -29,7 +31,7 @@ const RadioButton = _ref => {
|
|
|
29
31
|
value,
|
|
30
32
|
selected,
|
|
31
33
|
unselectedColor,
|
|
32
|
-
onPress
|
|
34
|
+
onPress,
|
|
33
35
|
size = _Config.default.radioButtonSize,
|
|
34
36
|
selectedIcon = "MaterialIcons/radio-button-checked",
|
|
35
37
|
unselectedIcon = "MaterialIcons/radio-button-unchecked",
|
|
@@ -40,16 +42,17 @@ const RadioButton = _ref => {
|
|
|
40
42
|
value: contextValue,
|
|
41
43
|
onValueChange
|
|
42
44
|
} = (0, _context.useRadioButtonGroupContext)();
|
|
45
|
+
const realValue = (0, _utilities.getRealValue)(value);
|
|
46
|
+
const realContextValue = (0, _utilities.getRealValue)(contextValue);
|
|
47
|
+
const isSelected = selected !== null && selected !== void 0 ? selected : realContextValue && realValue && realContextValue === realValue;
|
|
43
48
|
|
|
44
49
|
const handlePress = () => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
onValueChange(value);
|
|
50
|
+
if (realValue) {
|
|
51
|
+
onPress === null || onPress === void 0 ? void 0 : onPress(realValue);
|
|
52
|
+
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(realValue);
|
|
49
53
|
}
|
|
50
54
|
};
|
|
51
55
|
|
|
52
|
-
const isSelected = selected || contextValue != null && contextValue === value;
|
|
53
56
|
return /*#__PURE__*/React.createElement(_IconButton.default, _extends({
|
|
54
57
|
Icon: Icon,
|
|
55
58
|
icon: isSelected ? selectedIcon : unselectedIcon,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["RadioButton.tsx"],"names":["RadioButton","Icon","disabled","color","value","selected","unselectedColor","onPress","size","Config","radioButtonSize","selectedIcon","unselectedIcon","style","rest","contextValue","onValueChange","
|
|
1
|
+
{"version":3,"sources":["RadioButton.tsx"],"names":["RadioButton","Icon","disabled","color","value","selected","unselectedColor","onPress","size","Config","radioButtonSize","selectedIcon","unselectedIcon","style","rest","contextValue","onValueChange","realValue","realContextValue","isSelected","handlePress"],"mappings":";;;;;;;AAAA;;AAGA;;AACA;;AACA;;AACA;;;;;;;;;;AAiBA,MAAMA,WAAuC,GAAG,QAa1C;AAAA,MAb2C;AAC/CC,IAAAA,IAD+C;AAE/CC,IAAAA,QAAQ,GAAG,KAFoC;AAG/CC,IAAAA,KAH+C;AAI/CC,IAAAA,KAJ+C;AAK/CC,IAAAA,QAL+C;AAM/CC,IAAAA,eAN+C;AAO/CC,IAAAA,OAP+C;AAQ/CC,IAAAA,IAAI,GAAGC,gBAAOC,eARiC;AAS/CC,IAAAA,YAAY,GAAG,oCATgC;AAU/CC,IAAAA,cAAc,GAAG,sCAV8B;AAW/CC,IAAAA,KAX+C;AAY/C,OAAGC;AAZ4C,GAa3C;AACJ,QAAM;AAAEV,IAAAA,KAAK,EAAEW,YAAT;AAAuBC,IAAAA;AAAvB,MAAyC,0CAA/C;AAEA,QAAMC,SAAS,GAAG,6BAAab,KAAb,CAAlB;AACA,QAAMc,gBAAgB,GAAG,6BAAaH,YAAb,CAAzB;AACA,QAAMI,UAAU,GACdd,QADc,aACdA,QADc,cACdA,QADc,GAEba,gBAAgB,IAAID,SAApB,IAAiCC,gBAAgB,KAAKD,SAFzD;;AAIA,QAAMG,WAAW,GAAG,MAAM;AACxB,QAAIH,SAAJ,EAAe;AACbV,MAAAA,OAAO,SAAP,IAAAA,OAAO,WAAP,YAAAA,OAAO,CAAGU,SAAH,CAAP;AACAD,MAAAA,aAAa,SAAb,IAAAA,aAAa,WAAb,YAAAA,aAAa,CAAGC,SAAH,CAAb;AACD;AACF,GALD;;AAOA,sBACE,oBAAC,mBAAD;AACE,IAAA,IAAI,EAAEhB,IADR;AAEE,IAAA,IAAI,EAAEkB,UAAU,GAAGR,YAAH,GAAkBC,cAFpC;AAGE,IAAA,KAAK,EAAEO,UAAU,GAAGhB,KAAH,GAAWG,eAH9B;AAIE,IAAA,QAAQ,EAAEJ,QAJZ;AAKE,IAAA,OAAO,EAAEkB,WALX;AAME,IAAA,IAAI,EAAEZ,IANR;AAOE,IAAA,KAAK,EAAEK;AAPT,KAQMC,IARN,EADF;AAYD,CAzCD;;eA2Ced,W","sourcesContent":["import * as React from \"react\";\nimport { StyleProp, ViewStyle } from \"react-native\";\n\nimport Config from \"../Config\";\nimport IconButton from \"../IconButton\";\nimport { getRealValue } from \"../../utilities\";\nimport { useRadioButtonGroupContext } from \"./context\";\n\nimport type { IconSlot } from \"../../interfaces/Icon\";\n\nexport type RadioButtonProps = {\n selected?: boolean;\n disabled?: boolean;\n color?: string;\n value?: string;\n unselectedColor?: string;\n onPress?: (value: string) => void;\n style?: StyleProp<ViewStyle>;\n size?: number;\n selectedIcon?: string;\n unselectedIcon?: string;\n} & IconSlot;\n\nconst RadioButton: React.FC<RadioButtonProps> = ({\n Icon,\n disabled = false,\n color,\n value,\n selected,\n unselectedColor,\n onPress,\n size = Config.radioButtonSize,\n selectedIcon = \"MaterialIcons/radio-button-checked\",\n unselectedIcon = \"MaterialIcons/radio-button-unchecked\",\n style,\n ...rest\n}) => {\n const { value: contextValue, onValueChange } = useRadioButtonGroupContext();\n\n const realValue = getRealValue(value);\n const realContextValue = getRealValue(contextValue);\n const isSelected =\n selected ??\n (realContextValue && realValue && realContextValue === realValue);\n\n const handlePress = () => {\n if (realValue) {\n onPress?.(realValue);\n onValueChange?.(realValue);\n }\n };\n\n return (\n <IconButton\n Icon={Icon}\n icon={isSelected ? selectedIcon : unselectedIcon}\n color={isSelected ? color : unselectedColor}\n disabled={disabled}\n onPress={handlePress}\n size={size}\n style={style}\n {...rest}\n />\n );\n};\n\nexport default RadioButton;\n"]}
|
|
@@ -9,6 +9,8 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _reactNative = require("react-native");
|
|
11
11
|
|
|
12
|
+
var _utilities = require("../../utilities");
|
|
13
|
+
|
|
12
14
|
var _context = require("./context");
|
|
13
15
|
|
|
14
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -25,27 +27,35 @@ const RadioButtonGroup = _ref => {
|
|
|
25
27
|
let {
|
|
26
28
|
direction = _context.Direction.Vertical,
|
|
27
29
|
value,
|
|
28
|
-
onValueChange
|
|
30
|
+
onValueChange,
|
|
29
31
|
defaultValue,
|
|
30
32
|
style,
|
|
31
33
|
children,
|
|
32
34
|
...rest
|
|
33
35
|
} = _ref;
|
|
34
|
-
const [internalValue, setInternalValue] = React.useState(
|
|
36
|
+
const [internalValue, setInternalValue] = React.useState();
|
|
35
37
|
React.useEffect(() => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
const realValue = (0, _utilities.getRealValue)(value);
|
|
39
|
+
|
|
40
|
+
if (realValue) {
|
|
41
|
+
setInternalValue(realValue);
|
|
38
42
|
}
|
|
39
43
|
}, [value]);
|
|
40
44
|
React.useEffect(() => {
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
const realDefaultValue = (0, _utilities.getRealValue)(defaultValue);
|
|
46
|
+
|
|
47
|
+
if (realDefaultValue) {
|
|
48
|
+
setInternalValue(realDefaultValue);
|
|
43
49
|
}
|
|
44
50
|
}, [defaultValue]);
|
|
45
51
|
|
|
46
52
|
const handleValueChange = newValue => {
|
|
47
|
-
|
|
48
|
-
|
|
53
|
+
const realNewValue = (0, _utilities.getRealValue)(newValue);
|
|
54
|
+
|
|
55
|
+
if (realNewValue) {
|
|
56
|
+
setInternalValue(newValue);
|
|
57
|
+
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(newValue);
|
|
58
|
+
}
|
|
49
59
|
};
|
|
50
60
|
|
|
51
61
|
const _containerStyle = [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["RadioButtonGroup.tsx"],"names":["Provider","radioButtonGroupContext","RadioButtonGroup","direction","Direction","Vertical","value","onValueChange","defaultValue","style","children","rest","internalValue","setInternalValue","React","useState","useEffect","handleValueChange","newValue","_containerStyle","flexDirection","Horizontal","push","alignItems","minHeight"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;;;;;AAWA,MAAM;AAAEA,EAAAA;AAAF,IAAeC,gCAArB;;AAEA,MAAMC,gBAAiD,GAAG,QAQpD;AAAA,MARqD;AACzDC,IAAAA,SAAS,GAAGC,mBAAUC,QADmC;AAEzDC,IAAAA,KAFyD;AAGzDC,IAAAA,
|
|
1
|
+
{"version":3,"sources":["RadioButtonGroup.tsx"],"names":["Provider","radioButtonGroupContext","RadioButtonGroup","direction","Direction","Vertical","value","onValueChange","defaultValue","style","children","rest","internalValue","setInternalValue","React","useState","useEffect","realValue","realDefaultValue","handleValueChange","newValue","realNewValue","_containerStyle","flexDirection","Horizontal","push","alignItems","minHeight"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;;;AAWA,MAAM;AAAEA,EAAAA;AAAF,IAAeC,gCAArB;;AAEA,MAAMC,gBAAiD,GAAG,QAQpD;AAAA,MARqD;AACzDC,IAAAA,SAAS,GAAGC,mBAAUC,QADmC;AAEzDC,IAAAA,KAFyD;AAGzDC,IAAAA,aAHyD;AAIzDC,IAAAA,YAJyD;AAKzDC,IAAAA,KALyD;AAMzDC,IAAAA,QANyD;AAOzD,OAAGC;AAPsD,GAQrD;AACJ,QAAM,CAACC,aAAD,EAAgBC,gBAAhB,IAAoCC,KAAK,CAACC,QAAN,EAA1C;AAIAD,EAAAA,KAAK,C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B;AAAb,KAA+BZ,QAA/B,CAPF,CADF,CADF;AAaD,CA/DD;;eAiEeR,gB","sourcesContent":["import * as React from \"react\";\nimport { View, StyleProp, ViewStyle } from \"react-native\";\nimport type { Theme } from \"../../styles/DefaultTheme\";\nimport { getRealValue } from \"../../utilities\";\nimport { radioButtonGroupContext, Direction } from \"./context\";\nexport interface RadioButtonGroupProps {\n direction?: Direction;\n style?: StyleProp<ViewStyle>;\n value?: string;\n onValueChange?: (value: string) => void;\n defaultValue?: string | number;\n theme: Theme;\n children: React.ReactNode;\n}\n\nconst { Provider } = radioButtonGroupContext;\n\nconst RadioButtonGroup: React.FC<RadioButtonGroupProps> = ({\n direction = Direction.Vertical,\n value,\n onValueChange,\n defaultValue,\n style,\n children,\n ...rest\n}) => {\n const [internalValue, setInternalValue] = React.useState<\n string | undefined\n >();\n\n React.useEffect(() => {\n const realValue = getRealValue(value);\n\n if (realValue) {\n setInternalValue(realValue);\n }\n }, [value]);\n\n React.useEffect(() => {\n const realDefaultValue = getRealValue(defaultValue);\n\n if (realDefaultValue) {\n setInternalValue(realDefaultValue);\n }\n }, [defaultValue]);\n\n const handleValueChange = (newValue: any) => {\n const realNewValue = getRealValue(newValue);\n\n if (realNewValue) {\n setInternalValue(newValue);\n onValueChange?.(newValue);\n }\n };\n\n const _containerStyle: StyleProp<ViewStyle> = [\n {\n flexDirection: direction === Direction.Horizontal ? \"row\" : \"column\",\n },\n ];\n\n if (direction !== Direction.Vertical) {\n _containerStyle.push({\n alignItems: \"center\",\n });\n }\n\n return (\n <View style={[{ minHeight: 40 }, style]} {...rest}>\n <Provider\n value={{\n value: internalValue || \"\",\n onValueChange: handleValueChange,\n direction,\n }}\n >\n <View style={_containerStyle}>{children}</View>\n </Provider>\n </View>\n );\n};\n\nexport default RadioButtonGroup;\n"]}
|
|
@@ -45,13 +45,13 @@ const getRadioButtonAlignment = (parentDirection, direction) => {
|
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
const renderLabel = (
|
|
49
|
-
if (typeof
|
|
48
|
+
const renderLabel = (label, labelStyle, textStyle) => {
|
|
49
|
+
if (typeof label === "string") {
|
|
50
50
|
return /*#__PURE__*/React.createElement(_Text.default, {
|
|
51
51
|
style: [labelStyle, textStyle]
|
|
52
|
-
},
|
|
52
|
+
}, label);
|
|
53
53
|
} else {
|
|
54
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
54
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, label);
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
|
|
@@ -62,7 +62,7 @@ const RadioButtonRow = _ref => {
|
|
|
62
62
|
value,
|
|
63
63
|
color,
|
|
64
64
|
unselectedColor,
|
|
65
|
-
onPress
|
|
65
|
+
onPress,
|
|
66
66
|
labelContainerStyle,
|
|
67
67
|
labelStyle,
|
|
68
68
|
radioButtonStyle,
|
|
@@ -77,10 +77,15 @@ const RadioButtonRow = _ref => {
|
|
|
77
77
|
onValueChange,
|
|
78
78
|
direction: parentDirection
|
|
79
79
|
} = (0, _context.useRadioButtonGroupContext)();
|
|
80
|
+
const realValue = (0, _utilities.getRealValue)(value);
|
|
81
|
+
const realContextValue = (0, _utilities.getRealValue)(contextValue);
|
|
82
|
+
const isSelected = selected !== null && selected !== void 0 ? selected : realContextValue && realValue && realContextValue === realValue;
|
|
80
83
|
|
|
81
84
|
const handlePress = () => {
|
|
82
|
-
|
|
83
|
-
|
|
85
|
+
if (realValue) {
|
|
86
|
+
onPress === null || onPress === void 0 ? void 0 : onPress(realValue);
|
|
87
|
+
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(realValue);
|
|
88
|
+
}
|
|
84
89
|
};
|
|
85
90
|
|
|
86
91
|
const {
|
|
@@ -104,10 +109,10 @@ const RadioButtonRow = _ref => {
|
|
|
104
109
|
}
|
|
105
110
|
}, /*#__PURE__*/React.createElement(_RadioButton.default, {
|
|
106
111
|
Icon: Icon,
|
|
107
|
-
selected:
|
|
112
|
+
selected: isSelected ? true : false,
|
|
113
|
+
value: realValue,
|
|
108
114
|
color: color,
|
|
109
115
|
unselectedColor: unselectedColor,
|
|
110
|
-
onPress: handlePress,
|
|
111
116
|
style: radioButtonStyle
|
|
112
117
|
})));
|
|
113
118
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["RadioButtonRow.tsx"],"names":["Direction","getRadioButtonAlignment","parentDirection","direction","GroupDirection","Horizontal","Row","RowReverse","renderLabel","
|
|
1
|
+
{"version":3,"sources":["RadioButtonRow.tsx"],"names":["Direction","getRadioButtonAlignment","parentDirection","direction","GroupDirection","Horizontal","Row","RowReverse","renderLabel","label","labelStyle","textStyle","RadioButtonRow","Icon","value","color","unselectedColor","onPress","labelContainerStyle","radioButtonStyle","selected","disabled","style","rest","contextValue","onValueChange","realValue","realContextValue","isSelected","handlePress","textStyles","viewStyles","styles","mainParent","flexDirection","alignItems","flex","StyleSheet","create","justifyContent","paddingStart","minHeight","paddingEnd","Platform","select","web","cursor","userSelect"],"mappings":";;;;;;;AAAA;;AACA;;AAQA;;AACA;;AACA;;AAGA;;AACA;;;;;;;;;;IAEYA,S;;;WAAAA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;GAAAA,S,yBAAAA,S;;AAiBZ,MAAMC,uBAAuB,GAAG,CAC9BC,eAD8B,EAE9BC,SAF8B,KAG3B;AACH,MAAID,eAAe,KAAKE,mBAAeC,UAAvC,EAAmD;AACjD,WAAOF,SAAS,KAAKH,SAAS,CAACM,GAAxB,GAA8B,YAA9B,GAA6C,UAApD;AACD,GAFD,MAEO,IAAIH,SAAS,KAAKH,SAAS,CAACO,UAA5B,EAAwC;AAC7C,WAAO,YAAP;AACD,GAFM,MAEA;AACL,WAAO,UAAP;AACD;AACF,CAXD;;AAaA,MAAMC,WAAW,GAAG,CAClBC,KADkB,EAElBC,UAFkB,EAGlBC,SAHkB,KAIf;AACH,MAAI,OAAOF,KAAP,KAAiB,QAArB,EAA+B;AAC7B,wB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;AAPO,GADmB;AAe/BtC,EAAAA,KAAK,EAAE;AACL2B,IAAAA,IAAI,EAAE;AADD;AAfwB,CAAlB,CAAf;;eAoBexB,c","sourcesContent":["import * as React from \"react\";\nimport {\n StyleProp,\n ViewStyle,\n StyleSheet,\n TextStyle,\n View,\n Platform,\n} from \"react-native\";\nimport RadioButton, { RadioButtonProps } from \"./RadioButton\";\nimport Text from \"../Text\";\nimport { useRadioButtonGroupContext } from \"./context\";\nimport type { IconSlot } from \"../../interfaces/Icon\";\nimport { Direction as GroupDirection } from \"./context\";\nimport Touchable from \"../Touchable\";\nimport { extractStyles, getRealValue } from \"../../utilities\";\n\nexport enum Direction {\n Row = \"row\",\n RowReverse = \"row-reverse\",\n}\n\nexport interface RadioButtonRowProps extends Omit<RadioButtonProps, \"onPress\"> {\n label: string | React.ReactNode;\n value: string; // A string (or number that will be parsed String(number)) that this radio button row represents when selected\n color?: string;\n unselectedColor?: string;\n labelContainerStyle: StyleProp<ViewStyle>;\n radioButtonStyle?: StyleProp<ViewStyle>;\n labelStyle?: StyleProp<TextStyle>;\n onPress?: (value: string) => void;\n direction?: Direction;\n}\n\nconst getRadioButtonAlignment = (\n parentDirection: GroupDirection | undefined,\n direction: Direction\n) => {\n if (parentDirection === GroupDirection.Horizontal) {\n return direction === Direction.Row ? \"flex-start\" : \"flex-end\";\n } else if (direction === Direction.RowReverse) {\n return \"flex-start\";\n } else {\n return \"flex-end\";\n }\n};\n\nconst renderLabel = (\n label: string | React.ReactNode,\n labelStyle: StyleProp<TextStyle>,\n textStyle: StyleProp<TextStyle>\n) => {\n if (typeof label === \"string\") {\n return <Text style={[labelStyle, textStyle]}>{label}</Text>;\n } else {\n return <>{label}</>;\n }\n};\n\nconst RadioButtonRow: React.FC<RadioButtonRowProps & IconSlot> = ({\n Icon,\n label,\n value,\n color,\n unselectedColor,\n onPress,\n labelContainerStyle,\n labelStyle,\n radioButtonStyle,\n direction = Direction.Row,\n selected,\n disabled,\n style,\n ...rest\n}) => {\n const {\n value: contextValue,\n onValueChange,\n direction: parentDirection,\n } = useRadioButtonGroupContext();\n\n const realValue = getRealValue(value);\n const realContextValue = getRealValue(contextValue);\n const isSelected =\n selected ??\n (realContextValue && realValue && realContextValue === realValue);\n\n const handlePress = () => {\n if (realValue) {\n onPress?.(realValue);\n onValueChange?.(realValue);\n }\n };\n\n const { textStyles, viewStyles } = extractStyles(style);\n\n return (\n <Touchable\n onPress={handlePress}\n style={[styles.mainParent, { flexDirection: direction }, viewStyles]}\n disabled={disabled}\n {...rest}\n >\n <View\n style={[\n styles.label,\n {\n alignItems: direction === Direction.Row ? \"flex-start\" : \"flex-end\",\n },\n labelContainerStyle,\n ]}\n >\n {renderLabel(label, labelStyle, textStyles)}\n </View>\n <View\n style={{\n flex: 1,\n alignItems: getRadioButtonAlignment(parentDirection, direction),\n }}\n >\n <RadioButton\n Icon={Icon}\n selected={isSelected ? true : false}\n value={realValue}\n color={color}\n unselectedColor={unselectedColor}\n style={radioButtonStyle}\n />\n </View>\n </Touchable>\n );\n};\n\nconst styles = StyleSheet.create({\n mainParent: {\n alignItems: \"center\",\n justifyContent: \"space-around\",\n paddingStart: 20,\n minHeight: 50,\n paddingEnd: 20,\n flex: 1,\n ...Platform.select({\n web: {\n cursor: \"pointer\",\n userSelect: \"none\",\n },\n }),\n },\n label: {\n flex: 3,\n },\n});\n\nexport default RadioButtonRow;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.
|
|
1
|
+
{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA","sourcesContent":["export { default as RadioButton } from \"./RadioButton\";\nexport { default as RadioButtonGroup } from \"./RadioButtonGroup\";\nexport { default as RadioButtonRow } from \"./RadioButtonRow\";\nexport { default as RadioButtonFieldGroup } from \"./RadioButtonFieldGroup\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["RowHeadlineImageIcon.
|
|
1
|
+
{"version":3,"sources":["RowHeadlineImageIcon.js"],"names":["RowHeadlineImageIcon","Icon","icon","title","image","subtitle","multilineSubtitle","style","theme","colors","typography","React","createElement","Row","titleTypeStyle","headline6","titleColor","strong","subtitleTypeStyle","body2","subtitleColor","medium","right","name","size","Config","rowMultiLineIconSize","rowSingleLineIconSize","color","light","marginLeft","alignSelf","marginTop"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;AACA,MAAMA,oBAAoB,GAAG,QAA8G;AAAA,MAA7G;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,IAAR;AAAcC,IAAAA,KAAd;AAAqBC,IAAAA,KAArB;AAA4BC,IAAAA,QAA5B;AAAsCC,IAAAA,iBAAiB,GAAG,KAA1D;AAAiEC,IAAAA,KAAjE;AAAwEC,IAAAA,KAAK,EAAE;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV;AAA/E,GAA6G;AACvI,sBAAQC,KAAK,CAACC,aAAN,CAAoBC,YAApB,EAAyB;AAAEC,IAAAA,cAAc,EAAEJ,UAAU,CAACK,SAA7B;AAAwCC,IAAAA,UAAU,EAAEP,MAAM,CAACQ,MAA3D;AAAmEC,IAAAA,iBAAiB,EAAER,UAAU,CAACS,KAAjG;AAAwGC,IAAAA,aAAa,EAAEX,MAAM,CAACY,MAA9H;AAAsIlB,IAAAA,KAAK,EAAEA,KAA7I;AAAoJE,IAAAA,QAAQ,EAAEA,QAA9J;AAAwKC,IAAAA,iBAAiB,EAAEA,iBAA3L;AAA8MF,IAAAA,KAAK,EAAEA,KAArN;AAA4NkB,IAAAA,KAAK,EAAE,mBAAOX,KAAK,CAACC,aAAN,CAAoBX,IAApB,EAA0B;AAAEsB,MAAAA,IAAI,EAAErB,IAAR;AAAcsB,MAAAA,IAAI,EAAElB,iBAAiB,GAC5TmB,gBAAOC,oBADqT,GAE5TD,gBAAOE,qBAFgR;AAEzPC,MAAAA,KAAK,EAAEnB,MAAM,CAACoB,KAF2O;AAEpOtB,MAAAA,KAAK,EAAE;AAC5DuB,QAAAA,UAAU,EAAE,EADgD;AAE5DC,QAAAA,SAAS,EAAEzB,iBAAiB,GAAG,YAAH,GAAkB,QAFc;AAG5D0B,QAAAA,SAAS,EAAE1B,iBAAiB,GAAG,CAAH,GAAO;AAHyB;AAF6N,KAA1B,CAA1O;AAMlBC,IAAAA,KAAK,EAAEA;AANW,GAAzB,CAAR;AAOH,CARD;;eASe,wBAAUP,oBAAV,C","sourcesContent":["import * as React from \"react\";\nimport { withTheme } from \"../theming\";\nimport Row from \"./Row\";\nimport Config from \"./Config\";\nconst RowHeadlineImageIcon = ({ Icon, icon, title, image, subtitle, multilineSubtitle = false, style, theme: { colors, typography }, }) => {\n return (React.createElement(Row, { titleTypeStyle: typography.headline6, titleColor: colors.strong, subtitleTypeStyle: typography.body2, subtitleColor: colors.medium, title: title, subtitle: subtitle, multilineSubtitle: multilineSubtitle, image: image, right: () => (React.createElement(Icon, { name: icon, size: multilineSubtitle\n ? Config.rowMultiLineIconSize\n : Config.rowSingleLineIconSize, color: colors.light, style: {\n marginLeft: 16,\n alignSelf: multilineSubtitle ? \"flex-start\" : \"center\",\n marginTop: multilineSubtitle ? 4 : 0,\n } })), style: style }));\n};\nexport default withTheme(RowHeadlineImageIcon);\n"]}
|
|
@@ -15,6 +15,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
17
|
|
|
18
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
|
+
|
|
18
20
|
const StarRating = _ref => {
|
|
19
21
|
let {
|
|
20
22
|
Icon,
|
|
@@ -45,10 +47,9 @@ const StarRating = _ref => {
|
|
|
45
47
|
!!onPress && onPress(r);
|
|
46
48
|
}, [onPress]);
|
|
47
49
|
const ratingRounded = Math.round(localRating * 2) / 2;
|
|
48
|
-
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
49
|
-
style: [styles.container, style]
|
|
50
|
-
|
|
51
|
-
}, [...Array(maxStars)].map((_, i) => /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
50
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
|
|
51
|
+
style: [styles.container, style]
|
|
52
|
+
}, rest), [...Array(maxStars)].map((_, i) => /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
52
53
|
key: i,
|
|
53
54
|
style: {
|
|
54
55
|
display: "flex"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["StarRating.
|
|
1
|
+
{"version":3,"sources":["StarRating.tsx"],"names":["StarRating","Icon","starSize","maxStars","rating","defaultValue","isEditable","activeColor","inactiveColor","style","onPress","rest","localRating","setLocalRating","React","useState","useEffect","ratingHandler","useCallback","r","ratingRounded","Math","round","styles","container","Array","map","_","i","display","touchContainer","pressable","StyleSheet","create","flexDirection","alignItems","position","top","right","left","bottom","zIndex","flex","height","width"],"mappings":";;;;;;;AAAA;;AACA;;AAOA;;;;;;;;AAiBA,MAAMA,UAA2B,GAAG,QAY9B;AAAA,MAZ+B;AACnCC,IAAA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AAA,KAAK,EAAE;AAHE;AAfoB,CAAlB,CAAf;;eAsBe,wBAAU5C,UAAV,C","sourcesContent":["import * as React from \"react\";\nimport {\n View,\n StyleSheet,\n StyleProp,\n ViewStyle,\n Pressable,\n} from \"react-native\";\nimport { withTheme } from \"../theming\";\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\n\ntype Props = {\n starSize?: number;\n maxStars?: number;\n rating?: number;\n defaultValue?: number;\n isEditable?: boolean;\n activeColor?: string;\n inactiveColor?: string;\n theme: Theme;\n style?: StyleProp<ViewStyle>;\n onPress?: (newValue: number) => void;\n} & IconSlot;\n\nconst StarRating: React.FC<Props> = ({\n Icon,\n starSize = 16,\n maxStars = 5,\n rating = 0,\n defaultValue,\n isEditable = false,\n activeColor,\n inactiveColor,\n style,\n onPress,\n ...rest\n}) => {\n const [localRating, setLocalRating] = React.useState<number>(\n rating || defaultValue || 0\n );\n\n React.useEffect(() => {\n if (rating != null) {\n setLocalRating(rating);\n }\n }, [rating]);\n\n React.useEffect(() => {\n if (defaultValue != null) {\n setLocalRating(defaultValue);\n }\n }, [defaultValue]);\n\n const ratingHandler = React.useCallback(\n (r) => {\n setLocalRating(r);\n !!onPress && onPress(r);\n },\n [onPress]\n );\n\n const ratingRounded = Math.round(localRating * 2) / 2;\n\n return (\n <View style={[styles.container, style]} {...rest}>\n {[...Array(maxStars)].map((_, i) => (\n <View key={i} style={{ display: \"flex\" }}>\n <Icon\n name={\n ratingRounded - i === 0.5\n ? \"MaterialIcons/star-half\"\n : \"MaterialIcons/star\"\n }\n size={starSize}\n color={ratingRounded > i ? activeColor : inactiveColor}\n />\n {isEditable && (\n <View style={styles.touchContainer}>\n <Pressable\n style={styles.pressable}\n onPress={() => ratingHandler(i + 0.5)}\n />\n <Pressable\n style={styles.pressable}\n onPress={() => ratingHandler(i + 1)}\n />\n </View>\n )}\n </View>\n ))}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flexDirection: \"row\",\n alignItems: \"center\",\n },\n touchContainer: {\n display: \"flex\",\n flexDirection: \"row\",\n position: \"absolute\",\n top: 0,\n right: 0,\n left: 0,\n bottom: 0,\n zIndex: 1,\n },\n pressable: {\n flex: 1,\n height: \"100%\",\n width: \"50%\",\n },\n});\n\nexport default withTheme(StarRating);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["SwiperItem.
|
|
1
|
+
{"version":3,"sources":["SwiperItem.js"],"names":["styles","StyleSheet","create","wrapper","flex","SwiperItem","children","style","React","createElement","View"],"mappings":";;;;;;;AAAA;;AACA;;;;AACA,MAAMA,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC7BC,EAAAA,OAAO,EAAE;AACLC,IAAAA,IAAI,EAAE;AADD;AADoB,CAAlB,CAAf;;AAKA,MAAMC,UAAU,GAAG;AAAA,MAAC;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAD;AAAA,sBAA0BC,eAAMC,aAAN,CAAoBC,iBAApB,EAA0B;AAAEH,IAAAA,KAAK,EAAE,CAACP,MAAM,CAACG,OAAR,EAAiBI,KAAjB;AAAT,GAA1B,EAA8DD,QAA9D,CAA1B;AAAA,CAAnB;;eACeD,U","sourcesContent":["import React from \"react\";\nimport { View, StyleSheet } from \"react-native\";\nconst styles = StyleSheet.create({\n wrapper: {\n flex: 1,\n },\n});\nconst SwiperItem = ({ children, style }) => (React.createElement(View, { style: [styles.wrapper, style] }, children));\nexport default SwiperItem;\n"]}
|
|
@@ -11,6 +11,8 @@ var _reactNative = require("react-native");
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
14
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
|
+
|
|
14
16
|
function Touchable(_ref) {
|
|
15
17
|
let {
|
|
16
18
|
children,
|
|
@@ -19,22 +21,7 @@ function Touchable(_ref) {
|
|
|
19
21
|
style,
|
|
20
22
|
...props
|
|
21
23
|
} = _ref;
|
|
22
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
|
|
23
|
-
onPress: onPress,
|
|
24
|
-
disabled: disabled,
|
|
25
|
-
hitSlop: 8,
|
|
26
|
-
style: _ref2 => {
|
|
27
|
-
let {
|
|
28
|
-
pressed
|
|
29
|
-
} = _ref2;
|
|
30
|
-
return [{
|
|
31
|
-
opacity: pressed || disabled ? 0.75 : 1
|
|
32
|
-
}, style];
|
|
33
|
-
},
|
|
34
|
-
...props
|
|
35
|
-
}, children);
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=Touchable.js.mapElement(_reactNative.Pressable, _extends({
|
|
24
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, _extends({
|
|
38
25
|
onPress: onPress,
|
|
39
26
|
disabled: disabled,
|
|
40
27
|
hitSlop: 8,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Touchable.
|
|
1
|
+
{"version":3,"sources":["Touchable.tsx"],"names":["Touchable","children","disabled","onPress","style","props","pressed","opacity"],"mappings":";;;;;;;AAAA;;AACA;;;;;;AASe,SAASA,SAAT,OAML;AAAA,MANwB;AAChCC,IAAAA,QADgC;AAEhCC,IAAAA,QAFgC;AAGhCC,IAAAA,OAHgC;AAIhCC,IAAAA,KAJgC;AAKhC,OAAGC;AAL6B,GAMxB;AACR,sBACE,6BAAC,sBAAD;AACE,IAAA,OAAO,EAAEF,OADX;AAEE,IAAA,QAAQ,EAAED,QAFZ;AAGE,IAAA,OAAO,EAAE,CAHX;AAIE,IAAA,KAAK,EAAE,SAAiB;AAAA,UAAhB;AAAEI,QAAAA;AAAF,OAAgB;AACtB,aAAO,CACL;AACEC,QAAAA,OAAO,EAAED,OAAO,IAAIJ,QAAX,GAAsB,IAAtB,GAA6B;AADxC,OADK,EAILE,KAJK,CAAP;AAMD;AAXH,KAYMC,KAZN,GAcGJ,QAdH,CADF;AAkBD","sourcesContent":["import React from \"react\";\nimport { Pressable, ViewStyle, PressableProps } from \"react-native\";\n\ntype Props = {\n disabled?: boolean;\n children: React.ReactNode;\n style?: ViewStyle;\n onPress?: () => void;\n} & PressableProps;\n\nexport default function Touchable({\n children,\n disabled,\n onPress,\n style,\n ...props\n}: Props) {\n return (\n <Pressable\n onPress={onPress}\n disabled={disabled}\n hitSlop={8}\n style={({ pressed }) => {\n return [\n {\n opacity: pressed || disabled ? 0.75 : 1,\n },\n style,\n ];\n }}\n {...props}\n >\n {children}\n </Pressable>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["hooks.
|
|
1
|
+
{"version":3,"sources":["hooks.ts"],"names":["usePrevious","value","ref","React","useRef","useEffect","current"],"mappings":";;;;;;;AAAA;;;;AAEO,SAASA,WAAT,CAAqBC,KAArB,EAAiC;AACtC;AACA;AACA,QAAMC,GAAG,GAAGC,eAAMC,MAAN,EAAZ,CAHsC,CAKtC;;;AACAD,iBAAME,SAAN,CAAgB,MAAM;AACpBH,IAAAA,GAAG,CAACI,OAAJ,GAAcL,KAAd;AACD,GAFD,EAEG,CAACA,KAAD,CAFH,EANsC,CAUtC;;;AACA,SAAOC,GAAG,CAACI,OAAX;AACD","sourcesContent":["import React from \"react\";\n\nexport function usePrevious(value: any) {\n // The ref object is a generic container whose current property is mutable\n // and can hold any value, similar to an instance property on a class\n const ref = React.useRef();\n\n // Store current value in ref\n React.useEffect(() => {\n ref.current = value;\n }, [value]);\n\n // Return previous value (happens before update in useEffect above)\n return ref.current;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.
|
|
1
|
+
{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA","sourcesContent":["export { injectIcon } from \"./interfaces/Icon\";\nexport { withTheme, ThemeProvider } from \"./theming\";\nexport { default as Provider } from \"./Provider\";\nexport { default as DefaultTheme } from \"./styles/DefaultTheme\";\nexport { Link } from \"./components/Text\";\nexport { ButtonSolid, ButtonOutline } from \"./components/Button\";\nexport { default as Avatar } from \"./components/CircleImage\";\nexport { default as AvatarEdit } from \"./components/AvatarEdit\";\nexport { default as Card } from \"./components/Card\";\nexport { default as Carousel } from \"./components/Carousel\";\nexport { Checkbox, CheckboxGroup, CheckboxRow } from \"./components/Checkbox\";\nexport { default as CircleImage } from \"./components/CircleImage\";\nexport { default as Container } from \"./components/Container\";\nexport { default as Divider } from \"./components/Divider\";\nexport { default as FAB } from \"./components/FAB\";\nexport { default as FieldSearchBarFull } from \"./components/FieldSearchBarFull\";\nexport { default as IconButton } from \"./components/IconButton\";\nexport { default as Image } from \"./components/Image\";\nexport { default as NumberInput } from \"./components/NumberInput\";\nexport { default as ScreenContainer } from \"./components/ScreenContainer\";\nexport { default as StarRating } from \"./components/StarRating\";\nexport { default as Surface } from \"./components/Surface\";\nexport { default as Switch, SwitchRow } from \"./components/Switch\";\nexport { default as TextField } from \"./components/TextField\";\nexport { default as ToggleButton } from \"./components/ToggleButton\";\nexport { default as Touchable } from \"./components/Touchable\";\nexport { AccordionGroup, AccordionItem } from \"./components/Accordion\";\nexport { ActionSheet, ActionSheetItem, ActionSheetCancel, } from \"./components/ActionSheet\";\nexport { Swiper, SwiperItem } from \"./components/Swiper\";\nexport { Center, Circle, Square, Row, Stack, Spacer, } from \"./components/Layout\";\nexport { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from \"./components/RadioButton/index\";\n/* Deprecated: Fix or Delete! */\nexport { default as Button } from \"./components/DeprecatedButton\";\nexport { default as CardBlock } from \"./components/CardBlock\";\nexport { default as CardContainer } from \"./components/CardContainer\";\nexport { default as CardContainerRating } from \"./components/CardContainerRating\";\nexport { default as CardInline } from \"./components/CardInline\";\nexport { default as DatePicker } from \"./components/DatePicker/DatePicker\";\nexport { default as HeaderLarge } from \"./components/HeaderLarge\";\nexport { default as HeaderMedium } from \"./components/HeaderMedium\";\nexport { default as HeaderOverline } from \"./components/HeaderOverline\";\nexport { default as Picker } from \"./components/Picker/Picker\";\nexport { default as ProgressBar } from \"./components/ProgressBar\";\nexport { default as ProgressCircle } from \"./components/ProgressCircle\";\nexport { default as RowBodyIcon } from \"./components/RowBodyIcon\";\nexport { default as RowHeadlineImageCaption } from \"./components/RowHeadlineImageCaption\";\nexport { default as RowHeadlineImageIcon } from \"./components/RowHeadlineImageIcon\";\nexport { default as Slider } from \"./components/Slider\";\nexport { default as Stepper } from \"./components/Stepper\";\nexport { useAuthState } from \"./components/useAuthState\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Accordion.
|
|
1
|
+
{"version":3,"sources":["Accordion.ts"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","container","layout","paddingTop","paddingRight","paddingBottom","paddingLeft","fontSize","props","openColor","label","closedColor","caretColor","iconSize","defaultValue","expanded","icon"],"mappings":";;;;;;;AAAA;;AASO,MAAMA,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,WADiB;AAEvBC,EAAAA,GAAG,EAAE,gBAFkB;AAGvBC,EAAAA,WAAW,EAAE,+CAHU;AAIvBC,EAAAA,QAAQ,EAAEC,uBAAgBC,SAJH;AAKvBC,EAAAA,MAAM,EAAE;AACNC,IAAAA,UAAU,EAAE,CADN;AAENC,IAAAA,YAAY,EAAE,CAFR;AAGNC,IAAAA,aAAa,EAAE,CAHT;AAINC,IAAAA,WAAW,EAAE,CAJP;AAKNC,IAAAA,QAAQ,EAAE;AALJ,GALe;AAYvBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,SAAS,EAAE,4BAAgB;AACzBC,MAAAA,KAAK,EAAE;AADkB,KAAhB,CADN;AAILC,IAAAA,WAAW,EAAE,4BAAgB;AAC3BD,MAAAA,KAAK,EAAE;AADoB,KAAhB,CAJR;AAOLE,IAAAA,UAAU,EAAE,4BAAgB;AAC1BF,MAAAA,KAAK,EAAE;AADmB,KAAhB,CAPP;AAULG,IAAAA,QAAQ,EAAE,6BAAiB;AACzBH,MAAAA,KAAK,EAAE,WADkB;AAEzBI,MAAAA,YAAY,EAAE;AAFW,KAAjB,CAVL;AAcLJ,IAAAA,KAAK,EAAE,2BAAe;AACpBA,MAAAA,KAAK,EAAE;AADa,KAAf,CAdF;AAiBLK,IAAAA,QAAQ,EAAE,iCAAqB;AAC7BL,MAAAA,KAAK,EAAE,UADsB;AAE7BZ,MAAAA,WAAW,EAAE;AAFgB,KAArB,CAjBL;AAqBLkB,IAAAA,IAAI,EAAE;AArBD;AAZgB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createNumberProp,\n createIconProp,\n createTextProp,\n createStaticBoolProp,\n createColorProp,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Accordion\",\n tag: \"AccordionGroup\",\n description: \"An expandable container containing components\",\n category: COMPONENT_TYPES.container,\n layout: {\n paddingTop: 8,\n paddingRight: 8,\n paddingBottom: 8,\n paddingLeft: 8,\n fontSize: 16,\n },\n props: {\n openColor: createColorProp({\n label: \"Open text color\",\n }),\n closedColor: createColorProp({\n label: \"Closed text Color\",\n }),\n caretColor: createColorProp({\n label: \"Caret color\",\n }),\n iconSize: createNumberProp({\n label: \"Icon size\",\n defaultValue: 24,\n }),\n label: createTextProp({\n label: \"Label\",\n }),\n expanded: createStaticBoolProp({\n label: \"Expanded\",\n description: \"Whether the AccordionGroup should be expanded or not\",\n }),\n icon: createIconProp(),\n },\n};\n"]}
|
|
@@ -78,11 +78,11 @@ const SEED_DATA = {
|
|
|
78
78
|
}),
|
|
79
79
|
color2: (0, _types.createColorProp)({
|
|
80
80
|
label: "Color 2",
|
|
81
|
-
defaultValue: "
|
|
81
|
+
defaultValue: "secondary"
|
|
82
82
|
}),
|
|
83
83
|
color1: (0, _types.createColorProp)({
|
|
84
84
|
label: "Color 1",
|
|
85
|
-
defaultValue: "
|
|
85
|
+
defaultValue: "primary"
|
|
86
86
|
})
|
|
87
87
|
}
|
|
88
88
|
};
|