@draftbit/core 43.7.0 → 43.7.1-5a0264.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.map +1 -1
- package/lib/commonjs/components/AspectRatio.js +3 -16
- package/lib/commonjs/components/AspectRatio.js.map +1 -1
- package/lib/commonjs/components/CardContainer.js +5 -16
- package/lib/commonjs/components/CardContainer.js.map +1 -1
- package/lib/commonjs/components/CardContainerShortImage.js +5 -18
- package/lib/commonjs/components/CardContainerShortImage.js.map +1 -1
- package/lib/commonjs/components/Checkbox/CheckboxGroup.js +5 -17
- package/lib/commonjs/components/Checkbox/CheckboxGroup.js.map +1 -1
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +6 -22
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js.map +1 -1
- package/lib/commonjs/components/Container.js +5 -16
- package/lib/commonjs/components/Container.js.map +1 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js.map +1 -1
- package/lib/commonjs/components/DeprecatedCardWrapper.js +14 -2
- package/lib/commonjs/components/DeprecatedCardWrapper.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js +2 -11
- package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js.map +1 -1
- package/lib/commonjs/components/Row.js.map +1 -1
- package/lib/commonjs/components/RowHeadlineImageIcon.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/StepIndicator.js.map +1 -1
- package/lib/commonjs/components/Stepper.js.map +1 -1
- package/lib/commonjs/components/Swiper/Swiper.js.map +1 -1
- package/lib/commonjs/components/Switch.js +10 -22
- package/lib/commonjs/components/Switch.js.map +1 -1
- package/lib/commonjs/components/Typography.js.map +1 -1
- package/lib/commonjs/components/useAuthState.js.map +1 -1
- package/lib/commonjs/hooks.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mappings/AccordionItem.js.map +1 -1
- package/lib/commonjs/mappings/CardBlock.js.map +1 -1
- package/lib/commonjs/mappings/Checkbox.js.map +1 -1
- package/lib/commonjs/mappings/DatePicker.js.map +1 -1
- package/lib/commonjs/mappings/IconButton.js.map +1 -1
- package/lib/commonjs/mappings/ImageBackground.js.map +1 -1
- package/lib/commonjs/mappings/KeyboardAwareScrollView.js.map +1 -1
- package/lib/commonjs/mappings/MapCallout.js.map +1 -1
- package/lib/commonjs/mappings/MapView.js +1 -2
- package/lib/commonjs/mappings/MapView.js.map +1 -1
- package/lib/commonjs/mappings/Modal.js.map +1 -1
- package/lib/commonjs/mappings/RadioButtonGroup.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/ScrollView.js.map +1 -1
- package/lib/commonjs/mappings/Swiper.js.map +1 -1
- package/lib/commonjs/mappings/WebView.js.map +1 -1
- package/lib/commonjs/utilities.js.map +1 -1
- package/lib/module/components/Checkbox/CheckboxGroupRow.js +22 -6
- package/lib/module/components/Checkbox/CheckboxGroupRow.js.map +1 -1
- package/lib/module/components/Header.js.map +1 -1
- package/lib/module/components/Layout.js +40 -21
- package/lib/module/components/Layout.js.map +1 -1
- package/lib/module/mappings/MapView.js +1 -2
- package/lib/module/mappings/MapView.js.map +1 -1
- package/lib/typescript/src/mappings/MapView.d.ts +1 -2
- package/package.json +2 -2
- package/src/mappings/MapView.js +1 -2
- package/src/mappings/MapView.ts +1 -2
|
@@ -17,6 +17,8 @@ var _RadioButtonGroup = _interopRequireDefault(require("./RadioButtonGroup"));
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
20
|
+
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); }
|
|
21
|
+
|
|
20
22
|
const RadioButtonFieldGroup = _ref => {
|
|
21
23
|
let {
|
|
22
24
|
label,
|
|
@@ -33,17 +35,6 @@ const RadioButtonFieldGroup = _ref => {
|
|
|
33
35
|
fontSize: theme.typography.headline4.fontSize,
|
|
34
36
|
color: theme.typography.headline4.color
|
|
35
37
|
}, labelStyle]
|
|
36
|
-
}, label), /*#__PURE__*/_react.default.createElement(_RadioButtonGroup.default, {
|
|
37
|
-
theme: theme,
|
|
38
|
-
...rest
|
|
39
|
-
}, children));
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
var _default = (0, _theming.withTheme)(RadioButtonFieldGroup);
|
|
43
|
-
|
|
44
|
-
exports.default = _default;
|
|
45
|
-
//# sourceMappingURL=RadioButtonFieldGroup.js.mapography.headline4.color
|
|
46
|
-
}, labelStyle]
|
|
47
38
|
}, label), /*#__PURE__*/_react.default.createElement(_RadioButtonGroup.default, _extends({
|
|
48
39
|
theme: theme
|
|
49
40
|
}, rest), children));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["RadioButtonFieldGroup.
|
|
1
|
+
{"version":3,"sources":["RadioButtonFieldGroup.tsx"],"names":["RadioButtonFieldGroup","label","children","theme","labelStyle","style","rest","fontSize","typography","headline4","color"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;AAQA,MAAMA,qBAAsC,GAAG,QAOzC;AAAA,MAP0C;AAC9CC,IAAAA,KAD8C;AAE9CC,IAAAA,QAF8C;AAG9CC,IAAAA,KAH8C;AAI9CC,IAAAA,UAJ8C;AAK9CC,IAAAA,KAL8C;AAM9C,OAAGC;AAN2C,GAO1C;AACJ,sBACE,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAED;AAAb,kBACE,6BAAC,aAAD;AACE,IAAA,KAAK,EAAE,CACL;AACEE,MAAAA,QAAQ,EAAEJ,KAAK,CAACK,UAAN,CAAiBC,SAAjB,CAA2BF,QADvC;AAEEG,MAAAA,KAAK,EAAEP,KAAK,CAACK,UAAN,CAAiBC,SAAjB,CAA2BC;AAFpC,KADK,EAKLN,UALK;AADT,KASGH,KATH,CADF,eAYE,6BAAC,yBAAD;AAAkB,IAAA,KAAK,EAAEE;AAAzB,KAAoCG,IAApC,GACGJ,QADH,CAZF,CADF;AAkBD,CA1BD;;eA4Be,wBAAUF,qBAAV,C","sourcesContent":["import React from \"react\";\nimport { View, StyleProp, TextStyle, ViewStyle } from \"react-native\";\nimport Text from \"../Text\";\nimport { withTheme } from \"../../theming\";\nimport RadioButtonGroup, { RadioButtonGroupProps } from \"./RadioButtonGroup\";\n\ninterface Props extends RadioButtonGroupProps {\n label?: string;\n labelStyle?: StyleProp<TextStyle>;\n style?: StyleProp<ViewStyle>;\n}\n\nconst RadioButtonFieldGroup: React.FC<Props> = ({\n label,\n children,\n theme,\n labelStyle,\n style,\n ...rest\n}) => {\n return (\n <View style={style}>\n <Text\n style={[\n {\n fontSize: theme.typography.headline4.fontSize,\n color: theme.typography.headline4.color,\n },\n labelStyle,\n ]}\n >\n {label}\n </Text>\n <RadioButtonGroup theme={theme} {...rest}>\n {children}\n </RadioButtonGroup>\n </View>\n );\n};\n\nexport default withTheme(RadioButtonFieldGroup);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Row.
|
|
1
|
+
{"version":3,"sources":["Row.tsx"],"names":["Row","titleTypeStyle","titleColor","subtitleTypeStyle","subtitleColor","title","subtitle","multilineSubtitle","image","right","style","styles","container","padding","leftContainer","uri","marginRight","width","Config","rowMultiLineImageSize","rowSingleLineImageSize","height","textContainer","color","marginTop","undefined","StyleSheet","create","flexDirection","flex","justifyContent","alignItems"],"mappings":";;;;;;;AAAA;;AACA;;AAUA;;AACA;;;;;;;;AAiBA,MAAMA,GAAoB,GAAG,QAWvB;AAAA,MAXwB;AAC5BC,IAAAA,cAD4B;AA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H,CADO,GAaL,IAzBN,CAfF,CADF,EA4CGG,KAAK,IAAIA,KAAK,EA5CjB,CADF;AAgDD,CA5DD;;AA8DA,MAAME,MAAM,GAAGe,wBAAWC,MAAX,CAAkB;AAC/Bb,EAAAA,aAAa,EAAE;AACbc,IAAAA,aAAa,EAAE,KADF;AAEbC,IAAAA,IAAI,EAAE;AAFO,GADgB;AAK/BjB,EAAAA,SAAS,EAAE;AACTgB,IAAAA,aAAa,EAAE,KADN;AAETE,IAAAA,cAAc,EAAE,eAFP;AAGTC,IAAAA,UAAU,EAAE;AAHH,GALoB;AAU/BT,EAAAA,aAAa,EAAE;AACbO,IAAAA,IAAI,EAAE,CADO;AAEbC,IAAAA,cAAc,EAAE;AAFH;AAVgB,CAAlB,CAAf;;eAgBe,wBAAU9B,GAAV,C","sourcesContent":["import * as React from \"react\";\nimport {\n View,\n Text,\n Image,\n ImageSourcePropType,\n StyleSheet,\n StyleProp,\n TextStyle,\n ViewStyle,\n} from \"react-native\";\nimport { withTheme } from \"../theming\";\nimport Config from \"./Config\";\nimport theme from \"../styles/DefaultTheme\";\n\ntype Props = {\n titleTypeStyle?: StyleProp<TextStyle>;\n titleColor?: string;\n subtitleTypeStyle?: StyleProp<TextStyle>;\n subtitleColor?: string;\n title?: string;\n subtitle?: string;\n multilineSubtitle?: boolean;\n image?: string | ImageSourcePropType;\n right?: () => React.ReactNode;\n style?: StyleProp<ViewStyle>;\n theme: typeof theme;\n};\n\nconst Row: React.FC<Props> = ({\n titleTypeStyle,\n titleColor,\n subtitleTypeStyle,\n subtitleColor,\n title,\n subtitle,\n multilineSubtitle,\n image,\n right,\n style,\n}) => {\n return (\n <View style={[styles.container, { padding: 16 }, style]}>\n <View style={styles.leftContainer}>\n {image && (\n <Image\n source={typeof image === \"string\" ? { uri: image } : image}\n style={{\n marginRight: 12,\n width: subtitle\n ? Config.rowMultiLineImageSize\n : Config.rowSingleLineImageSize,\n height: subtitle\n ? Config.rowMultiLineImageSize\n : Config.rowSingleLineImageSize,\n }}\n />\n )}\n <View style={styles.textContainer}>\n <Text\n style={[\n titleTypeStyle,\n {\n color: titleColor,\n },\n ]}\n numberOfLines={1}\n >\n {title}\n </Text>\n {subtitle ? (\n <Text\n style={[\n subtitleTypeStyle,\n {\n color: subtitleColor,\n marginTop: 4,\n },\n ]}\n numberOfLines={multilineSubtitle ? undefined : 1}\n >\n {subtitle}\n </Text>\n ) : null}\n </View>\n </View>\n {right && right()}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n leftContainer: {\n flexDirection: \"row\",\n flex: 1,\n },\n container: {\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n },\n textContainer: {\n flex: 1,\n justifyContent: \"center\",\n },\n});\n\nexport default withTheme(Row);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["RowHeadlineImageIcon.
|
|
1
|
+
{"version":3,"sources":["RowHeadlineImageIcon.tsx"],"names":["RowHeadlineImageIcon","Icon","icon","title","image","subtitle","multilineSubtitle","style","theme","colors","typography","headline6","strong","body2","medium","Config","rowMultiLineIconSize","rowSingleLineIconSize","light","marginLeft","alignSelf","marginTop"],"mappings":";;;;;;;AAAA;;AACA;;AAIA;;AACA;;;;;;;;AAaA,MAAMA,oBAAqC,GAAG,QASxC;AAAA,MATyC;AAC7CC,IAAAA,IAD6C;AAE7CC,IAAAA,IAF6C;AAG7CC,IAAAA,KAH6C;AAI7CC,IAAAA,KAJ6C;AAK7CC,IAAAA,QAL6C;AAM7CC,IAAAA,iBAAiB,GAAG,KANyB;AAO7CC,IAAAA,KAP6C;AAQ7CC,IAAAA,KAAK,EAAE;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV;AARsC,GASzC;AACJ,sBACE,oBAAC,YAAD;AACE,IAAA,cAAc,EAAEA,UAAU,CAACC,SAD7B;AAEE,IAAA,UAAU,EAAEF,MAAM,CAACG,MAFrB;AAGE,IAAA,iBAAiB,EAAEF,UAAU,CAACG,KAHhC;AAIE,IAAA,aAAa,EAAEJ,MAAM,CAACK,MAJxB;AAKE,IAAA,KAAK,EAAEX,KALT;AAME,IAAA,QAAQ,EAAEE,QANZ;AAOE,IAAA,iBAAiB,EAAEC,iBAPrB;AAQE,IAAA,KAAK,EAAEF,KART;AASE,IAAA,KAAK,EAAE,mBACL,oBAAC,IAAD;AACE,MAAA,IAAI,EAAEF,IADR;AAEE,MAAA,IAAI,EACFI,iBAAiB,GACbS,gBAAOC,oBADM,GAEbD,gBAAOE,qBALf;AAOE,MAAA,KAAK,EAAER,MAAM,CAACS,KAPhB;AAQE,MAAA,KAAK,EAAE;AACLC,QAAAA,UAAU,EAAE,EADP;AAELC,QAAAA,SAAS,EAAEd,iBAAiB,GAAG,YAAH,GAAkB,QAFzC;AAGLe,QAAAA,SAAS,EAAEf,iBAAiB,GAAG,CAAH,GAAO;AAH9B;AART,MAVJ;AAyBE,IAAA,KAAK,EAAEC;AAzBT,IADF;AA6BD,CAvCD;;eAyCe,wBAAUP,oBAAV,C","sourcesContent":["import * as React from \"react\";\nimport { withTheme } from \"../theming\";\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\n\nimport Row from \"./Row\";\nimport Config from \"./Config\";\nimport { ImageSourcePropType, StyleProp, ViewStyle } from \"react-native\";\n\ntype Props = {\n title?: string;\n image: string | ImageSourcePropType;\n subtitle?: string;\n multilineSubtitle?: boolean;\n icon: string;\n style?: StyleProp<ViewStyle>;\n theme: Theme;\n} & IconSlot;\n\nconst RowHeadlineImageIcon: React.FC<Props> = ({\n Icon,\n icon,\n title,\n image,\n subtitle,\n multilineSubtitle = false,\n style,\n theme: { colors, typography },\n}) => {\n return (\n <Row\n titleTypeStyle={typography.headline6}\n titleColor={colors.strong}\n subtitleTypeStyle={typography.body2}\n subtitleColor={colors.medium}\n title={title}\n subtitle={subtitle}\n multilineSubtitle={multilineSubtitle}\n image={image}\n right={() => (\n <Icon\n name={icon}\n size={\n multilineSubtitle\n ? Config.rowMultiLineIconSize\n : Config.rowSingleLineIconSize\n }\n color={colors.light}\n style={{\n marginLeft: 16,\n alignSelf: multilineSubtitle ? \"flex-start\" : \"center\",\n marginTop: multilineSubtitle ? 4 : 0,\n }}\n />\n )}\n style={style}\n />\n );\n};\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"
|
|
@@ -92,24 +93,5 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
92
93
|
|
|
93
94
|
var _default = (0, _theming.withTheme)(StarRating);
|
|
94
95
|
|
|
95
|
-
exports.default = _default;
|
|
96
|
-
//# sourceMappingURL=StarRating.js.mapx",
|
|
97
|
-
flexDirection: "row",
|
|
98
|
-
position: "absolute",
|
|
99
|
-
top: 0,
|
|
100
|
-
right: 0,
|
|
101
|
-
left: 0,
|
|
102
|
-
bottom: 0,
|
|
103
|
-
zIndex: 1
|
|
104
|
-
},
|
|
105
|
-
pressable: {
|
|
106
|
-
flex: 1,
|
|
107
|
-
height: "100%",
|
|
108
|
-
width: "50%"
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
var _default = (0, _theming.withTheme)(StarRating);
|
|
113
|
-
|
|
114
96
|
exports.default = _default;
|
|
115
97
|
//# sourceMappingURL=StarRating.js.map
|
|
@@ -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,IAAAA,IADmC;AAEnCC,IAAAA,QAA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B,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":["StepIndicator.js"],"names":["STEP_STATUS","CURRENT","FINISHED","UNFINISHED","StepIndicator","Component","constructor","props","stepCount","direction","progressBarBackgroundStyle","backgroundColor","state","customStyles","separatorUnFinishedColor","position","left","width","separatorStrokeWidth","top","height","bottom","separatorStrokeUnfinishedWidth","right","React","createElement","View","onLayout","event","setState","progressBarSize","nativeEvent","layout","onCurrentPositionChanged","currentPosition","style","progressBarStyle","separatorFinishedColor","separatorStrokeFinishedWidth","progressAnim","Animated","steps","push","TouchableWithoutFeedback","key","onPress","stepPressed","styles","stepContainer","flexDirection","renderStep","stepIndicatorContainer","currentStepIndicatorSize","labels","renderLabel","labelViews","map","label","index","selectedStepLabelStyle","color","currentStepLabelColor","labelColor","stepLabelItem","stepStatus","getStepStatus","Text","stepLabel","fontSize","labelSize","fontFamily","labelFontFamily","stepLabelsContainer","paddingHorizontal","paddingVertical","alignItems","labelAlign","renderStepIndicator","stepStyle","indicatorLabelStyle","stepIndicatorCurrentColor","borderWidth","currentStepStrokeWidth","borderColor","stepStrokeCurrentColor","sizeAnim","borderRadius","borderRadiusAnim","currentStepIndicatorLabelFontSize","stepIndicatorLabelCurrentColor","stepIndicatorFinishedColor","stepStrokeWidth","stepStrokeFinishedColor","stepIndicatorSize","stepIndicatorLabelFontSize","stepIndicatorLabelFinishedColor","stepIndicatorUnFinishedColor","stepStrokeUnFinishedColor","overflow","stepIndicatorLabelUnFinishedColor","step","stepPosition","animateToPosition","setValue","sequence","timing","toValue","duration","parallel","start","defaultStyles","Object","assign","Value","render","container","flex","renderProgressBarBackground","renderProgressBar","renderStepLabels","componentDidUpdate","prevProps","StyleShe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ated, TouchableWithoutFeedback, } from \"react-native\";\nconst STEP_STATUS = {\n CURRENT: \"current\",\n FINISHED: \"finished\",\n UNFINISHED: \"unfinished\",\n};\nexport default class StepIndicator extends Component {\n constructor(props) {\n super(props);\n const defaultStyles = {\n stepIndicatorSize: 30,\n currentStepIndicatorSize: 40,\n separatorStrokeWidth: 3,\n separatorStrokeUnfinishedWidth: 0,\n separatorStrokeFinishedWidth: 0,\n currentStepStrokeWidth: 5,\n stepStrokeWidth: 0,\n stepStrokeCurrentColor: \"#4aae4f\",\n stepStrokeFinishedColor: \"#4aae4f\",\n stepStrokeUnFinishedColor: \"#4aae4f\",\n separatorFinishedColor: \"#4aae4f\",\n separatorUnFinishedColor: \"#a4d4a5\",\n stepIndicatorFinishedColor: \"#4aae4f\",\n stepIndicatorUnFinishedColor: \"#a4d4a5\",\n stepIndicatorCurrentColor: \"#ffffff\",\n stepIndicatorLabelFontSize: 15,\n currentStepIndicatorLabelFontSize: 15,\n stepIndicatorLabelCurrentColor: \"#000000\",\n stepIndicatorLabelFinishedColor: \"#ffffff\",\n stepIndicatorLabelUnFinishedColor: \"rgba(255,255,255,0.5)\",\n labelColor: \"#000000\",\n labelSize: 13,\n labelAlign: \"center\",\n currentStepLabelColor: \"#4aae4f\",\n };\n const customStyles = Object.assign(defaultStyles, props.customStyles);\n this.state = {\n width: 0,\n height: 1,\n progressBarSize: -2,\n customStyles,\n };\n this.progressAnim = new Animated.Value(0);\n this.sizeAnim = new Animated.Value(this.state.customStyles.stepIndicatorSize);\n this.borderRadiusAnim = new Animated.Value(this.state.customStyles.stepIndicatorSize / 2);\n }\n stepPressed(position) {\n if (this.props.onPress) {\n this.props.onPress(position);\n }\n }\n render() {\n const { labels, direction } = this.props;\n return (React.createElement(View, { style: [\n styles.container,\n direction === \"vertical\"\n ? { flexDirection: \"row\", flex: 1 }\n : { flexDirection: \"column\" },\n ] },\n this.state.width !== 0 && this.renderProgressBarBackground(),\n this.state.width !== 0 && this.renderProgressBar(),\n this.renderStepIndicator(),\n labels && this.renderStepLabels()));\n }\n componentDidUpdate(prevProps) {\n // if (prevProps.customStyles !== this.props.customStyles) {\n // this.setState((state) => ({\n // customStyles: Object.assign(\n // state.customStyles,\n // this.props.customStyles\n // ),\n // }));\n // }\n if (prevProps.currentPosition !== this.props.currentPosition) {\n this.onCurrentPositionChanged(this.props.currentPosition);\n }\n }\n renderProgressBarBackground = () => {\n const { stepCount, direction } = this.props;\n let progressBarBackgroundStyle;\n if (direction === \"vertical\") {\n progressBarBackgroundStyle = {\n backgroundColor: this.state.customStyles.separatorUnFinishedColor,\n position: \"absolute\",\n left: (this.state.width - this.state.customStyles.separatorStrokeWidth) / 2,\n top: this.state.height / (2 * stepCount),\n bottom: this.state.height / (2 * stepCount),\n width: this.state.customStyles.separatorStrokeUnfinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeUnfinishedWidth,\n };\n }\n else {\n progressBarBackgroundStyle = {\n backgroundColor: this.state.customStyles.separatorUnFinishedColor,\n position: \"absolute\",\n top: (this.state.height - this.state.customStyles.separatorStrokeWidth) /\n 2,\n left: this.state.width / (2 * stepCount),\n right: this.state.width / (2 * stepCount),\n height: this.state.customStyles.separatorStrokeUnfinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeUnfinishedWidth,\n };\n }\n return (React.createElement(View, { onLayout: (event) => {\n if (direction === \"vertical\") {\n this.setState({ progressBarSize: event.nativeEvent.layout.height }, () => {\n this.onCurrentPositionChanged(this.props.currentPosition);\n });\n }\n else {\n this.setState({ progressBarSize: event.nativeEvent.layout.width }, () => {\n this.onCurrentPositionChanged(this.props.currentPosition);\n });\n }\n }, style: progressBarBackgroundStyle }));\n };\n renderProgressBar = () => {\n const { stepCount, direction } = this.props;\n let progressBarStyle;\n if (direction === \"vertical\") {\n progressBarStyle = {\n backgroundColor: this.state.customStyles.separatorFinishedColor,\n position: \"absolute\",\n left: (this.state.width - this.state.customStyles.separatorStrokeWidth) / 2,\n top: this.state.height / (2 * stepCount),\n bottom: this.state.height / (2 * stepCount),\n width: this.state.customStyles.separatorStrokeFinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeFinishedWidth,\n height: this.progressAnim,\n };\n }\n else {\n progressBarStyle = {\n backgroundColor: this.state.customStyles.separatorFinishedColor,\n position: \"absolute\",\n top: (this.state.height - this.state.customStyles.separatorStrokeWidth) /\n 2,\n left: this.state.width / (2 * stepCount),\n right: this.state.width / (2 * stepCount),\n height: this.state.customStyles.separatorStrokeFinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeFinishedWidth,\n width: this.progressAnim,\n };\n }\n return React.createElement(Animated.View, { style: progressBarStyle });\n };\n renderStepIndicator = () => {\n let steps = [];\n const { stepCount, direction } = this.props;\n for (let position = 0; position < stepCount; position++) {\n steps.push(React.createElement(TouchableWithoutFeedback, { key: position, onPress: () => this.stepPressed(position) },\n React.createElement(View, { style: [\n styles.stepContainer,\n direction === \"vertical\"\n ? { flexDirection: \"column\" }\n : { flexDirection: \"row\" },\n ] }, this.renderStep(position))));\n }\n return (React.createElement(View, { onLayout: (event) => this.setState({\n width: event.nativeEvent.layout.width,\n height: event.nativeEvent.layout.height,\n }), style: [\n styles.stepIndicatorContainer,\n direction === \"vertical\"\n ? {\n flexDirection: \"column\",\n width: this.state.customStyles.currentStepIndicatorSize,\n }\n : {\n flexDirection: \"row\",\n height: this.state.customStyles.currentStepIndicatorSize,\n },\n ] }, steps));\n };\n renderStepLabels = () => {\n const { labels, direction, currentPosition, renderLabel } = this.props;\n var labelViews = labels.map((label, index) => {\n const selectedStepLabelStyle = index === currentPosition\n ? { color: this.state.customStyles.currentStepLabelColor }\n : { color: this.state.customStyles.labelColor };\n return (React.createElement(TouchableWithoutFeedback, { style: styles.stepLabelItem, key: index, onPress: () => this.stepPressed(index) },\n React.createElement(View, { style: styles.stepLabelItem }, renderLabel ? (renderLabel({\n position: index,\n stepStatus: this.getStepStatus(index),\n label,\n currentPosition,\n })) : (React.createElement(Text, { style: [\n styles.stepLabel,\n selectedStepLabelStyle,\n {\n fontSize: this.state.customStyles.labelSize,\n fontFamily: this.state.customStyles.labelFontFamily,\n },\n ] }, label)))));\n });\n return (React.createElement(View, { style: [\n styles.stepLabelsContainer,\n direction === \"vertical\"\n ? { flexDirection: \"column\", paddingHorizontal: 4 }\n : { flexDirection: \"row\", paddingVertical: 4 },\n { alignItems: this.state.customStyles.labelAlign },\n ] }, labelViews));\n };\n renderStep = (position) => {\n const { renderStepIndicator } = this.props;\n let stepStyle;\n let indicatorLabelStyle;\n switch (this.getStepStatus(position)) {\n case STEP_STATUS.CURRENT: {\n stepStyle = {\n backgroundColor: this.state.customStyles.stepIndicatorCurrentColor,\n borderWidth: this.state.customStyles.currentStepStrokeWidth,\n borderColor: this.state.customStyles.stepStrokeCurrentColor,\n height: this.sizeAnim,\n width: this.sizeAnim,\n borderRadius: this.borderRadiusAnim,\n };\n indicatorLabelStyle = {\n fontSize: this.state.customStyles.currentStepIndicatorLabelFontSize,\n color: this.state.customStyles.stepIndicatorLabelCurrentColor,\n };\n break;\n }\n case STEP_STATUS.FINISHED: {\n stepStyle = {\n backgroundColor: this.state.customStyles.stepIndicatorFinishedColor,\n borderWidth: this.state.customStyles.stepStrokeWidth,\n borderColor: this.state.customStyles.stepStrokeFinishedColor,\n height: this.state.customStyles.stepIndicatorSize,\n width: this.state.customStyles.stepIndicatorSize,\n borderRadius: this.state.customStyles.stepIndicatorSize / 2,\n };\n indicatorLabelStyle = {\n fontSize: this.state.customStyles.stepIndicatorLabelFontSize,\n color: this.state.customStyles.stepIndicatorLabelFinishedColor,\n };\n break;\n }\n case STEP_STATUS.UNFINISHED: {\n stepStyle = {\n backgroundColor: this.state.customStyles.stepIndicatorUnFinishedColor,\n borderWidth: this.state.customStyles.stepStrokeWidth,\n borderColor: this.state.customStyles.stepStrokeUnFinishedColor,\n height: this.state.customStyles.stepIndicatorSize,\n width: this.state.customStyles.stepIndicatorSize,\n borderRadius: this.state.customStyles.stepIndicatorSize / 2,\n };\n indicatorLabelStyle = {\n overflow: \"hidden\",\n fontSize: this.state.customStyles.stepIndicatorLabelFontSize,\n color: this.state.customStyles.stepIndicatorLabelUnFinishedColor,\n };\n break;\n }\n default:\n }\n return (React.createElement(Animated.View, { key: \"step-indicator\", style: [styles.step, stepStyle] }, renderStepIndicator ? (renderStepIndicator({\n position,\n stepStatus: this.getStepStatus(position),\n })) : (React.createElement(Text, { style: indicatorLabelStyle }, `${position + 1}`))));\n };\n getStepStatus = (stepPosition) => {\n const { currentPosition } = this.props;\n if (stepPosition === currentPosition) {\n return STEP_STATUS.CURRENT;\n }\n else if (stepPosition < currentPosition) {\n return STEP_STATUS.FINISHED;\n }\n else {\n return STEP_STATUS.UNFINISHED;\n }\n };\n onCurrentPositionChanged = (position) => {\n let { stepCount } = this.props;\n if (position > stepCount - 1) {\n position = stepCount - 1;\n }\n const animateToPosition = (this.state.progressBarSize / (stepCount - 1)) * position;\n this.sizeAnim.setValue(this.state.customStyles.stepIndicatorSize);\n this.borderRadiusAnim.setValue(this.state.customStyles.stepIndicatorSize / 2);\n Animated.sequence([\n Animated.timing(this.progressAnim, {\n toValue: animateToPosition,\n duration: 200,\n }),\n Animated.parallel([\n Animated.timing(this.sizeAnim, {\n toValue: this.state.customStyles.currentStepIndicatorSize,\n duration: 100,\n }),\n Animated.timing(this.borderRadiusAnim, {\n toValue: this.state.customStyles.currentStepIndicatorSize / 2,\n duration: 100,\n }),\n ]),\n ]).start();\n };\n}\nconst styles = StyleSheet.create({\n container: {\n backgroundColor: \"transparent\",\n },\n stepIndicatorContainer: {\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"space-around\",\n backgroundColor: \"transparent\",\n },\n stepLabelsContainer: {\n justifyContent: \"space-around\",\n },\n step: {\n alignItems: \"center\",\n justifyContent: \"center\",\n zIndex: 2,\n },\n stepContainer: {\n flex: 1,\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n stepLabel: {\n fontSize: 12,\n textAlign: \"center\",\n fontWeight: \"500\",\n },\n stepLabelItem: {\n flex: 1,\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n});\nStepIndicator.defaultProps = {\n currentPosition: 0,\n stepCount: 5,\n customStyles: {},\n direction: \"horizontal\",\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["StepIndicator.tsx"],"names":["STEP_STATUS","CURRENT","FINISHED","UNFINISHED","StepIndicator","Component","constructor","props","stepCount","direction","progressBarBackgroundStyle","backgroundColor","state","customStyles","separatorUnFinishedColor","position","left","width","separatorStrokeWidth","top","height","bottom","separatorStrokeUnfinishedWidth","right","event","setState","progressBarSize","nativeEvent","layout","onCurrentPositionChanged","currentPosition","progressBarStyle","separatorFinishedColor","separatorStrokeFinishedWidth","progressAnim","steps","push","stepPressed","styles","stepContainer","flexDirection","renderStep","stepIndicatorContainer","currentStepIndicatorSize","labels","renderLabel","labelViews","map","label","index","selectedStepLabelStyle","color","currentStepLabelColor","labelColor","stepLabelItem","stepStatus","getStepStatus","stepLabel","fontSize","labelSize","fontFamily","labelFontFamily","stepLabelsContainer","paddingHorizontal","paddingVertical","alignItems","labelAlign","renderStepIndicator","stepStyle","indicatorLabelStyle","stepIndicatorCurrentColor","borderWidth","currentStepStrokeWidth","borderColor","stepStrokeCurrentColor","sizeAnim","borderRadius","borderRadiusAnim","currentStepIndicatorLabelFontSize","stepIndicatorLabelCurrentColor","stepIndicatorFinishedColor","stepStrokeWidth","stepStrokeFinishedColor","stepIndicatorSize","stepIndicatorLabelFontSize","stepIndicatorLabelFinishedColor","stepIndicatorUnFinishedColor","stepStrokeUnFinishedColor","overflow","stepIndicatorLabelUnFinishedColor","step","stepPosition","animateToPosition","setValue","Animated","sequence","timing","toValue","duration","parallel","start","defaultStyles","Object","assign","Value","onPress","render","container","flex","renderProgressBarBackground","renderProgressBar","renderStepLabels","componentDidUpdate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JmD,IAAAA,cAAc,EAAE,QAFZ;AAGJC,IAAAA,MAAM,EAAE;AAHJ,GAbyB;AAkB/B9E,EAAAA,aAAa,EAAE;AACbqE,IAAAA,IAAI,EAAE,CADO;AAEbpE,IAAAA,aAAa,EAAE,KAFF;AAGbyB,IAAAA,UAAU,EAAE,QAHC;AAIbmD,IAAAA,cAAc,EAAE;AAJH,GAlBgB;AAwB/B3D,EAAAA,SAAS,EAAE;AACTC,IAAAA,QAAQ,EAAE,EADD;AAET4D,IAAAA,SAAS,EAAE,QAFF;AAGTC,IAAAA,UAAU,EAAE;AAHH,GAxBoB;AA6B/BjE,EAAAA,aAAa,EAAE;AACbsD,IAAAA,IAAI,EAAE,CADO;AAEb3C,IAAAA,UAAU,EAAE,QAFC;AAGbmD,IAAAA,cAAc,EAAE;AAHH;AA7BgB,CAAlB,CAAf;;AAoCAhH,aAAa,CAACoH,YAAd,GAA6B;AAC3B1F,EAAAA,eAAe,EAAE,CADU;AAE3BtB,EAAAA,SAAS,EAAE,CAFgB;AAG3BK,EAAAA,YAAY,EAAE,EAHa;AAI3BJ,EAAAA,SAAS,EAAE;AAJgB,CAA7B","sourcesContent":["// @ts-nocheck\nimport React, { Component } from \"react\";\nimport {\n View,\n Text,\n StyleSheet,\n Animated,\n TouchableWithoutFeedback,\n} from \"react-native\";\n\nconst STEP_STATUS = {\n CURRENT: \"current\",\n FINISHED: \"finished\",\n UNFINISHED: \"unfinished\",\n};\n\ninterface CustomStyles {\n stepIndicatorSize?: number;\n currentStepIndicatorSize?: number;\n separatorStrokeWidth?: number;\n separatorStrokeUnfinishedWidth?: number;\n separatorStrokeFinishedWidth?: number;\n currentStepStrokeWidth: number;\n stepStrokeWidth?: number;\n stepStrokeCurrentColor?: string;\n stepStrokeFinishedColor: string;\n stepStrokeUnFinishedColor: string;\n separatorFinishedColor: string;\n separatorUnFinishedColor: string;\n stepIndicatorFinishedColor: string;\n stepIndicatorUnFinishedColor: string;\n stepIndicatorCurrentColor: string;\n stepIndicatorLabelFontSize: number;\n currentStepIndicatorLabelFontSize?: number;\n stepIndicatorLabelCurrentColor: string;\n stepIndicatorLabelFinishedColor: string;\n stepIndicatorLabelUnFinishedColor: string;\n labelColor?: string;\n labelSize?: number;\n labelAlign?: string;\n currentStepLabelColor?: string;\n labelFontFamily?: string;\n}\n\ntype Props = {\n stepCount: number;\n currentPosition: number;\n customStyles: CustomStyles;\n};\n\ntype State = {\n width: number;\n height: number;\n progressBarSize: number;\n customStyles: CustomStyles;\n};\n\nexport default class StepIndicator extends Component<Props, State> {\n constructor(props: Props) {\n super(props);\n\n const defaultStyles = {\n stepIndicatorSize: 30,\n currentStepIndicatorSize: 40,\n separatorStrokeWidth: 3,\n separatorStrokeUnfinishedWidth: 0,\n separatorStrokeFinishedWidth: 0,\n currentStepStrokeWidth: 5,\n stepStrokeWidth: 0,\n stepStrokeCurrentColor: \"#4aae4f\",\n stepStrokeFinishedColor: \"#4aae4f\",\n stepStrokeUnFinishedColor: \"#4aae4f\",\n separatorFinishedColor: \"#4aae4f\",\n separatorUnFinishedColor: \"#a4d4a5\",\n stepIndicatorFinishedColor: \"#4aae4f\",\n stepIndicatorUnFinishedColor: \"#a4d4a5\",\n stepIndicatorCurrentColor: \"#ffffff\",\n stepIndicatorLabelFontSize: 15,\n currentStepIndicatorLabelFontSize: 15,\n stepIndicatorLabelCurrentColor: \"#000000\",\n stepIndicatorLabelFinishedColor: \"#ffffff\",\n stepIndicatorLabelUnFinishedColor: \"rgba(255,255,255,0.5)\",\n labelColor: \"#000000\",\n labelSize: 13,\n labelAlign: \"center\",\n currentStepLabelColor: \"#4aae4f\",\n };\n\n const customStyles = Object.assign(defaultStyles, props.customStyles);\n\n this.state = {\n width: 0,\n height: 1,\n progressBarSize: -2,\n customStyles,\n };\n\n this.progressAnim = new Animated.Value(0);\n this.sizeAnim = new Animated.Value(\n this.state.customStyles.stepIndicatorSize\n );\n this.borderRadiusAnim = new Animated.Value(\n this.state.customStyles.stepIndicatorSize / 2\n );\n }\n\n stepPressed(position) {\n if (this.props.onPress) {\n this.props.onPress(position);\n }\n }\n\n render() {\n const { labels, direction } = this.props;\n return (\n <View\n style={[\n styles.container,\n direction === \"vertical\"\n ? { flexDirection: \"row\", flex: 1 }\n : { flexDirection: \"column\" },\n ]}\n >\n {this.state.width !== 0 && this.renderProgressBarBackground()}\n {this.state.width !== 0 && this.renderProgressBar()}\n {this.renderStepIndicator()}\n {labels && this.renderStepLabels()}\n </View>\n );\n }\n\n componentDidUpdate(prevProps) {\n // if (prevProps.customStyles !== this.props.customStyles) {\n // this.setState((state) => ({\n // customStyles: Object.assign(\n // state.customStyles,\n // this.props.customStyles\n // ),\n // }));\n // }\n\n if (prevProps.currentPosition !== this.props.currentPosition) {\n this.onCurrentPositionChanged(this.props.currentPosition);\n }\n }\n\n renderProgressBarBackground = () => {\n const { stepCount, direction } = this.props;\n let progressBarBackgroundStyle;\n if (direction === \"vertical\") {\n progressBarBackgroundStyle = {\n backgroundColor: this.state.customStyles.separatorUnFinishedColor,\n position: \"absolute\",\n left:\n (this.state.width - this.state.customStyles.separatorStrokeWidth) / 2,\n top: this.state.height / (2 * stepCount),\n bottom: this.state.height / (2 * stepCount),\n width:\n this.state.customStyles.separatorStrokeUnfinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeUnfinishedWidth,\n };\n } else {\n progressBarBackgroundStyle = {\n backgroundColor: this.state.customStyles.separatorUnFinishedColor,\n position: \"absolute\",\n top:\n (this.state.height - this.state.customStyles.separatorStrokeWidth) /\n 2,\n left: this.state.width / (2 * stepCount),\n right: this.state.width / (2 * stepCount),\n height:\n this.state.customStyles.separatorStrokeUnfinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeUnfinishedWidth,\n };\n }\n return (\n <View\n onLayout={(event) => {\n if (direction === \"vertical\") {\n this.setState(\n { progressBarSize: event.nativeEvent.layout.height },\n () => {\n this.onCurrentPositionChanged(this.props.currentPosition);\n }\n );\n } else {\n this.setState(\n { progressBarSize: event.nativeEvent.layout.width },\n () => {\n this.onCurrentPositionChanged(this.props.currentPosition);\n }\n );\n }\n }}\n style={progressBarBackgroundStyle}\n />\n );\n };\n\n renderProgressBar = () => {\n const { stepCount, direction } = this.props;\n let progressBarStyle;\n if (direction === \"vertical\") {\n progressBarStyle = {\n backgroundColor: this.state.customStyles.separatorFinishedColor,\n position: \"absolute\",\n left:\n (this.state.width - this.state.customStyles.separatorStrokeWidth) / 2,\n top: this.state.height / (2 * stepCount),\n bottom: this.state.height / (2 * stepCount),\n width:\n this.state.customStyles.separatorStrokeFinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeFinishedWidth,\n height: this.progressAnim,\n };\n } else {\n progressBarStyle = {\n backgroundColor: this.state.customStyles.separatorFinishedColor,\n position: \"absolute\",\n top:\n (this.state.height - this.state.customStyles.separatorStrokeWidth) /\n 2,\n left: this.state.width / (2 * stepCount),\n right: this.state.width / (2 * stepCount),\n height:\n this.state.customStyles.separatorStrokeFinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeFinishedWidth,\n width: this.progressAnim,\n };\n }\n return <Animated.View style={progressBarStyle} />;\n };\n\n renderStepIndicator = () => {\n let steps = [];\n const { stepCount, direction } = this.props;\n for (let position = 0; position < stepCount; position++) {\n steps.push(\n <TouchableWithoutFeedback\n key={position}\n onPress={() => this.stepPressed(position)}\n >\n <View\n style={[\n styles.stepContainer,\n direction === \"vertical\"\n ? { flexDirection: \"column\" }\n : { flexDirection: \"row\" },\n ]}\n >\n {this.renderStep(position)}\n </View>\n </TouchableWithoutFeedback>\n );\n }\n return (\n <View\n onLayout={(event) =>\n this.setState({\n width: event.nativeEvent.layout.width,\n height: event.nativeEvent.layout.height,\n })\n }\n style={[\n styles.stepIndicatorContainer,\n direction === \"vertical\"\n ? {\n flexDirection: \"column\",\n width: this.state.customStyles.currentStepIndicatorSize,\n }\n : {\n flexDirection: \"row\",\n height: this.state.customStyles.currentStepIndicatorSize,\n },\n ]}\n >\n {steps}\n </View>\n );\n };\n\n renderStepLabels = () => {\n const { labels, direction, currentPosition, renderLabel } = this.props;\n var labelViews = labels.map((label, index) => {\n const selectedStepLabelStyle =\n index === currentPosition\n ? { color: this.state.customStyles.currentStepLabelColor }\n : { color: this.state.customStyles.labelColor };\n return (\n <TouchableWithoutFeedback\n style={styles.stepLabelItem}\n key={index}\n onPress={() => this.stepPressed(index)}\n >\n <View style={styles.stepLabelItem}>\n {renderLabel ? (\n renderLabel({\n position: index,\n stepStatus: this.getStepStatus(index),\n label,\n currentPosition,\n })\n ) : (\n <Text\n style={[\n styles.stepLabel,\n selectedStepLabelStyle,\n {\n fontSize: this.state.customStyles.labelSize,\n fontFamily: this.state.customStyles.labelFontFamily,\n },\n ]}\n >\n {label}\n </Text>\n )}\n </View>\n </TouchableWithoutFeedback>\n );\n });\n\n return (\n <View\n style={[\n styles.stepLabelsContainer,\n direction === \"vertical\"\n ? { flexDirection: \"column\", paddingHorizontal: 4 }\n : { flexDirection: \"row\", paddingVertical: 4 },\n { alignItems: this.state.customStyles.labelAlign },\n ]}\n >\n {labelViews}\n </View>\n );\n };\n\n renderStep = (position) => {\n const { renderStepIndicator } = this.props;\n let stepStyle;\n let indicatorLabelStyle;\n\n switch (this.getStepStatus(position)) {\n case STEP_STATUS.CURRENT: {\n stepStyle = {\n backgroundColor: this.state.customStyles.stepIndicatorCurrentColor,\n borderWidth: this.state.customStyles.currentStepStrokeWidth,\n borderColor: this.state.customStyles.stepStrokeCurrentColor,\n height: this.sizeAnim,\n width: this.sizeAnim,\n borderRadius: this.borderRadiusAnim,\n };\n indicatorLabelStyle = {\n fontSize: this.state.customStyles.currentStepIndicatorLabelFontSize,\n color: this.state.customStyles.stepIndicatorLabelCurrentColor,\n };\n\n break;\n }\n case STEP_STATUS.FINISHED: {\n stepStyle = {\n backgroundColor: this.state.customStyles.stepIndicatorFinishedColor,\n borderWidth: this.state.customStyles.stepStrokeWidth,\n borderColor: this.state.customStyles.stepStrokeFinishedColor,\n height: this.state.customStyles.stepIndicatorSize,\n width: this.state.customStyles.stepIndicatorSize,\n borderRadius: this.state.customStyles.stepIndicatorSize / 2,\n };\n indicatorLabelStyle = {\n fontSize: this.state.customStyles.stepIndicatorLabelFontSize,\n color: this.state.customStyles.stepIndicatorLabelFinishedColor,\n };\n break;\n }\n\n case STEP_STATUS.UNFINISHED: {\n stepStyle = {\n backgroundColor: this.state.customStyles.stepIndicatorUnFinishedColor,\n borderWidth: this.state.customStyles.stepStrokeWidth,\n borderColor: this.state.customStyles.stepStrokeUnFinishedColor,\n height: this.state.customStyles.stepIndicatorSize,\n width: this.state.customStyles.stepIndicatorSize,\n borderRadius: this.state.customStyles.stepIndicatorSize / 2,\n };\n indicatorLabelStyle = {\n overflow: \"hidden\",\n fontSize: this.state.customStyles.stepIndicatorLabelFontSize,\n color: this.state.customStyles.stepIndicatorLabelUnFinishedColor,\n };\n break;\n }\n default:\n }\n\n return (\n <Animated.View key={\"step-indicator\"} style={[styles.step, stepStyle]}>\n {renderStepIndicator ? (\n renderStepIndicator({\n position,\n stepStatus: this.getStepStatus(position),\n })\n ) : (\n <Text style={indicatorLabelStyle}>{`${position + 1}`}</Text>\n )}\n </Animated.View>\n );\n };\n\n getStepStatus = (stepPosition) => {\n const { currentPosition } = this.props;\n if (stepPosition === currentPosition) {\n return STEP_STATUS.CURRENT;\n } else if (stepPosition < currentPosition) {\n return STEP_STATUS.FINISHED;\n } else {\n return STEP_STATUS.UNFINISHED;\n }\n };\n\n onCurrentPositionChanged = (position) => {\n let { stepCount } = this.props;\n if (position > stepCount - 1) {\n position = stepCount - 1;\n }\n const animateToPosition =\n (this.state.progressBarSize / (stepCount - 1)) * position;\n this.sizeAnim.setValue(this.state.customStyles.stepIndicatorSize);\n this.borderRadiusAnim.setValue(\n this.state.customStyles.stepIndicatorSize / 2\n );\n Animated.sequence([\n Animated.timing(this.progressAnim, {\n toValue: animateToPosition,\n duration: 200,\n }),\n Animated.parallel([\n Animated.timing(this.sizeAnim, {\n toValue: this.state.customStyles.currentStepIndicatorSize,\n duration: 100,\n }),\n Animated.timing(this.borderRadiusAnim, {\n toValue: this.state.customStyles.currentStepIndicatorSize / 2,\n duration: 100,\n }),\n ]),\n ]).start();\n };\n}\n\nconst styles = StyleSheet.create({\n container: {\n backgroundColor: \"transparent\",\n },\n stepIndicatorContainer: {\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"space-around\",\n backgroundColor: \"transparent\",\n },\n stepLabelsContainer: {\n justifyContent: \"space-around\",\n },\n step: {\n alignItems: \"center\",\n justifyContent: \"center\",\n zIndex: 2,\n },\n stepContainer: {\n flex: 1,\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n stepLabel: {\n fontSize: 12,\n textAlign: \"center\",\n fontWeight: \"500\",\n },\n stepLabelItem: {\n flex: 1,\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n});\n\nStepIndicator.defaultProps = {\n currentPosition: 0,\n stepCount: 5,\n customStyles: {},\n direction: \"horizontal\",\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Stepper.
|
|
1
|
+
{"version":3,"sources":["Stepper.tsx"],"names":["Stepper","min","Infinity","max","value","valueProp","defaultValue","style","typeStyle","iconSize","iconColor","onChange","theme","colors","typography","Icon","setValue","isValidValue","valueArg","handlePlusOrMinus","type","newValue","flexDirection","opacity","body1","textAlign","alignSelf","color","medium","marginHorizontal"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAGA;;;;;;;;AAeA,MAAMA,OAAkB,GAAG,QAYrB;AAAA,MAZsB;AAC1BC,IAAAA,GAAG,GAAG,CAACC,QADmB;AAE1BC,IAAAA,GAAG,GAAGD,QAFoB;AAG1BE,IAAAA,KAAK,EAAEC,SAHmB;AAI1BC,IAAAA,YAJ0B;AAK1BC,IAAAA,KAL0B;AA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IAAA,IAAI,EAAEV,QAJR;AAKE,IAAA,KAAK,EAAEC,SALT;AAME,IAAA,QAAQ,EAAEN,KAAK,KAAKH,GANtB;AAOE,IAAA,KAAK,EAAE;AAAEsB,MAAAA,OAAO,EAAEnB,KAAK,KAAKH,GAAV,GAAgB,GAAhB,GAAsB;AAAjC;AAPT,IADF,eAWE,6BAAC,iBAAD;AACE,IAAA,KAAK,EAAE,CACLa,UAAU,CAACU,KADN,EAEL;AACEC,MAAAA,SAAS,EAAE,QADb;AAEEC,MAAAA,SAAS,EAAE,QAFb;AAGEC,MAAAA,KAAK,EAAEd,MAAM,CAACe,MAHhB;AAIEC,MAAAA,gBAAgB,EAAE;AAJpB,KAFK,EAQLrB,SARK;AADT,KAYGJ,KAZH,CAXF,eA0BE,6BAAC,mBAAD;AACE,IAAA,IAAI,EAAEW,IADR;AAEE,IAAA,IAAI,EAAC,mBAFP;AAGE,IAAA,OAAO,EAAE,MAAMI,iBAAiB,CAAC,MAAD,CAHlC;AAIE,IAAA,IAAI,EAAEV,QAJR;AAKE,IAAA,KAAK,EAAEC,SALT;AAME,IAAA,QAAQ,EAAEN,KAAK,KAAKD,GANtB;AAOE,IAAA,KAAK,EAAE;AAAEoB,MAAAA,OAAO,EAAEnB,KAAK,KAAKD,GAAV,GAAgB,GAAhB,GAAsB;AAAjC;AAPT,IA1BF,CADF;AAsCD,CA5ED;;eA8Ee,wBAAUH,OAAV,C","sourcesContent":["import React, { FC, useEffect, useState } from \"react\";\nimport { View, Text, StyleProp, ViewStyle, TextStyle } from \"react-native\";\nimport { isNumber } from \"lodash\";\n\nimport { withTheme } from \"../theming\";\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\nimport IconButton from \"./IconButton\";\n\ntype Props = {\n min: number;\n max: number;\n value?: number;\n defaultValue?: number;\n style?: StyleProp<ViewStyle>;\n typeStyle?: StyleProp<TextStyle>;\n iconSize: number;\n iconColor?: string;\n onChange?: (value: number) => void;\n theme: Theme;\n} & IconSlot;\n\nconst Stepper: FC<Props> = ({\n min = -Infinity,\n max = Infinity,\n value: valueProp,\n defaultValue,\n style,\n typeStyle,\n iconSize = 24,\n iconColor,\n onChange,\n theme: { colors, typography },\n Icon,\n}) => {\n const [value, setValue] = useState(defaultValue ?? 0);\n\n const isValidValue = (valueArg: number) => valueArg >= min && valueArg <= max;\n\n const handlePlusOrMinus = (type: \"plus\" | \"minus\") => {\n const newValue = type === \"plus\" ? value + 1 : value - 1;\n\n if (isValidValue(newValue)) {\n setValue(newValue);\n onChange?.(newValue);\n }\n };\n\n useEffect(() => {\n if (\n valueProp != null &&\n isNumber(valueProp) &&\n valueProp !== value &&\n isValidValue(valueProp)\n ) {\n setValue(valueProp);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [valueProp]);\n\n return (\n <View style={[{ flexDirection: \"row\" }, style]}>\n <IconButton\n Icon={Icon}\n icon=\"MaterialIcons/remove\"\n onPress={() => handlePlusOrMinus(\"minus\")}\n size={iconSize}\n color={iconColor}\n disabled={value === min}\n style={{ opacity: value === min ? 0.5 : 1 }}\n />\n\n <Text\n style={[\n typography.body1,\n {\n textAlign: \"center\",\n alignSelf: \"center\",\n color: colors.medium,\n marginHorizontal: 8,\n },\n typeStyle,\n ]}\n >\n {value}\n </Text>\n\n <IconButton\n Icon={Icon}\n icon=\"MaterialIcons/add\"\n onPress={() => handlePlusOrMinus(\"plus\")}\n size={iconSize}\n color={iconColor}\n disabled={value === max}\n style={{ opacity: value === max ? 0.5 : 1 }}\n />\n </View>\n );\n};\n\nexport default withTheme(Stepper);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Swiper.
|
|
1
|
+
{"version":3,"sources":["Swiper.tsx"],"names":["Swiper","vertical","loop","timeout","from","prevTitle","nextTitle","prevTitleColor","nextTitleColor","dotsTouchable","dotColor","dotActiveColor","children","style","prevTitleStyle","color","nextTitleStyle","dotProps","badgeStyle","backgroundColor","dotActiveStyle"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;AAkBA,MAAMA,MAAM,GAAG;AAAA,MAAC;AACdC,IAAAA,QAAQ,GAAG,KADG;AAEdC,IAAAA,IAAI,GAAG,KAFO;AAGdC,IAAAA,OAAO,GAAG,CAHI;AAIdC,IAAAA,IAAI,GAAG,CAJO;AAKdC,IAAAA,SAAS,GAAG,EALE;AAMdC,IAAAA,SAAS,GAAG,EANE;AAOdC,IAAAA,cAPc;AAQdC,IAAAA,cARc;AASdC,IAAAA,aAAa,GAAG,IATF;AAUdC,IAAAA,QAVc;AAWdC,IAAAA,cAXc;AAYdC,IAAAA,QAZc;AAadC,IAAAA;AAbc,GAAD;AAAA,sBAeb,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAEA;AAAb,kBACE,6BAAC,6BAAD;AACE,IAAA,IAAI,EAAET,IADR;AAEE,IAAA,IAAI,EAAEF,IAFR;AAGE,IAAA,OAAO,EAAEC,OAHX;AAIE,IAAA,QAAQ,EAAEF,QAJZ;AAKE,IAAA,aAAa,EAAE;AACbI,MAAAA,SADa;AAEbC,MAAAA,SAFa;AAGbQ,MAAAA,cAAc,EAAE;AAAEC,QAAAA,KAAK,EAAER;AAAT,OAHH;AAIbS,MAAAA,cAAc,EAAE;AAAED,QAAAA,KAAK,EAAEP;AAAT,OAJH;AAKbC,MAAAA,aALa;AAMb,UAAIC,QAAQ,GACR;AAAEO,QAAAA,QAAQ,EAAE;AAAEC,UAAAA,UAAU,EAAE;AAAEC,YAAAA,eAAe,EAAET;AAAnB;AAAd;AAAZ,OADQ,GAER,EAFJ,CANa;AASb,UAAIC,cAAc,GACd;AAAES,QAAAA,cAAc,EAAE;AAAED,UAAAA,eAAe,EAAER;AAAnB;AAAlB,OADc,GAEd,EAFJ;AATa;AALjB,KAmBGC,QAnBH,CADF,CAfa;AAAA,CAAf;;eAwCeZ,M","sourcesContent":["import React from \"react\";\nimport { View, StyleProp, ViewStyle } from \"react-native\";\nimport SwiperComponent from \"react-native-web-swiper\";\n\nexport interface SwiperProps {\n vertical?: boolean;\n loop?: boolean;\n from?: number;\n timeout?: number;\n prevTitle?: string;\n nextTitle?: string;\n prevTitleColor?: string;\n nextTitleColor?: string;\n dotsTouchable?: boolean;\n dotColor?: string;\n dotActiveColor?: string;\n children: React.ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\nconst Swiper = ({\n vertical = false,\n loop = false,\n timeout = 0,\n from = 0,\n prevTitle = \"\",\n nextTitle = \"\",\n prevTitleColor,\n nextTitleColor,\n dotsTouchable = true,\n dotColor,\n dotActiveColor,\n children,\n style,\n}: SwiperProps) => (\n <View style={style}>\n <SwiperComponent\n from={from}\n loop={loop}\n timeout={timeout}\n vertical={vertical}\n controlsProps={{\n prevTitle,\n nextTitle,\n prevTitleStyle: { color: prevTitleColor },\n nextTitleStyle: { color: nextTitleColor },\n dotsTouchable,\n ...(dotColor\n ? { dotProps: { badgeStyle: { backgroundColor: dotColor } } }\n : {}),\n ...(dotActiveColor\n ? { dotActiveStyle: { backgroundColor: dotActiveColor } }\n : {}),\n }}\n >\n {children}\n </SwiperComponent>\n </View>\n);\n\nexport default Swiper;\n"]}
|
|
@@ -23,6 +23,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
23
23
|
|
|
24
24
|
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; }
|
|
25
25
|
|
|
26
|
+
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); }
|
|
27
|
+
|
|
26
28
|
function Switch(_ref) {
|
|
27
29
|
let {
|
|
28
30
|
value,
|
|
@@ -55,24 +57,23 @@ function Switch(_ref) {
|
|
|
55
57
|
setChecked(Boolean(defaultValue));
|
|
56
58
|
}
|
|
57
59
|
}, [defaultValue, previousDefaultValue]);
|
|
58
|
-
return /*#__PURE__*/React.createElement(_reactNative.Switch, {
|
|
60
|
+
return /*#__PURE__*/React.createElement(_reactNative.Switch, _extends({
|
|
59
61
|
value: checked,
|
|
60
62
|
disabled: disabled,
|
|
61
63
|
trackColor: {
|
|
62
64
|
false: inactiveTrackThemeColor,
|
|
63
65
|
true: activeTrackThemeColor
|
|
64
66
|
},
|
|
65
|
-
thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor
|
|
66
|
-
|
|
67
|
+
thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor // @ts-ignore react-native-web only
|
|
68
|
+
,
|
|
67
69
|
activeThumbColor: activeThumbThemeColor,
|
|
68
70
|
ios_backgroundColor: inactiveTrackThemeColor,
|
|
69
71
|
style: style,
|
|
70
72
|
onValueChange: bool => {
|
|
71
73
|
setChecked(bool);
|
|
72
74
|
onValueChange && onValueChange(bool);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
});
|
|
75
|
+
}
|
|
76
|
+
}, rest));
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
function Row(_ref2) {
|
|
@@ -102,7 +103,7 @@ function Row(_ref2) {
|
|
|
102
103
|
setChecked(defaultValue);
|
|
103
104
|
}
|
|
104
105
|
}, [defaultValue]);
|
|
105
|
-
return /*#__PURE__*/React.createElement(_FormRow.default, {
|
|
106
|
+
return /*#__PURE__*/React.createElement(_FormRow.default, _extends({
|
|
106
107
|
disabled: disabled,
|
|
107
108
|
onPress: () => {
|
|
108
109
|
setChecked(!checked);
|
|
@@ -110,9 +111,8 @@ function Row(_ref2) {
|
|
|
110
111
|
},
|
|
111
112
|
label: label,
|
|
112
113
|
direction: direction,
|
|
113
|
-
style: style
|
|
114
|
-
|
|
115
|
-
}, /*#__PURE__*/React.createElement(Switch, {
|
|
114
|
+
style: style
|
|
115
|
+
}, rest), /*#__PURE__*/React.createElement(Switch, {
|
|
116
116
|
theme: theme,
|
|
117
117
|
value: checked,
|
|
118
118
|
disabled: disabled,
|
|
@@ -129,17 +129,5 @@ exports.SwitchRow = SwitchRow;
|
|
|
129
129
|
|
|
130
130
|
var _default = (0, _theming.withTheme)(Switch);
|
|
131
131
|
|
|
132
|
-
exports.default = _default;
|
|
133
|
-
//# sourceMappingURL=Switch.js.map inactiveTrackColor: inactiveTrackColor,
|
|
134
|
-
activeThumbColor: activeThumbColor,
|
|
135
|
-
inactiveThumbColor: inactiveThumbColor
|
|
136
|
-
}));
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
const SwitchRow = (0, _theming.withTheme)(Row);
|
|
140
|
-
exports.SwitchRow = SwitchRow;
|
|
141
|
-
|
|
142
|
-
var _default = (0, _theming.withTheme)(Switch);
|
|
143
|
-
|
|
144
132
|
exports.default = _default;
|
|
145
133
|
//# sourceMappingURL=Switch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Switch.
|
|
1
|
+
{"version":3,"sources":["Switch.tsx"],"names":["Switch","value","defaultValue","disabled","onValueChange","activeTrackColor","inactiveTrackColor","activeThumbColor","inactiveThumbColor","theme","style","rest","activeTrackThemeColor","colors","primary","inactiveTrackThemeColor","activeThumbThemeColor","inactiveThumbThemeColor","checked","setChecked","React","useState","useEffect","previousDefaultValue","Boolean","false","true","bool","Row","label","direction","RowDirection","SwitchRow"],"mappings":";;;;;;;AAAA;;AACA;;AAMA;;AACA;;AACA;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,EAAEC,QADZ;AAEE,IAAA,OAAO,EAAE,MAAM;AACbgB,MAAAA,UAAU,CAAC,CAACD,OAAF,CAAV;AACAd,MAAAA,aAAa,IAAIA,aAAa,CAAC,CAACc,OAAF,CAA9B;AACD,KALH;AAME,IAAA,KAAK,EAAEW,KANT;AAOE,IAAA,SAAS,EAAEC,SAPb;AAQE,IAAA,KAAK,EAAEpB;AART,KASMC,IATN,gBAWE,oBAAC,MAAD;AACE,IAAA,KAAK,EAAEF,KADT;AAEE,IAAA,KAAK,EAAES,OAFT;AAGE,IAAA,QAAQ,EAAEf,QAHZ;AAIE,IAAA,aAAa,EAAEC,aAJjB;AAKE,IAAA,gBAAgB,EAAEC,gBALpB;AAME,IAAA,kBAAkB,EAAEC,kBANtB;AAOE,IAAA,gBAAgB,EAAEC,gBAPpB;AAQE,IAAA,kBAAkB,EAAEC;AARtB,IAXF,CADF;AAwBD;;AAED,MAAMwB,SAAS,GAAG,wBAAUJ,GAAV,CAAlB;;;eAEe,wBAAU5B,MAAV,C","sourcesContent":["import * as React from \"react\";\nimport {\n Switch as NativeSwitch,\n SwitchProps,\n StyleProp,\n ViewStyle,\n} from \"react-native\";\nimport { withTheme } from \"../theming\";\nimport FormRow from \"./FormRow\";\nimport { RowDirection } from \"@draftbit/types\";\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport { usePrevious } from \"../hooks\";\n\ntype Props = {\n value?: boolean;\n disabled?: boolean;\n onValueChange?: (value: boolean) => void;\n defaultValue?: boolean;\n theme: Theme;\n activeTrackColor: string;\n inactiveTrackColor: string;\n activeThumbColor: string;\n inactiveThumbColor: string;\n} & SwitchProps;\n\nfunction Switch({\n value,\n defaultValue,\n disabled,\n onValueChange,\n activeTrackColor,\n inactiveTrackColor,\n activeThumbColor,\n inactiveThumbColor,\n theme,\n style,\n ...rest\n}: Props) {\n const activeTrackThemeColor = activeTrackColor || theme.colors.primary;\n const inactiveTrackThemeColor = inactiveTrackColor || \"#EEE\";\n\n const activeThumbThemeColor = activeThumbColor || \"#FFF\";\n const inactiveThumbThemeColor = inactiveThumbColor || \"#FFF\";\n\n const [checked, setChecked] = React.useState(value || defaultValue);\n\n React.useEffect(() => {\n if (value != null && value !== checked) {\n setChecked(value);\n }\n }, [value, checked]);\n\n // This special logic is to handle weird APIs like Airtable that return\n // true or undefined for a boolean\n const previousDefaultValue = usePrevious(defaultValue) as boolean | undefined;\n React.useEffect(() => {\n if (defaultValue !== previousDefaultValue) {\n setChecked(Boolean(defaultValue));\n }\n }, [defaultValue, previousDefaultValue]);\n\n return (\n <NativeSwitch\n value={checked}\n disabled={disabled}\n trackColor={{\n false: inactiveTrackThemeColor,\n true: activeTrackThemeColor,\n }}\n thumbColor={value ? activeThumbThemeColor : inactiveThumbThemeColor}\n // @ts-ignore react-native-web only\n activeThumbColor={activeThumbThemeColor}\n ios_backgroundColor={inactiveTrackThemeColor}\n style={style}\n onValueChange={(bool) => {\n setChecked(bool);\n onValueChange && onValueChange(bool);\n }}\n {...rest}\n />\n );\n}\n\ntype RowProps = {\n label: string;\n direction: RowDirection;\n style?: StyleProp<ViewStyle>;\n};\n\nfunction Row({\n label = \"Label\",\n direction = RowDirection.Row,\n style,\n value,\n defaultValue,\n disabled,\n onValueChange,\n activeTrackColor,\n inactiveTrackColor,\n activeThumbColor,\n inactiveThumbColor,\n theme,\n ...rest\n}: Props & RowProps) {\n const [checked, setChecked] = React.useState(\n value != null ? value : defaultValue\n );\n\n React.useEffect(() => {\n if (value != null) {\n setChecked(value);\n }\n }, [value]);\n\n React.useEffect(() => {\n if (defaultValue != null) {\n setChecked(defaultValue);\n }\n }, [defaultValue]);\n\n return (\n <FormRow\n disabled={disabled}\n onPress={() => {\n setChecked(!checked);\n onValueChange && onValueChange(!checked);\n }}\n label={label}\n direction={direction}\n style={style}\n {...rest}\n >\n <Switch\n theme={theme}\n value={checked}\n disabled={disabled}\n onValueChange={onValueChange}\n activeTrackColor={activeTrackColor}\n inactiveTrackColor={inactiveTrackColor}\n activeThumbColor={activeThumbColor}\n inactiveThumbColor={inactiveThumbColor}\n />\n </FormRow>\n );\n}\n\nconst SwitchRow = withTheme(Row);\nexport { SwitchRow };\nexport default withTheme(Switch);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Typography.
|
|
1
|
+
{"version":3,"sources":["Typography.tsx"],"names":["Title","text","theme","style","fontSize","letterSpacing","lineHeight","color","colors","Subtitle","medium","Caption","light"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;AAYO,MAAMA,KAAK,GAAG,wBAAU,QAAmC;AAAA,MAAlC;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,KAAR;AAAeC,IAAAA;AAAf,GAAkC;AAChE,sBACE,6BAAC,iBAAD;AACE,IAAA,KAAK,EAAE,CACL;AACEC,MAAAA,QAAQ,EAAE,EADZ;AAEEC,MAAAA,aAAa,EAAE,CAFjB;AAGEC,MAAAA,UAAU,EAAE,EAHd;AAIEC,MAAAA,KAAK,EAAEL,KAAK,CAACM,MAAN,CAAaP;AAJtB,KADK,EAOLE,KAPK;AADT,KAWGF,IAXH,CADF;AAeD,CAhBoB,CAAd;;AAkBA,MAAMQ,QAAQ,GAAG,wBAAU,SAAmC;AAAA,MAAlC;AAAER,IAAAA,IAAF;AAAQC,IAAAA,KAAR;AAAeC,IAAAA;AAAf,GAAkC;AACnE,sBACE,6BAAC,iBAAD;AACE,IAAA,KAAK,EAAE,CACL;AACEC,MAAAA,QAAQ,EAAE,EADZ;AAEEC,MAAAA,aAAa,EAAE,CAFjB;AAGEC,MAAAA,UAAU,EAAE,EAHd;AAIEC,MAAAA,KAAK,EAAEL,KAAK,CAACM,MAAN,CAAaE;AAJtB,KADK,EAOLP,KAPK;AADT,KAWGF,IAXH,CADF;AAeD,CAhBuB,CAAjB;;AAkBA,MAAMU,OAAO,GAAG,wBAAU,SAAmC;AAAA,MAAlC;AAAEV,IAAAA,IAAF;AAAQC,IAAAA,KAAR;AAAeC,IAAAA;AAAf,GAAkC;AAClE,sBACE,6BAAC,iBAAD;AACE,IAAA,KAAK,EAAE,CACL;AACEC,MAAAA,QAAQ,EAAE,EADZ;AAEEC,MAAAA,aAAa,EAAE,CAFjB;AAGEC,MAAAA,UAAU,EAAE,EAHd;AAIEC,MAAAA,KAAK,EAAEL,KAAK,CAACM,MAAN,CAAaI;AAJtB,KADK,EAOLT,KAPK;AADT,KAWGF,IAXH,CADF;AAeD,CAhBsB,CAAhB","sourcesContent":["import React from \"react\";\nimport { Text, TextStyle, StyleProp } from \"react-native\";\nimport { withTheme } from \"../theming\";\nimport Theme from \"../styles/DefaultTheme\";\n\ntype Props = {\n text: string;\n style?: StyleProp<TextStyle>;\n /**\n * @optional\n */\n theme: typeof Theme;\n};\n\nexport const Title = withTheme(({ text, theme, style }: Props) => {\n return (\n <Text\n style={[\n {\n fontSize: 20,\n letterSpacing: 0,\n lineHeight: 26,\n color: theme.colors.text,\n },\n style,\n ]}\n >\n {text}\n </Text>\n );\n});\n\nexport const Subtitle = withTheme(({ text, theme, style }: Props) => {\n return (\n <Text\n style={[\n {\n fontSize: 14,\n letterSpacing: 0,\n lineHeight: 16,\n color: theme.colors.medium,\n },\n style,\n ]}\n >\n {text}\n </Text>\n );\n});\n\nexport const Caption = withTheme(({ text, theme, style }: Props) => {\n return (\n <Text\n style={[\n {\n fontSize: 12,\n letterSpacing: 0,\n lineHeight: 14,\n color: theme.colors.light,\n },\n style,\n ]}\n >\n {text}\n </Text>\n );\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAuthState.
|
|
1
|
+
{"version":3,"sources":["useAuthState.tsx"],"names":["useAuthState","auth","error","setError","React","useState","value","setValue","currentUser","useEffect","list","onAuthStateChanged","signInWithEmailAndPassword","user","password","then","catch","createUserWithEmailAndPassword","signOut"],"mappings":";;;;;;;AAAA;;;;;;AAEO,MAAMA,YAAY,GAAIC,IAAD,IAAe;AACzC,QAAM,CAACC,KAAD,EAAQC,QAAR,IAAoBC,KAAK,CAACC,QAAN,EAA1B;AACA,QAAM,CAACC,KAAD,EAAQC,QAAR,IAAoBH,KAAK,CAACC,QAAN,CAAeJ,IAAI,CAACO,WAApB,CAA1B;AAEAJ,EAAAA,KAAK,CAACK,SAAN,CAAgB,MAAM;AACpB,UAAMC,IAAI,GAAGT,IAAI,CAACU,kBAAL,CAAwBJ,QAAxB,EAAkCJ,QAAlC,CAAb;AAEA,WAAO,MAAM;AACXO,MAAAA,IAAI;AACL,KAFD;AAGD,GAND,EAMG,CAACT,IAAD,CANH;;AAQA,QAAMW,0BAA0B,GAAG,CAACC,IAAD,EAAeC,QAAf,KAAoC;AACrEb,IAAAA,IAAI,CACDW,0BADH,CAC8BC,IAD9B,EACoCC,QADpC,EAEGC,IAFH,CAEQR,QAFR,EAGGS,KAHH,CAGSb,QAHT;AAID,GALD;;AAOA,QAAMc,8BAA8B,GAAG,CAACJ,IAAD,EAAeC,QAAf,KAAoC;AACzEb,IAAAA,IAAI,CACDW,0BADH,CAC8BC,IAD9B,EACoCC,QADpC,EAEGC,IAFH,CAEQR,QAFR,EAGGS,KAHH,CAGSb,QAHT;AAID,GALD;;AAOA,QAAMe,OAAO,GAAG,MAAMjB,IAAI,CAACiB,OAAL,EAAtB;;AAEA,SAAO,CACLZ,KADK,EAELJ,KAFK,EAGLU,0BAHK,EAILM,OAJK,EAKLD,8BALK,CAAP;AAOD,CAnCM","sourcesContent":["import * as React from \"react\";\n\nexport const useAuthState = (auth: any) => {\n const [error, setError] = React.useState();\n const [value, setValue] = React.useState(auth.currentUser);\n\n React.useEffect(() => {\n const list = auth.onAuthStateChanged(setValue, setError);\n\n return () => {\n list();\n };\n }, [auth]);\n\n const signInWithEmailAndPassword = (user: string, password: string) => {\n auth\n .signInWithEmailAndPassword(user, password)\n .then(setValue)\n .catch(setError);\n };\n\n const createUserWithEmailAndPassword = (user: string, password: string) => {\n auth\n .signInWithEmailAndPassword(user, password)\n .then(setValue)\n .catch(setError);\n };\n\n const signOut = () => auth.signOut();\n\n return [\n value,\n error,\n signInWithEmailAndPassword,\n signOut,\n createUserWithEmailAndPassword,\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"]}
|