@draftbit/core 46.2.1-435444.1 → 46.2.1-45f2e3.2
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/AccordionItem.js +24 -5
- package/lib/commonjs/components/Accordion/AccordionItem.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/StarRating.js +24 -5
- package/lib/commonjs/components/StarRating.js.map +1 -1
- package/lib/commonjs/mappings/FlatList.js +4 -0
- package/lib/commonjs/mappings/FlatList.js.map +1 -1
- package/lib/module/components/AvatarEdit.js +16 -5
- package/lib/module/components/AvatarEdit.js.map +1 -1
- package/lib/module/components/CardBlock.js +15 -5
- package/lib/module/components/CardBlock.js.map +1 -1
- package/lib/module/components/Checkbox/CheckboxRow.js +23 -6
- package/lib/module/components/Checkbox/CheckboxRow.js.map +1 -1
- package/lib/module/components/Container.js +5 -17
- package/lib/module/components/Container.js.map +1 -1
- package/lib/module/components/HeaderLarge.js.map +1 -1
- package/lib/module/components/HeaderMedium.js.map +1 -1
- package/lib/module/mappings/FlatList.js +4 -0
- package/lib/module/mappings/FlatList.js.map +1 -1
- package/lib/typescript/src/mappings/FlatList.d.ts +10 -0
- package/package.json +2 -2
- package/src/mappings/FlatList.js +4 -0
- package/src/mappings/FlatList.ts +4 -0
|
@@ -21,8 +21,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
21
21
|
|
|
22
22
|
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; }
|
|
23
23
|
|
|
24
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
25
|
-
|
|
26
24
|
const AccordionItem = _ref => {
|
|
27
25
|
let {
|
|
28
26
|
Icon,
|
|
@@ -37,9 +35,10 @@ const AccordionItem = _ref => {
|
|
|
37
35
|
textStyles,
|
|
38
36
|
viewStyles
|
|
39
37
|
} = (0, _utilities.extractStyles)(style);
|
|
40
|
-
return /*#__PURE__*/React.createElement(_reactNative.Pressable,
|
|
41
|
-
style: [styles.container, viewStyles]
|
|
42
|
-
|
|
38
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
39
|
+
style: [styles.container, viewStyles],
|
|
40
|
+
...rest
|
|
41
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
43
42
|
style: styles.row
|
|
44
43
|
}, icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
45
44
|
name: icon,
|
|
@@ -74,5 +73,25 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
74
73
|
|
|
75
74
|
var _default = (0, _theming.withTheme)(AccordionItem);
|
|
76
75
|
|
|
76
|
+
exports.default = _default;
|
|
77
|
+
//# sourceMappingURL=AccordionItem.js.mapding: 8
|
|
78
|
+
},
|
|
79
|
+
row: {
|
|
80
|
+
flexDirection: "row",
|
|
81
|
+
alignItems: "center",
|
|
82
|
+
paddingLeft: 8
|
|
83
|
+
},
|
|
84
|
+
item: {
|
|
85
|
+
marginVertical: 6,
|
|
86
|
+
paddingLeft: 8
|
|
87
|
+
},
|
|
88
|
+
content: {
|
|
89
|
+
flex: 1,
|
|
90
|
+
justifyContent: "center"
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
var _default = (0, _theming.withTheme)(AccordionItem);
|
|
95
|
+
|
|
77
96
|
exports.default = _default;
|
|
78
97
|
//# sourceMappingURL=AccordionItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AccordionItem","Icon","icon","label","style","iconColor","theme","rest","textStyles","viewStyles","extractStyles","styles","container","row","colors","primary","item","content","StyleSheet","create","padding","flexDirection","alignItems","paddingLeft","marginVertical","flex","justifyContent","withTheme"],"sources":["AccordionItem.
|
|
1
|
+
{"version":3,"names":["AccordionItem","Icon","icon","label","style","iconColor","theme","rest","textStyles","viewStyles","extractStyles","React","createElement","Pressable","styles","container","View","row","name","size","color","colors","primary","item","content","Text","selectable","StyleSheet","create","padding","flexDirection","alignItems","paddingLeft","marginVertical","flex","justifyContent","withTheme"],"sources":["AccordionItem.js"],"sourcesContent":["import * as React from \"react\";\nimport { Pressable, StyleSheet, View, } from \"react-native\";\nimport Text from \"../Text\";\nimport { extractStyles } from \"../../utilities\";\nimport { withTheme } from \"../../theming\";\nconst AccordionItem = ({ Icon, icon, label, style, iconColor, theme, ...rest }) => {\n const { textStyles, viewStyles } = extractStyles(style);\n return (React.createElement(Pressable, { style: [styles.container, viewStyles], ...rest },\n React.createElement(View, { style: styles.row },\n icon ? (React.createElement(Icon, { name: icon, size: 24, color: iconColor || theme.colors.primary })) : null,\n React.createElement(View, { style: [styles.item, styles.content] },\n React.createElement(Text, { selectable: false, style: textStyles }, label)))));\n};\nconst styles = StyleSheet.create({\n container: {\n padding: 8,\n },\n row: {\n flexDirection: \"row\",\n alignItems: \"center\",\n paddingLeft: 8,\n },\n item: {\n marginVertical: 6,\n paddingLeft: 8,\n },\n content: {\n flex: 1,\n justifyContent: \"center\",\n },\n});\nexport default withTheme(AccordionItem);\n"],"mappings":";;;;;;;AA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7BT,IAAI,EAAE;IACFU,cAAc,EAAE,CADd;IAEFD,WAAW,EAAE;EAFX,CATuB;EAa7BR,OAAO,EAAE;IACLU,IAAI,EAAE,CADD;IAELC,cAAc,EAAE;EAFX;AAboB,CAAlB,CAAf;;eAkBe,IAAAC,kBAAA,EAAUpC,aAAV,C"}
|
|
@@ -23,6 +23,8 @@ var _Config = _interopRequireDefault(require("./Config"));
|
|
|
23
23
|
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
25
|
|
|
26
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
|
const ICON_CONTAINER_SIZE = _Config.default.cardIconSize * 2;
|
|
27
29
|
const ICON_CONTAINER_PADDING = _Config.default.cardIconSize / 2 - 1;
|
|
28
30
|
|
|
@@ -66,12 +68,11 @@ const CardContainer = _ref => {
|
|
|
66
68
|
break;
|
|
67
69
|
}
|
|
68
70
|
|
|
69
|
-
return /*#__PURE__*/_react.default.createElement(_DeprecatedCardWrapper.default, {
|
|
71
|
+
return /*#__PURE__*/_react.default.createElement(_DeprecatedCardWrapper.default, _extends({
|
|
70
72
|
style: style,
|
|
71
73
|
onPress: onPress,
|
|
72
|
-
numColumns: numColumns
|
|
73
|
-
|
|
74
|
-
}, /*#__PURE__*/_react.default.createElement(_Elevation.default, {
|
|
74
|
+
numColumns: numColumns
|
|
75
|
+
}, rest), /*#__PURE__*/_react.default.createElement(_Elevation.default, {
|
|
75
76
|
style: {
|
|
76
77
|
elevation,
|
|
77
78
|
borderRadius: roundness
|
|
@@ -143,17 +144,5 @@ const CardContainer = _ref => {
|
|
|
143
144
|
|
|
144
145
|
var _default = (0, _theming.withTheme)(CardContainer);
|
|
145
146
|
|
|
146
|
-
exports.default = _default;
|
|
147
|
-
//# sourceMappingURL=CardContainer.js.mapnfig.default.cardIconBackgroundOpacity).rgb().string()
|
|
148
|
-
}
|
|
149
|
-
}, /*#__PURE__*/_react.default.createElement(Icon, {
|
|
150
|
-
name: icon,
|
|
151
|
-
size: _Config.default.cardIconSize,
|
|
152
|
-
color: colors.surface
|
|
153
|
-
})) : null)));
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
var _default = (0, _theming.withTheme)(CardContainer);
|
|
157
|
-
|
|
158
147
|
exports.default = _default;
|
|
159
148
|
//# sourceMappingURL=CardContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ICON_CONTAINER_SIZE","Config","cardIconSize","ICON_CONTAINER_PADDING","CardContainer","Icon","icon","image","cardImageUrl","title","leftDescription","rightDescription","textCentered","aspectRatio","elevation","numColumns","theme","colors","roundness","typography","style","onPress","rest","textJustification","titleStyle","headline6","headline5","
|
|
1
|
+
{"version":3,"names":["ICON_CONTAINER_SIZE","Config","cardIconSize","ICON_CONTAINER_PADDING","CardContainer","Icon","icon","image","cardImageUrl","title","leftDescription","rightDescription","textCentered","aspectRatio","elevation","numColumns","theme","colors","roundness","typography","style","onPress","rest","textJustification","titleStyle","headline6","headline5","borderRadius","overflow","backgroundColor","surface","uri","padding","flexDirection","alignItems","justifyContent","color","strong","marginTop","body2","medium","subtitle2","light","cardIconElevation","position","top","right","width","height","alpha","cardIconBackgroundOpacity","rgb","string","withTheme"],"sources":["CardContainer.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n View,\n ImageSourcePropType,\n Text,\n StyleProp,\n ViewStyle,\n} from \"react-native\";\nimport color from \"color\";\nimport Image from \"./Image\";\nimport Card from \"./DeprecatedCardWrapper\";\nimport Elevation from \"./Elevation\";\nimport { withTheme } from \"../theming\";\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\n\nimport Config from \"./Config\";\nimport { justificationType } from \"./Justification\";\n\nconst ICON_CONTAINER_SIZE = Config.cardIconSize * 2;\nconst ICON_CONTAINER_PADDING = Config.cardIconSize / 2 - 1;\n\ntype Props = {\n image?: string | ImageSourcePropType;\n title?: string;\n leftDescription?: string;\n rightDescription?: string;\n textCentered: boolean;\n icon?: string;\n aspectRatio?: number;\n elevation?: number;\n numColumns?: number;\n theme: Theme;\n style?: StyleProp<ViewStyle>;\n onPress: () => void;\n} & IconSlot;\n\nconst CardContainer: React.FC<React.PropsWithChildren<Props>> = ({\n Icon,\n icon,\n image = Config.cardImageUrl,\n title,\n leftDescription,\n rightDescription,\n textCentered,\n aspectRatio = 1.5,\n elevation = 2,\n numColumns = 3,\n theme: { colors, roundness, typography },\n style,\n onPress,\n ...rest\n}) => {\n let textJustification: justificationType;\n\n let titleStyle;\n\n if (textCentered && !rightDescription) {\n textJustification = \"center\";\n } else {\n textJustification = \"space-between\";\n }\n\n switch (numColumns) {\n case 2:\n titleStyle = typography.headline6;\n break;\n case 3:\n titleStyle = typography.headline5;\n break;\n }\n\n return (\n <Card style={style} onPress={onPress} numColumns={numColumns} {...rest}>\n <Elevation style={{ elevation, borderRadius: roundness }}>\n <View\n style={{\n borderRadius: roundness,\n overflow: \"hidden\",\n backgroundColor: colors.surface,\n }}\n >\n <Image\n style={{ aspectRatio }}\n source={typeof image === \"string\" ? { uri: image } : image}\n resizeMode=\"cover\"\n />\n <View\n style={{\n padding: numColumns === 1 ? 8 : 16,\n }}\n >\n {title ? (\n <View\n style={{\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: textJustification,\n }}\n >\n <Text\n numberOfLines={1}\n style={[titleStyle, { color: colors.strong }]}\n >\n {title}\n </Text>\n </View>\n ) : null}\n {leftDescription ? (\n <View\n style={{\n flexDirection: \"row\",\n justifyContent: textJustification,\n alignItems: \"center\",\n marginTop: numColumns === 3 ? 4 : 4 / 2,\n }}\n >\n <Text\n numberOfLines={1}\n style={[typography.body2, { color: colors.medium }]}\n >\n {leftDescription}\n </Text>\n {rightDescription ? (\n <Text\n numberOfLines={1}\n style={[typography.subtitle2, { color: colors.light }]}\n >\n {rightDescription}\n </Text>\n ) : null}\n </View>\n ) : null}\n </View>\n {icon ? (\n <Elevation\n style={{\n elevation: Config.cardIconElevation,\n position: \"absolute\",\n top: 12,\n right: 12,\n width: ICON_CONTAINER_SIZE,\n height: ICON_CONTAINER_SIZE,\n padding: ICON_CONTAINER_PADDING,\n borderRadius: ICON_CONTAINER_SIZE,\n backgroundColor: color(colors.strong)\n .alpha(Config.cardIconBackgroundOpacity)\n .rgb()\n .string(),\n }}\n >\n <Icon\n name={icon}\n size={Config.cardIconSize}\n color={colors.surface}\n />\n </Elevation>\n ) : null}\n </View>\n </Elevation>\n </Card>\n );\n};\n\nexport default withTheme(CardContainer);\n"],"mappings":";;;;;;;AAAA;;AACA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AAIA;;;;;;AAGA,MAAMA,mBAAmB,GAAGC,eAAA,CAAOC,YAAP,GAAsB,CAAlD;AACA,MAAMC,sBAAsB,GAAGF,eAAA,CAAOC,YAAP,GAAsB,CAAtB,GAA0B,CAAzD;;AAiBA,MAAME,aAAuD,GAAG,QAe1D;EAAA,IAf2D;IAC/DC,IAD+D;IAE/DC,IAF+D;IAG/DC,KAAK,GAAGN,eAAA,CAAOO,YAHgD;IAI/DC,KAJ+D;IAK/DC,eAL+D;IAM/DC,gBAN+D;IAO/DC,YAP+D;IAQ/DC,WAAW,GAAG,GARiD;IAS/DC,SAAS,GAAG,CATmD;IAU/DC,UAAU,GAAG,CAVkD;IAW/DC,KAAK,EAAE;MAAEC,MAAF;MAAUC,SAAV;MAAqBC;IAArB,CAXwD;IAY/DC,KAZ+D;IAa/DC,OAb+D;IAc/D,GAAGC;EAd4D,CAe3D;EACJ,IAAIC,iBAAJ;EAEA,IAAIC,UAAJ;;EAEA,IAAIZ,YAAY,IAAI,CAACD,gBAArB,EAAuC;IACrCY,iBAAiB,GAAG,QAApB;EACD,CAFD,MAEO;IACLA,iBAAi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P;MAILI,SAAS,EAAEvB,UAAU,KAAK,CAAf,GAAmB,CAAnB,GAAuB,IAAI;IAJjC;EADT,gBAQE,6BAAC,iBAAD;IACE,aAAa,EAAE,CADjB;IAEE,KAAK,EAAE,CAACI,UAAU,CAACoB,KAAZ,EAAmB;MAAEH,KAAK,EAAEnB,MAAM,CAACuB;IAAhB,CAAnB;EAFT,GAIG9B,eAJH,CARF,EAcGC,gBAAgB,gBACf,6BAAC,iBAAD;IACE,aAAa,EAAE,CADjB;IAEE,KAAK,EAAE,CAACQ,UAAU,CAACsB,SAAZ,EAAuB;MAAEL,KAAK,EAAEnB,MAAM,CAACyB;IAAhB,CAAvB;EAFT,GAIG/B,gBAJH,CADe,GAOb,IArBN,CADc,GAwBZ,IA7CN,CAZF,EA2DGL,IAAI,gBACH,6BAAC,kBAAD;IACE,KAAK,EAAE;MACLQ,SAAS,EAAEb,eAAA,CAAO0C,iBADb;MAELC,QAAQ,EAAE,UAFL;MAGLC,GAAG,EAAE,EAHA;MAILC,KAAK,EAAE,EAJF;MAKLC,KAAK,EAAE/C,mBALF;MAMLgD,MAAM,EAAEhD,mBANH;MAOLgC,OAAO,EAAE7B,sBAPJ;MAQLwB,YAAY,EAAE3B,mBART;MASL6B,eAAe,EAAE,IAAAO,cAAA,EAAMnB,MAAM,CAACoB,MAAb,EACdY,KADc,CACRhD,eAAA,CAAOiD,yBADC,EAEdC,GAFc,GAGdC,MAHc;IATZ;EADT,gBAgBE,6BAAC,IAAD;IACE,IAAI,EAAE9C,IADR;IAEE,IAAI,EAAEL,eAAA,CAAOC,YAFf;IAGE,KAAK,EAAEe,MAAM,CAACa;EAHhB,EAhBF,CADG,GAuBD,IAlFN,CADF,CADF,CADF;AA0FD,CA7HD;;eA+He,IAAAuB,kBAAA,EAAUjD,aAAV,C"}
|
|
@@ -15,8 +15,6 @@ 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 ? Object.assign.bind() : 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
|
-
|
|
20
18
|
const StarRating = _ref => {
|
|
21
19
|
let {
|
|
22
20
|
Icon,
|
|
@@ -47,9 +45,10 @@ const StarRating = _ref => {
|
|
|
47
45
|
!!onPress && onPress(r);
|
|
48
46
|
}, [onPress]);
|
|
49
47
|
const ratingRounded = Math.round(localRating * 2) / 2;
|
|
50
|
-
return /*#__PURE__*/React.createElement(_reactNative.View,
|
|
51
|
-
style: [styles.container, style]
|
|
52
|
-
|
|
48
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
49
|
+
style: [styles.container, style],
|
|
50
|
+
...rest
|
|
51
|
+
}, [...Array(maxStars)].map((_, i) => /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
53
52
|
key: i,
|
|
54
53
|
style: {
|
|
55
54
|
display: "flex"
|
|
@@ -93,5 +92,25 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
93
92
|
|
|
94
93
|
var _default = (0, _theming.withTheme)(StarRating);
|
|
95
94
|
|
|
95
|
+
exports.default = _default;
|
|
96
|
+
//# sourceMappingURL=StarRating.js.mapr: {
|
|
97
|
+
display: "flex",
|
|
98
|
+
flexDirection: "row",
|
|
99
|
+
position: "absolute",
|
|
100
|
+
top: 0,
|
|
101
|
+
right: 0,
|
|
102
|
+
left: 0,
|
|
103
|
+
bottom: 0,
|
|
104
|
+
zIndex: 1
|
|
105
|
+
},
|
|
106
|
+
pressable: {
|
|
107
|
+
flex: 1,
|
|
108
|
+
height: "100%",
|
|
109
|
+
width: "50%"
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
var _default = (0, _theming.withTheme)(StarRating);
|
|
114
|
+
|
|
96
115
|
exports.default = _default;
|
|
97
116
|
//# sourceMappingURL=StarRating.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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","withTheme"],"sources":["StarRating.
|
|
1
|
+
{"version":3,"names":["StarRating","Icon","starSize","maxStars","rating","defaultValue","isEditable","activeColor","inactiveColor","style","onPress","rest","localRating","setLocalRating","React","useState","useEffect","ratingHandler","useCallback","r","ratingRounded","Math","round","createElement","View","styles","container","Array","map","_","i","key","display","name","size","color","touchContainer","Pressable","pressable","StyleSheet","create","flexDirection","alignItems","position","top","right","left","bottom","zIndex","flex","height","width","withTheme"],"sources":["StarRating.js"],"sourcesContent":["import * as React from \"react\";\nimport { View, StyleSheet, Pressable, } from \"react-native\";\nimport { withTheme } from \"../theming\";\nconst StarRating = ({ Icon, starSize = 16, maxStars = 5, rating = 0, defaultValue, isEditable = false, activeColor, inactiveColor, style, onPress, ...rest }) => {\n const [localRating, setLocalRating] = React.useState(rating || defaultValue || 0);\n React.useEffect(() => {\n if (rating != null) {\n setLocalRating(rating);\n }\n }, [rating]);\n React.useEffect(() => {\n if (defaultValue != null) {\n setLocalRating(defaultValue);\n }\n }, [defaultValue]);\n const ratingHandler = React.useCallback((r) => {\n setLocalRating(r);\n !!onPress && onPress(r);\n }, [onPress]);\n const ratingRounded = Math.round(localRating * 2) / 2;\n return (React.createElement(View, { style: [styles.container, style], ...rest }, [...Array(maxStars)].map((_, i) => (React.createElement(View, { key: i, style: { display: \"flex\" } },\n React.createElement(Icon, { name: ratingRounded - i === 0.5\n ? \"MaterialIcons/star-half\"\n : \"MaterialIcons/star\", size: starSize, color: ratingRounded > i ? activeColor : inactiveColor }),\n isEditable && (React.createElement(View, { style: styles.touchContainer },\n React.createElement(Pressable, { style: styles.pressable, onPress: () => ratingHandler(i + 0.5) }),\n React.createElement(Pressable, { style: styles.pressable, onPress: () => ratingHandler(i + 1) }))))))));\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});\nexport default withTheme(StarRating);\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;AACA,MAAMA,UAAU,GAAG,QAA8I;EAAA,IAA7I;IAAEC,IAAF;IAAQC,QAAQ,GAAG,EAAnB;IAAuBC,QAAQ,GAAG,CAAlC;IAAqCC,MAAM,GAAG,CAA9C;IAAiDC,YAAjD;IAA+DC,UAAU,GAAG,KAA5E;IAAmFC,WAAnF;IAAgGC,aAAhG;IAA+GC,KAA/G;IAAsHC,OAAtH;IAA+H,GAAGC;EAAlI,CAA6I;EAC7J,MAAM,CAACC,WAAD,EAAcC,cAAd,IAAgCC,KAAK,CAACC,QAAN,CAAeX,MAAM,IAAIC,YAAV,IAA0B,CAAzC,CAAtC;EACAS,KAAK,CAACE,SAAN,CAAgB,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,iBAApB,EAA0B;IAAEf,KAAK,EAAEgB,MAAM,CAACW;EAAhB,CAA1B,eACXtB,KAAK,CAACS,aAAN,CAAoBc,sBAApB,EAA+B;IAAE5B,KAAK,EAAEgB,MAAM,CAACa,SAAhB;IAA2B5B,OAAO,EAAE,MAAMO,aAAa,CAACa,CAAC,GAAG,GAAL;EAAvD,CAA/B,CADW,eAEXhB,KAAK,CAACS,aAAN,CAAoBc,sBAApB,EAA+B;IAAE5B,KAAK,EAAEgB,MAAM,CAACa,SAAhB;IAA2B5B,OAAO,EAAE,MAAMO,aAAa,CAACa,CAAC,GAAG,CAAL;EAAvD,CAA/B,CAFW,CAJkG,CAApC,CAAzE,CAAR;AAOH,CAxBD;;AAyBA,MAAML,MAAM,GAAGc,uBAAA,CAAWC,MAAX,CAAkB;EAC7Bd,SAAS,EAAE;IACPe,aAAa,EAAE,KADR;IAEPC,UAAU,EAAE;EAFL,CADkB;EAK7BN,cAAc,EAAE;IACZJ,OAAO,EAAE,MADG;IAEZS,aAAa,EAAE,KAFH;IAGZE,QAAQ,EAAE,UAHE;IAIZC,GAAG,EAAE,CAJO;IAKZC,KAAK,EAAE,CALK;IAMZC,IAAI,EAAE,CANM;IAOZC,MAAM,EAAE,CAPI;IAQZC,MAAM,EAAE;EARI,CALa;EAe7BV,SAAS,EAAE;IACPW,IAAI,EAAE,CADC;IAEPC,MAAM,EAAE,MAFD;IAGPC,KAAK,EAAE;EAHA;AAfkB,CAAlB,CAAf;;eAqBe,IAAAC,kBAAA,EAAUpD,UAAV,C"}
|
|
@@ -20,6 +20,10 @@ const SEED_DATA = {
|
|
|
20
20
|
label: "Horizontal",
|
|
21
21
|
description: "Render list horizontally"
|
|
22
22
|
}),
|
|
23
|
+
inverted: (0, _types.createStaticBoolProp)({
|
|
24
|
+
label: "Inverted",
|
|
25
|
+
description: "If true, reverses the direction."
|
|
26
|
+
}),
|
|
23
27
|
numColumns: (0, _types.createNumColumnsType)({
|
|
24
28
|
editable: true
|
|
25
29
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","data","layout","flex","props","horizontal","createStaticBoolProp","label","numColumns","createNumColumnsType","editable"],"sources":["FlatList.ts"],"sourcesContent":["import {\n COMPONENT_TYPES,\n createNumColumnsType,\n createStaticBoolProp,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"List\",\n tag: \"FlatList\",\n description: \"A basic List component\",\n category: COMPONENT_TYPES.data,\n layout: {\n flex: 1,\n },\n props: {\n horizontal: createStaticBoolProp({\n label: \"Horizontal\",\n description: \"Render list horizontally\",\n }),\n numColumns: createNumColumnsType({\n editable: true,\n }),\n },\n};\n"],"mappings":";;;;;;;AAAA;;AAMO,MAAMA,SAAS,GAAG;EACvBC,IAAI,EAAE,MADiB;EAEvBC,GAAG,EAAE,UAFkB;EAGvBC,WAAW,EAAE,wBAHU;EAIvBC,QAAQ,EAAEC,sBAAA,CAAgBC,IAJH;EAKvBC,MAAM,EAAE;IACNC,IAAI,EAAE;EADA,CALe;EAQvBC,KAAK,EAAE;IACLC,UAAU,EAAE,IAAAC,2BAAA,EAAqB;MAC/BC,KAAK,EAAE,YADwB;MAE/BT,WAAW,EAAE;IAFkB,CAArB,CADP;IAKLU,UAAU,EAAE,IAAAC,2BAAA,EAAqB;MAC/BC,QAAQ,EAAE;IADqB,CAArB;
|
|
1
|
+
{"version":3,"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","data","layout","flex","props","horizontal","createStaticBoolProp","label","inverted","numColumns","createNumColumnsType","editable"],"sources":["FlatList.ts"],"sourcesContent":["import {\n COMPONENT_TYPES,\n createNumColumnsType,\n createStaticBoolProp,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"List\",\n tag: \"FlatList\",\n description: \"A basic List component\",\n category: COMPONENT_TYPES.data,\n layout: {\n flex: 1,\n },\n props: {\n horizontal: createStaticBoolProp({\n label: \"Horizontal\",\n description: \"Render list horizontally\",\n }),\n inverted: createStaticBoolProp({\n label: \"Inverted\",\n description: \"If true, reverses the direction.\",\n }),\n numColumns: createNumColumnsType({\n editable: true,\n }),\n },\n};\n"],"mappings":";;;;;;;AAAA;;AAMO,MAAMA,SAAS,GAAG;EACvBC,IAAI,EAAE,MADiB;EAEvBC,GAAG,EAAE,UAFkB;EAGvBC,WAAW,EAAE,wBAHU;EAIvBC,QAAQ,EAAEC,sBAAA,CAAgBC,IAJH;EAKvBC,MAAM,EAAE;IACNC,IAAI,EAAE;EADA,CALe;EAQvBC,KAAK,EAAE;IACLC,UAAU,EAAE,IAAAC,2BAAA,EAAqB;MAC/BC,KAAK,EAAE,YADwB;MAE/BT,WAAW,EAAE;IAFkB,CAArB,CADP;IAKLU,QAAQ,EAAE,IAAAF,2BAAA,EAAqB;MAC7BC,KAAK,EAAE,UADsB;MAE7BT,WAAW,EAAE;IAFgB,CAArB,CALL;IASLW,UAAU,EAAE,IAAAC,2BAAA,EAAqB;MAC/BC,QAAQ,EAAE;IADqB,CAArB;EATP;AARgB,CAAlB"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
2
|
-
|
|
3
1
|
import * as React from "react";
|
|
4
2
|
import { View } from "react-native";
|
|
5
3
|
import Touchable from "./Touchable";
|
|
@@ -25,9 +23,10 @@ const AvatarEdit = _ref => {
|
|
|
25
23
|
width: size,
|
|
26
24
|
height: size
|
|
27
25
|
};
|
|
28
|
-
return /*#__PURE__*/React.createElement(View,
|
|
29
|
-
style: [style, dimensions]
|
|
30
|
-
|
|
26
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
27
|
+
style: [style, dimensions],
|
|
28
|
+
...rest
|
|
29
|
+
}, /*#__PURE__*/React.createElement(Touchable, {
|
|
31
30
|
onPress: onPress
|
|
32
31
|
}, /*#__PURE__*/React.createElement(CircleImage, {
|
|
33
32
|
source: image,
|
|
@@ -49,5 +48,17 @@ const AvatarEdit = _ref => {
|
|
|
49
48
|
}))));
|
|
50
49
|
};
|
|
51
50
|
|
|
51
|
+
export default withTheme(AvatarEdit);
|
|
52
|
+
//# sourceMappingURL=AvatarEdit.js.mapolor: colorStyles.editBackgroundColor,
|
|
53
|
+
borderRadius: size * (3 / 16),
|
|
54
|
+
padding: size * (3 / 32)
|
|
55
|
+
}
|
|
56
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
57
|
+
name: "MaterialIcons/edit",
|
|
58
|
+
color: colorStyles.editIconColor,
|
|
59
|
+
size: size * (3 / 16)
|
|
60
|
+
}))));
|
|
61
|
+
};
|
|
62
|
+
|
|
52
63
|
export default withTheme(AvatarEdit);
|
|
53
64
|
//# sourceMappingURL=AvatarEdit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","Touchable","CircleImage","withTheme","AvatarEdit","Icon","image","size","onPress","style","theme","rest","colorStyles","editBackgroundColor","colors","primary","editIconColor","surface","editBorderColor","dimensions","width","height","position","top","right","borderColor","backgroundColor","borderRadius","padding"],"sources":["AvatarEdit.
|
|
1
|
+
{"version":3,"names":["React","View","Touchable","CircleImage","withTheme","AvatarEdit","Icon","image","size","onPress","style","theme","rest","colorStyles","editBackgroundColor","colors","primary","editIconColor","surface","editBorderColor","dimensions","width","height","createElement","source","position","top","right","borderColor","backgroundColor","borderRadius","padding","name","color"],"sources":["AvatarEdit.js"],"sourcesContent":["import * as React from \"react\";\nimport { View } from \"react-native\";\nimport Touchable from \"./Touchable\";\nimport CircleImage from \"./CircleImage\";\nimport { withTheme } from \"../theming\";\nconst AvatarEdit = ({ Icon, image, size = 80, onPress = () => { }, style, theme, ...rest }) => {\n const colorStyles = {\n editBackgroundColor: theme.colors.primary,\n editIconColor: theme.colors.surface,\n editBorderColor: theme.colors.surface,\n };\n const dimensions = {\n width: size,\n height: size,\n };\n return (React.createElement(View, { style: [style, dimensions], ...rest },\n React.createElement(Touchable, { onPress: onPress },\n React.createElement(CircleImage, { source: image, size: size }),\n React.createElement(View, { style: {\n position: \"absolute\",\n top: -3,\n right: -3,\n borderColor: colorStyles.editBorderColor,\n backgroundColor: colorStyles.editBackgroundColor,\n borderRadius: size * (3 / 16),\n padding: size * (3 / 32),\n } },\n React.createElement(Icon, { name: \"MaterialIcons/edit\", color: colorStyles.editIconColor, size: size * (3 / 16) })))));\n};\nexport default withTheme(AvatarEdit);\n"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,IAAT,QAAqB,cAArB;AACA,OAAOC,SAAP,MAAsB,aAAtB;AACA,OAAOC,WAAP,MAAwB,eAAxB;AACA,SAASC,SAAT,QAA0B,YAA1B;;AACA,MAAMC,UAAU,GAAG,QAA4E;EAAA,IAA3E;IAAEC,IAAF;IAAQC,KAAR;IAAeC,IAAI,GAAG,EAAtB;IAA0BC,OAAO,GAAG,MAAM,CAAG,CAA7C;IAA+CC,KAA/C;IAAsDC,KAAtD;IAA6D,GAAGC;EAAhE,CAA2E;EAC3F,MAAMC,WAAW,GAAG;IAChBC,mBAAmB,EAAEH,KAAK,CAACI,MAAN,CAAaC,OADlB;IAEhBC,aAAa,EAAEN,KAAK,CAACI,MAAN,CAAaG,OAFZ;IAGhBC,eAAe,EAAER,KAAK,CAACI,MAAN,CAAaG;EAHd,CAApB;EAKA,MAAME,UAAU,GAAG;IACfC,KAAK,EAAEb,IADQ;IAEfc,MAAM,EAAEd;EAFO,CAAnB;EAIA,oBAAQR,KAAK,CAACuB,aAAN,CAAoBtB,IAApB,EAA0B;IAAES,KAAK,EAAE,CAACA,KAAD,EAAQU,UAAR,CAAT;IAA8B,GAAGR;EAAjC,CAA1B,eACJZ,KAAK,CAACuB,aAAN,CAAoBrB,SAApB,EAA+B;IAAEO,OAAO,EAAEA;EAAX,CAA/B,eACIT,KAAK,CAACuB,aAAN,CAAoBpB,WAApB,EAAiC;IAAEqB,MAAM,EAAEjB,KAAV;IAAiBC,IAAI,EAAEA;EAAvB,CAAjC,CADJ,eAEIR,KAAK,CAACuB,aAAN,CAAoBtB,IAApB,EAA0B;IAAES,KAAK,EAAE;MAC3Be,QAAQ,EAAE,UADiB;MAE3BC,GAAG,EAAE,CAAC,CAFqB;MAG3BC,KAAK,EAAE,CAAC,CAHmB;MAI3BC,WAAW,EAAEf,WAAW,CAACM,eAJE;MAK3BU,eAAe,EAAEhB,WAAW,CAACC,mBALF;MAM3BgB,YAAY,EAAEtB,IAAI,IAAI,IAAI,EAAR,CANS;MAO3BuB,OAAO,EAAEvB,IAAI,IAAI,IAAI,EAAR;IAPc;EAAT,CAA1B,eASIR,KAAK,CAACuB,aAAN,CAAoBjB,IAApB,EAA0B;IAAE0B,IAAI,EAAE,oBAAR;IAA8BC,KAAK,EAAEpB,WAAW,CAACI,aAAjD;IAAgET,IAAI,EAAEA,IAAI,IAAI,IAAI,EAAR;EAA1E,CAA1B,CATJ,CAFJ,CADI,CAAR;AAaH,CAvBD;;AAwBA,eAAeJ,SAAS,CAACC,UAAD,CAAxB"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
2
|
-
|
|
3
1
|
import React from "react";
|
|
4
2
|
import { View, Text } from "react-native";
|
|
5
3
|
import Image from "./Image";
|
|
@@ -47,11 +45,12 @@ const CardBlock = _ref => {
|
|
|
47
45
|
const rightDescriptionStyles = [typography.subtitle2, {
|
|
48
46
|
color: colors.light
|
|
49
47
|
}];
|
|
50
|
-
return /*#__PURE__*/React.createElement(Card,
|
|
48
|
+
return /*#__PURE__*/React.createElement(Card, {
|
|
51
49
|
style: style,
|
|
52
50
|
onPress: onPress,
|
|
53
|
-
numColumns: numColumns
|
|
54
|
-
|
|
51
|
+
numColumns: numColumns,
|
|
52
|
+
...rest
|
|
53
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
55
54
|
style: {
|
|
56
55
|
backgroundColor: colors.background
|
|
57
56
|
}
|
|
@@ -101,5 +100,16 @@ const CardBlock = _ref => {
|
|
|
101
100
|
}, rightDescription) : null) : null));
|
|
102
101
|
};
|
|
103
102
|
|
|
103
|
+
export default withTheme(CardBlock);
|
|
104
|
+
//# sourceMappingURL=CardBlock.js.map numberOfLines: 1,
|
|
105
|
+
style: [typography.body2, {
|
|
106
|
+
color: colors.medium
|
|
107
|
+
}]
|
|
108
|
+
}, leftDescription), rightDescription ? /*#__PURE__*/React.createElement(Text, {
|
|
109
|
+
numberOfLines: 1,
|
|
110
|
+
style: rightDescriptionStyles
|
|
111
|
+
}, rightDescription) : null) : null));
|
|
112
|
+
};
|
|
113
|
+
|
|
104
114
|
export default withTheme(CardBlock);
|
|
105
115
|
//# sourceMappingURL=CardBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","Text","Image","Card","Elevation","withTheme","Config","CardBlock","image","cardImageUrl","title","leftDescription","rightDescription","titleCentered","aspectRatio","elevation","numColumns","theme","colors","roundness","typography","style","onPress","rest","titleJustification","titleStyle","button","headline6","headline5","rightDescriptionStyles","subtitle2","color","light","backgroundColor","background","borderRadius","uri","flexDirection","alignItems","justifyContent","marginTop","strong","body2","medium"],"sources":["CardBlock.
|
|
1
|
+
{"version":3,"names":["React","View","Text","Image","Card","Elevation","withTheme","Config","CardBlock","image","cardImageUrl","title","leftDescription","rightDescription","titleCentered","aspectRatio","elevation","numColumns","theme","colors","roundness","typography","style","onPress","rest","titleJustification","titleStyle","button","headline6","headline5","rightDescriptionStyles","subtitle2","color","light","createElement","backgroundColor","background","borderRadius","source","uri","resizeMode","flexDirection","alignItems","justifyContent","marginTop","numberOfLines","strong","body2","medium"],"sources":["CardBlock.js"],"sourcesContent":["import React from \"react\";\nimport { View, Text, } from \"react-native\";\nimport Image from \"./Image\";\nimport Card from \"./DeprecatedCardWrapper\";\nimport Elevation from \"./Elevation\";\nimport { withTheme } from \"../theming\";\nimport Config from \"./Config\";\nconst CardBlock = ({ image = Config.cardImageUrl, title, leftDescription, rightDescription, titleCentered, aspectRatio = 1.5, elevation = 2, numColumns = 3, theme: { colors, roundness, typography }, style, onPress, ...rest }) => {\n let titleJustification;\n let titleStyle;\n if (titleCentered && !leftDescription && !rightDescription) {\n titleJustification = \"center\";\n }\n else {\n titleJustification = \"space-between\";\n }\n if (numColumns === 1) {\n titleStyle = typography.button;\n }\n else if (numColumns === 2) {\n titleStyle = typography.headline6;\n }\n else {\n titleStyle = typography.headline5;\n }\n const rightDescriptionStyles = [\n typography.subtitle2,\n { color: colors.light },\n ];\n return (React.createElement(Card, { style: style, onPress: onPress, numColumns: numColumns, ...rest },\n React.createElement(View, { style: { backgroundColor: colors.background } },\n React.createElement(Elevation, { style: { elevation, borderRadius: roundness } },\n React.createElement(Image, { style: {\n borderRadius: roundness,\n aspectRatio,\n }, source: typeof image === \"string\" ? { uri: image } : image, resizeMode: \"cover\" })),\n title ? (React.createElement(View, { style: {\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: titleJustification,\n marginTop: numColumns === 3 ? 16 : 12,\n } },\n React.createElement(Text, { numberOfLines: 1, style: [titleStyle, { color: colors.strong }] }, title),\n !leftDescription && rightDescription ? (React.createElement(Text, { style: rightDescriptionStyles }, rightDescription)) : null)) : null,\n leftDescription ? (React.createElement(View, { style: {\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n marginTop: numColumns === 3 ? 4 : 4 / 2,\n } },\n React.createElement(Text, { numberOfLines: 1, style: [typography.body2, { color: colors.medium }] }, leftDescription),\n rightDescription ? (React.createElement(Text, { numberOfLines: 1, style: rightDescriptionStyles }, rightDescription)) : null)) : null)));\n};\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,GAA0H,IAPrH,CAAJ,GAOkI,IAb3I,EAcID,eAAe,gBAAIZ,KAAK,CAACkC,aAAN,CAAoBjC,IAApB,EAA0B;IAAEqB,KAAK,EAAE;MAC9CmB,aAAa,EAAE,KAD+B;MAE9CE,cAAc,EAAE,eAF8B;MAG9CD,UAAU,EAAE,QAHkC;MAI9CE,SAAS,EAAE3B,UAAU,KAAK,CAAf,GAAmB,CAAnB,GAAuB,IAAI;IAJQ;EAAT,CAA1B,eAMfjB,KAAK,CAACkC,aAAN,CAAoBhC,IAApB,EAA0B;IAAE2C,aAAa,EAAE,CAAjB;IAAoBvB,KAAK,EAAE,CAACD,UAAU,CAAC0B,KAAZ,EAAmB;MAAEf,KAAK,EAAEb,MAAM,CAAC6B;IAAhB,CAAnB;EAA3B,CAA1B,EAAqGpC,eAArG,CANe,EAOfC,gBAAgB,gBAAIb,KAAK,CAACkC,aAAN,CAAoBhC,IAApB,EAA0B;IAAE2C,aAAa,EAAE,CAAjB;IAAoBvB,KAAK,EAAEQ;EAA3B,CAA1B,EAA+EjB,gBAA/E,CAAJ,GAAwG,IAPzG,CAAJ,GAOsH,IArBzI,CADI,CAAR;AAuBH,CA7CD;;AA8CA,eAAeP,SAAS,CAACE,SAAD,CAAxB"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
2
|
-
|
|
3
1
|
import * as React from "react";
|
|
4
2
|
import { StyleSheet, View, Platform } from "react-native";
|
|
5
3
|
import { isString } from "lodash";
|
|
@@ -8,7 +6,7 @@ import { usePrevious } from "../../hooks";
|
|
|
8
6
|
import Text from "../Text";
|
|
9
7
|
import Touchable from "../Touchable";
|
|
10
8
|
import Checkbox from "./Checkbox";
|
|
11
|
-
export
|
|
9
|
+
export var Direction;
|
|
12
10
|
|
|
13
11
|
(function (Direction) {
|
|
14
12
|
Direction["Row"] = "row";
|
|
@@ -80,13 +78,14 @@ const CheckboxRow = _ref => {
|
|
|
80
78
|
textStyles,
|
|
81
79
|
viewStyles
|
|
82
80
|
} = extractStyles(style);
|
|
83
|
-
return /*#__PURE__*/React.createElement(Touchable,
|
|
81
|
+
return /*#__PURE__*/React.createElement(Touchable, {
|
|
84
82
|
onPress: handlePress,
|
|
85
83
|
style: [viewStyles, styles.mainParent, {
|
|
86
84
|
flexDirection: direction
|
|
87
85
|
}],
|
|
88
|
-
disabled: disabled
|
|
89
|
-
|
|
86
|
+
disabled: disabled,
|
|
87
|
+
...rest
|
|
88
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
90
89
|
style: [styles.label, {
|
|
91
90
|
alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
|
|
92
91
|
}, labelContainerStyle]
|
|
@@ -124,4 +123,22 @@ const styles = StyleSheet.create({
|
|
|
124
123
|
}
|
|
125
124
|
});
|
|
126
125
|
export default CheckboxRow;
|
|
126
|
+
//# sourceMappingURL=CheckboxRow.js.maptems: "center",
|
|
127
|
+
justifyContent: "space-around",
|
|
128
|
+
paddingStart: 20,
|
|
129
|
+
minHeight: 50,
|
|
130
|
+
paddingEnd: 20,
|
|
131
|
+
display: "flex",
|
|
132
|
+
...Platform.select({
|
|
133
|
+
web: {
|
|
134
|
+
cursor: "pointer",
|
|
135
|
+
userSelect: "none"
|
|
136
|
+
}
|
|
137
|
+
})
|
|
138
|
+
},
|
|
139
|
+
label: {
|
|
140
|
+
flex: 3
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
export default CheckboxRow;
|
|
127
144
|
//# sourceMappingURL=CheckboxRow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","StyleSheet","View","Platform","isString","extractStyles","usePrevious","Text","Touchable","Checkbox","Direction","renderLabel","value","labelStyle","textStyle","CheckboxRow","label","labelContainerStyle","checkboxStyle","direction","Row","Icon","status","disabled","onPress","onCheck","onUncheck","color","uncheckedColor","defaultValue","checkedIcon","uncheckedIcon","size","
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","View","Platform","isString","extractStyles","usePrevious","Text","Touchable","Checkbox","Direction","renderLabel","value","labelStyle","textStyle","createElement","style","Fragment","CheckboxRow","label","labelContainerStyle","checkboxStyle","direction","Row","Icon","status","disabled","onPress","onCheck","onUncheck","color","uncheckedColor","defaultValue","checkedIcon","uncheckedIcon","size","rest","internalValue","setInternalValue","useState","useEffect","previousDefaultValue","Boolean","handlePress","newValue","textStyles","viewStyles","styles","mainParent","flexDirection","alignItems","create","justifyContent","paddingStart","minHeight","paddingEnd","display","select","web","cursor","userSelect","flex"],"sources":["CheckboxRow.js"],"sourcesContent":["import * as React from \"react\";\nimport { StyleSheet, View, Platform, } from \"react-native\";\nimport { isString } from \"lodash\";\nimport { extractStyles } from \"../../utilities\";\nimport { usePrevious } from \"../../hooks\";\nimport Text from \"../Text\";\nimport Touchable from \"../Touchable\";\nimport Checkbox from \"./Checkbox\";\nexport var Direction;\n(function (Direction) {\n Direction[\"Row\"] = \"row\";\n Direction[\"RowReverse\"] = \"row-reverse\";\n})(Direction || (Direction = {}));\nconst renderLabel = (value, labelStyle, textStyle) => {\n if (isString(value)) {\n return React.createElement(Text, { style: [textStyle, labelStyle] }, value);\n }\n else {\n return React.createElement(React.Fragment, null, value);\n }\n};\nconst CheckboxRow = ({ label = \"Label\", labelStyle, labelContainerStyle, checkboxStyle, direction = Direction.Row, Icon, status, disabled = false, onPress, onCheck, onUncheck, color, uncheckedColor, defaultValue, checkedIcon, uncheckedIcon, size, style, ...rest }) => {\n const [internalValue, setInternalValue] = React.useState(status || defaultValue || false);\n React.useEffect(() => {\n if (status != null) {\n setInternalValue(status);\n }\n }, [status]);\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);\n React.useEffect(() => {\n if (defaultValue !== previousDefaultValue) {\n setInternalValue(Boolean(defaultValue));\n }\n }, [defaultValue, previousDefaultValue]);\n const handlePress = () => {\n const newValue = !internalValue;\n setInternalValue(newValue);\n onPress === null || onPress === void 0 ? void 0 : onPress(newValue);\n if (newValue) {\n onCheck === null || onCheck === void 0 ? void 0 : onCheck();\n }\n if (!newValue) {\n onUncheck === null || onUncheck === void 0 ? void 0 : onUncheck();\n }\n };\n const { textStyles, viewStyles } = extractStyles(style);\n return (React.createElement(Touchable, { onPress: handlePress, style: [viewStyles, styles.mainParent, { flexDirection: direction }], disabled: disabled, ...rest },\n React.createElement(View, { style: [\n styles.label,\n {\n alignItems: direction === Direction.Row ? \"flex-start\" : \"flex-end\",\n },\n labelContainerStyle,\n ] }, renderLabel(label, textStyles, labelStyle)),\n React.createElement(Checkbox, { Icon: Icon, status: internalValue, style: checkboxStyle, disabled: disabled, onPress: handlePress, color: color, uncheckedColor: uncheckedColor, checkedIcon: checkedIcon, uncheckedIcon: uncheckedIcon, size: size })));\n};\nconst styles = StyleSheet.create({\n mainParent: {\n alignItems: \"center\",\n justifyContent: \"space-around\",\n paddingStart: 20,\n minHeight: 50,\n paddingEnd: 20,\n display: \"flex\",\n ...Platform.select({\n web: {\n cursor: \"pointer\",\n userSelect: \"none\",\n },\n }),\n },\n label: {\n flex: 3,\n },\n});\nexport default CheckboxRow;\n"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,UAAT,EAAqBC,IAArB,EAA2BC,QAA3B,QAA4C,cAA5C;AACA,SAASC,QAAT,QAAyB,QAAzB;AACA,SAASC,aAAT,QAA8B,iBAA9B;AACA,SAASC,WAAT,QAA4B,aAA5B;AACA,OAAOC,IAAP,MAAiB,SAAjB;AACA,OAAOC,SAAP,MAAsB,cAAtB;AACA,OAAOC,QAAP,MAAqB,YAArB;AACA,OAAO,IAAIC,SAAJ;;AACP,CAAC,UAAUA,SAAV,EAAqB;EAClBA,SAAS,CAAC,KAAD,CAAT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AD7D,CAF2B,EAK3BH,mBAL2B;EAAT,CAA1B,EAMST,WAAW,CAACQ,KAAD,EAAQ0B,UAAR,EAAoBhC,UAApB,CANpB,CADI,eAQJb,KAAK,CAACe,aAAN,CAAoBN,QAApB,EAA8B;IAAEe,IAAI,EAAEA,IAAR;IAAcC,MAAM,EAAEY,aAAtB;IAAqCrB,KAAK,EAAEK,aAA5C;IAA2DK,QAAQ,EAAEA,QAArE;IAA+EC,OAAO,EAAEgB,WAAxF;IAAqGb,KAAK,EAAEA,KAA5G;IAAmHC,cAAc,EAAEA,cAAnI;IAAmJE,WAAW,EAAEA,WAAhK;IAA6KC,aAAa,EAAEA,aAA5L;IAA2MC,IAAI,EAAEA;EAAjN,CAA9B,CARI,CAAR;AASH,CApCD;;AAqCA,MAAMY,MAAM,GAAG9C,UAAU,CAACkD,MAAX,CAAkB;EAC7BH,UAAU,EAAE;IACRE,UAAU,EAAE,QADJ;IAERE,cAAc,EAAE,cAFR;IAGRC,YAAY,EAAE,EAHN;IAIRC,SAAS,EAAE,EAJH;IAKRC,UAAU,EAAE,EALJ;IAMRC,OAAO,EAAE,MAND;IAOR,GAAGrD,QAAQ,CAACsD,MAAT,CAAgB;MACfC,GAAG,EAAE;QACDC,MAAM,EAAE,SADP;QAEDC,UAAU,EAAE;MAFX;IADU,CAAhB;EAPK,CADiB;EAe7BzC,KAAK,EAAE;IACH0C,IAAI,EAAE;EADH;AAfsB,CAAlB,CAAf;AAmBA,eAAe3C,WAAf"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
2
|
+
|
|
1
3
|
import * as React from "react";
|
|
2
4
|
import { View, ImageBackground, StyleSheet } from "react-native";
|
|
3
5
|
import { withTheme } from "../theming";
|
|
@@ -64,10 +66,9 @@ const Container = _ref => {
|
|
|
64
66
|
};
|
|
65
67
|
const Wrap = elevation ? Elevation : View;
|
|
66
68
|
if (elevation) containerStyle.elevation = elevation;
|
|
67
|
-
return /*#__PURE__*/React.createElement(Wrap, {
|
|
68
|
-
style: [containerStyle, style]
|
|
69
|
-
|
|
70
|
-
}, backgroundImage ? /*#__PURE__*/React.createElement(ImageBackground, {
|
|
69
|
+
return /*#__PURE__*/React.createElement(Wrap, _extends({
|
|
70
|
+
style: [containerStyle, style]
|
|
71
|
+
}, rest), backgroundImage ? /*#__PURE__*/React.createElement(ImageBackground, {
|
|
71
72
|
source: typeof backgroundImage === "string" ? {
|
|
72
73
|
uri: backgroundImage
|
|
73
74
|
} : backgroundImage,
|
|
@@ -82,18 +83,5 @@ const Container = _ref => {
|
|
|
82
83
|
}, children));
|
|
83
84
|
};
|
|
84
85
|
|
|
85
|
-
export default withTheme(Container);
|
|
86
|
-
//# sourceMappingURL=Container.js.map } : backgroundImage,
|
|
87
|
-
resizeMode: backgroundImageResizeMode,
|
|
88
|
-
style: {
|
|
89
|
-
flex: 1
|
|
90
|
-
}
|
|
91
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
92
|
-
style: innerStyle
|
|
93
|
-
}, children)) : /*#__PURE__*/React.createElement(View, {
|
|
94
|
-
style: innerStyle
|
|
95
|
-
}, children));
|
|
96
|
-
};
|
|
97
|
-
|
|
98
86
|
export default withTheme(Container);
|
|
99
87
|
//# sourceMappingURL=Container.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","ImageBackground","StyleSheet","withTheme","Elevation","Container","useThemeGutterPadding","borderColor","borderWidth","backgroundColor","backgroundImage","backgroundImageResizeMode","elevation","style","children","theme","rest","flex","flexGrow","flexWrap","flexBasis","flexShrink","flexDirection","alignContent","justifyContent","alignItems","padding","paddingTop","paddingBottom","paddingLeft","paddingRight","paddingVertical","paddingHorizontal","styleProp","flatten","containerStyle","width","innerStyle","Wrap","
|
|
1
|
+
{"version":3,"names":["React","View","ImageBackground","StyleSheet","withTheme","Elevation","Container","useThemeGutterPadding","borderColor","borderWidth","backgroundColor","backgroundImage","backgroundImageResizeMode","elevation","style","children","theme","rest","flex","flexGrow","flexWrap","flexBasis","flexShrink","flexDirection","alignContent","justifyContent","alignItems","padding","paddingTop","paddingBottom","paddingLeft","paddingRight","paddingVertical","paddingHorizontal","styleProp","flatten","containerStyle","width","innerStyle","Wrap","uri"],"sources":["Container.tsx"],"sourcesContent":["import * as React from \"react\";\nimport {\n View,\n ImageBackground,\n ImageSourcePropType,\n StyleProp,\n StyleSheet,\n ViewStyle,\n} from \"react-native\";\nimport { withTheme } from \"../theming\";\n\nimport Elevation from \"./Elevation\";\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport { ResizeModeType } from \"./ResizeMode\";\n\ntype Props = {\n theme: Theme;\n useThemeGutterPadding: boolean;\n borderColor: string;\n borderWidth: number;\n backgroundColor: string;\n backgroundImage?: string | ImageSourcePropType;\n backgroundImageResizeMode?: ResizeModeType;\n elevation?: number;\n style?: StyleProp<ViewStyle>;\n children?: React.ReactNode;\n};\n\nconst Container: React.FC<React.PropsWithChildren<Props>> = ({\n useThemeGutterPadding,\n borderColor,\n borderWidth,\n backgroundColor,\n backgroundImage,\n backgroundImageResizeMode,\n elevation,\n style,\n children,\n theme, // eslint-disable-line @typescript-eslint/no-unused-vars\n ...rest\n}) => {\n const {\n flex,\n flexGrow,\n flexWrap,\n flexBasis,\n flexShrink,\n flexDirection,\n alignContent,\n justifyContent,\n alignItems,\n padding,\n paddingTop,\n paddingBottom,\n paddingLeft,\n paddingRight,\n paddingVertical,\n paddingHorizontal,\n ...styleProp\n } = StyleSheet.flatten(style) || {};\n\n const containerStyle: StyleProp<ViewStyle> = {\n backgroundColor,\n borderColor,\n borderWidth,\n width: \"100%\",\n ...styleProp,\n };\n\n const innerStyle: StyleProp<ViewStyle> = {\n flex,\n flexGrow,\n flexWrap,\n flexBasis,\n flexShrink,\n flexDirection,\n alignContent,\n justifyContent,\n alignItems,\n padding,\n paddingTop,\n paddingBottom,\n paddingLeft,\n paddingRight,\n paddingVertical,\n paddingHorizontal: paddingHorizontal || useThemeGutterPadding ? 16 : 0,\n };\n\n const Wrap = elevation ? Elevation : View;\n\n if (elevation) containerStyle.elevation = elevation;\n\n return (\n <Wrap style={[containerStyle, style]} {...rest}>\n {backgroundImage ? (\n <ImageBackground\n source={\n typeof backgroundImage === \"string\"\n ? { uri: backgroundImage }\n : backgroundImage\n }\n resizeMode={backgroundImageResizeMode}\n style={{\n flex: 1,\n }}\n >\n <View style={innerStyle}>{children}</View>\n </ImageBackground>\n ) : (\n <View style={innerStyle}>{children}</View>\n )}\n </Wrap>\n );\n};\n\nexport default withTheme(Container);\n"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SACEC,IADF,EAEEC,eAFF,EAKEC,UALF,QAOO,cAPP;AAQA,SAASC,SAAT,QAA0B,YAA1B;AAEA,OAAOC,SAAP,MAAsB,aAAtB;;AAiBA,MAAMC,SAAmD,GAAG,QAYtD;EAAA,IAZuD;IAC3DC,qBAD2D;IAE3DC,WAF2D;IAG3DC,WAH2D;IAI3DC,eAJ2D;IAK3DC,eAL2D;IAM3DC,yBAN2D;IAO3DC,SAP2D;IAQ3DC,KAR2D;IAS3DC,QAT2D;IAU3DC,KAV2D;IAUpD;IACP,GAAGC;EAXwD,CAYvD;EACJ,MAAM;IACJC,IADI;IAEJC,QAFI;IAGJC,QAHI;IAIJC,SAJI;IAKJC,UALI;IAMJC,aANI;IAOJC,YAPI;IAQJC,cARI;IASJC,UATI;IAUJC,OAVI;IAWJC,UAXI;IAYJC,aAZI;IAaJC,WAbI;IAcJC,YAdI;IAeJC,eAfI;IAgBJC,iBAhBI;IAiBJ,GAAGC;EAjBC,IAkBF/B,UAAU,CAACgC,OAAX,CAAmBrB,KAAnB,KAA6B,EAlBjC;EAoBA,MAAMsB,cAAoC,GAAG;IAC3C1B,eAD2C;IAE3CF,WAF2C;IAG3CC,WAH2C;IAI3C4B,KAAK,EAAE,MAJoC;IAK3C,GAAGH;EALwC,CAA7C;EAQA,MAAMI,UAAgC,GAAG;IACvCpB,IADuC;IAEvCC,QAFuC;IAGvCC,QAHuC;IAIvCC,SAJuC;IAKvCC,UALuC;IAMvCC,aANuC;IAOvCC,YAPuC;IAQvCC,cARuC;IASvCC,UATuC;IAUvCC,OAVuC;IAWvCC,UAXuC;IAYvCC,aAZuC;IAavCC,WAbuC;IAcvCC,YAduC;IAevCC,eAfuC;IAgBvCC,iBAAiB,EAAEA,iBAAiB,IAAI1B,qBAArB,GAA6C,EAA7C,GAAkD;EAhB9B,CAAzC;EAmBA,MAAMgC,IAAI,GAAG1B,SAAS,GAAGR,SAAH,GAAeJ,IAArC;EAEA,IAAIY,SAAJ,EAAeuB,cAAc,CAACvB,SAAf,GAA2BA,SAA3B;EAEf,oBACE,oBAAC,IAAD;IAAM,KAAK,EAAE,CAACuB,cAAD,EAAiBtB,KAAjB;EAAb,GAA0CG,IAA1C,GACGN,eAAe,gBACd,oBAAC,eAAD;IACE,MAAM,EACJ,OAAOA,eAAP,KAA2B,QAA3B,GACI;MAAE6B,GAAG,EAAE7B;IAAP,CADJ,GAEIA,eAJR;IAME,UAAU,EAAEC,yBANd;IAOE,KAAK,EAAE;MACLM,IAAI,EAAE;IADD;EAPT,gBAWE,oBAAC,IAAD;IAAM,KAAK,EAAEoB;EAAb,GAA0BvB,QAA1B,CAXF,CADc,gBAed,oBAAC,IAAD;IAAM,KAAK,EAAEuB;EAAb,GAA0BvB,QAA1B,CAhBJ,CADF;AAqBD,CArFD;;AAuFA,eAAeX,SAAS,CAACE,SAAD,CAAxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","withTheme","Header","HeaderLarge","Icon","title","buttonText","icon","onPress","style","theme","colors","typography","
|
|
1
|
+
{"version":3,"names":["React","withTheme","Header","HeaderLarge","Icon","title","buttonText","icon","onPress","style","theme","colors","typography","headline4","strong"],"sources":["HeaderLarge.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { withTheme } from \"../theming\";\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\nimport Header from \"./Header\";\nimport { StyleProp, ViewStyle } from \"react-native\";\n\ntype Props = {\n title: string;\n buttonText: string;\n icon: string;\n onPress?: () => void;\n style?: StyleProp<ViewStyle>;\n theme: Theme;\n} & IconSlot;\n\nconst HeaderLarge: React.FC<React.PropsWithChildren<Props>> = ({\n Icon,\n title,\n buttonText,\n icon,\n onPress = () => {},\n style,\n theme: { colors, typography },\n}) => {\n return (\n <Header\n Icon={Icon}\n titleTypeStyle={typography.headline4}\n titleColor={colors.strong}\n title={title}\n buttonText={buttonText}\n icon={icon}\n onPress={onPress}\n style={style}\n />\n );\n};\n\nexport default withTheme(HeaderLarge);\n"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,SAAT,QAA0B,YAA1B;AAGA,OAAOC,MAAP,MAAmB,UAAnB;;AAYA,MAAMC,WAAqD,GAAG,QAQxD;EAAA,IARyD;IAC7DC,IAD6D;IAE7DC,KAF6D;IAG7DC,UAH6D;IAI7DC,IAJ6D;IAK7DC,OAAO,GAAG,MAAM,CAAE,CAL2C;IAM7DC,KAN6D;IAO7DC,KAAK,EAAE;MAAEC,MAAF;MAAUC;IAAV;EAPsD,CAQzD;EACJ,oBACE,oBAAC,MAAD;IACE,IAAI,EAAER,IADR;IAEE,cAAc,EAAEQ,UAAU,CAACC,SAF7B;IAGE,UAAU,EAAEF,MAAM,CAACG,MAHrB;IAIE,KAAK,EAAET,KAJT;IAKE,UAAU,EAAEC,UALd;IAME,IAAI,EAAEC,IANR;IAOE,OAAO,EAAEC,OAPX;IAQE,KAAK,EAAEC;EART,EADF;AAYD,CArBD;;AAuBA,eAAeR,SAAS,CAACE,WAAD,CAAxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","withTheme","Header","HeaderMedium","Icon","title","buttonText","icon","onPress","style","theme","colors","typography","
|
|
1
|
+
{"version":3,"names":["React","withTheme","Header","HeaderMedium","Icon","title","buttonText","icon","onPress","style","theme","colors","typography","headline6","strong"],"sources":["HeaderMedium.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { withTheme } from \"../theming\";\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\n\nimport Header from \"./Header\";\nimport { StyleProp, ViewStyle } from \"react-native\";\n\ntype Props = {\n title: string;\n buttonText: string;\n icon: string;\n onPress?: () => void;\n style?: StyleProp<ViewStyle>;\n theme: Theme;\n} & IconSlot;\n\nconst HeaderMedium: React.FC<React.PropsWithChildren<Props>> = ({\n Icon,\n title,\n buttonText,\n icon,\n onPress = () => {},\n style,\n theme: { colors, typography },\n}) => {\n return (\n <Header\n Icon={Icon}\n titleTypeStyle={typography.headline6}\n titleColor={colors.strong}\n title={title}\n buttonText={buttonText}\n icon={icon}\n onPress={onPress}\n style={style}\n />\n );\n};\n\nexport default withTheme(HeaderMedium);\n"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,SAAT,QAA0B,YAA1B;AAIA,OAAOC,MAAP,MAAmB,UAAnB;;AAYA,MAAMC,YAAsD,GAAG,QAQzD;EAAA,IAR0D;IAC9DC,IAD8D;IAE9DC,KAF8D;IAG9DC,UAH8D;IAI9DC,IAJ8D;IAK9DC,OAAO,GAAG,MAAM,CAAE,CAL4C;IAM9DC,KAN8D;IAO9DC,KAAK,EAAE;MAAEC,MAAF;MAAUC;IAAV;EAPuD,CAQ1D;EACJ,oBACE,oBAAC,MAAD;IACE,IAAI,EAAER,IADR;IAEE,cAAc,EAAEQ,UAAU,CAACC,SAF7B;IAGE,UAAU,EAAEF,MAAM,CAACG,MAHrB;IAIE,KAAK,EAAET,KAJT;IAKE,UAAU,EAAEC,UALd;IAME,IAAI,EAAEC,IANR;IAOE,OAAO,EAAEC,OAPX;IAQE,KAAK,EAAEC;EART,EADF;AAYD,CArBD;;AAuBA,eAAeR,SAAS,CAACE,YAAD,CAAxB"}
|
|
@@ -12,6 +12,10 @@ export const SEED_DATA = {
|
|
|
12
12
|
label: "Horizontal",
|
|
13
13
|
description: "Render list horizontally"
|
|
14
14
|
}),
|
|
15
|
+
inverted: createStaticBoolProp({
|
|
16
|
+
label: "Inverted",
|
|
17
|
+
description: "If true, reverses the direction."
|
|
18
|
+
}),
|
|
15
19
|
numColumns: createNumColumnsType({
|
|
16
20
|
editable: true
|
|
17
21
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["COMPONENT_TYPES","createNumColumnsType","createStaticBoolProp","SEED_DATA","name","tag","description","category","data","layout","flex","props","horizontal","label","numColumns","editable"],"sources":["FlatList.ts"],"sourcesContent":["import {\n COMPONENT_TYPES,\n createNumColumnsType,\n createStaticBoolProp,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"List\",\n tag: \"FlatList\",\n description: \"A basic List component\",\n category: COMPONENT_TYPES.data,\n layout: {\n flex: 1,\n },\n props: {\n horizontal: createStaticBoolProp({\n label: \"Horizontal\",\n description: \"Render list horizontally\",\n }),\n numColumns: createNumColumnsType({\n editable: true,\n }),\n },\n};\n"],"mappings":"AAAA,SACEA,eADF,EAEEC,oBAFF,EAGEC,oBAHF,QAIO,iBAJP;AAMA,OAAO,MAAMC,SAAS,GAAG;EACvBC,IAAI,EAAE,MADiB;EAEvBC,GAAG,EAAE,UAFkB;EAGvBC,WAAW,EAAE,wBAHU;EAIvBC,QAAQ,EAAEP,eAAe,CAACQ,IAJH;EAKvBC,MAAM,EAAE;IACNC,IAAI,EAAE;EADA,CALe;EAQvBC,KAAK,EAAE;IACLC,UAAU,EAAEV,oBAAoB,CAAC;MAC/BW,KAAK,EAAE,YADwB;MAE/BP,WAAW,EAAE;IAFkB,CAAD,CAD3B;IAKLQ,UAAU,
|
|
1
|
+
{"version":3,"names":["COMPONENT_TYPES","createNumColumnsType","createStaticBoolProp","SEED_DATA","name","tag","description","category","data","layout","flex","props","horizontal","label","inverted","numColumns","editable"],"sources":["FlatList.ts"],"sourcesContent":["import {\n COMPONENT_TYPES,\n createNumColumnsType,\n createStaticBoolProp,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"List\",\n tag: \"FlatList\",\n description: \"A basic List component\",\n category: COMPONENT_TYPES.data,\n layout: {\n flex: 1,\n },\n props: {\n horizontal: createStaticBoolProp({\n label: \"Horizontal\",\n description: \"Render list horizontally\",\n }),\n inverted: createStaticBoolProp({\n label: \"Inverted\",\n description: \"If true, reverses the direction.\",\n }),\n numColumns: createNumColumnsType({\n editable: true,\n }),\n },\n};\n"],"mappings":"AAAA,SACEA,eADF,EAEEC,oBAFF,EAGEC,oBAHF,QAIO,iBAJP;AAMA,OAAO,MAAMC,SAAS,GAAG;EACvBC,IAAI,EAAE,MADiB;EAEvBC,GAAG,EAAE,UAFkB;EAGvBC,WAAW,EAAE,wBAHU;EAIvBC,QAAQ,EAAEP,eAAe,CAACQ,IAJH;EAKvBC,MAAM,EAAE;IACNC,IAAI,EAAE;EADA,CALe;EAQvBC,KAAK,EAAE;IACLC,UAAU,EAAEV,oBAAoB,CAAC;MAC/BW,KAAK,EAAE,YADwB;MAE/BP,WAAW,EAAE;IAFkB,CAAD,CAD3B;IAKLQ,QAAQ,EAAEZ,oBAAoB,CAAC;MAC7BW,KAAK,EAAE,UADsB;MAE7BP,WAAW,EAAE;IAFgB,CAAD,CALzB;IASLS,UAAU,EAAEd,oBAAoB,CAAC;MAC/Be,QAAQ,EAAE;IADqB,CAAD;EAT3B;AARgB,CAAlB"}
|
|
@@ -17,6 +17,16 @@ export declare const SEED_DATA: {
|
|
|
17
17
|
required: boolean;
|
|
18
18
|
group: string;
|
|
19
19
|
};
|
|
20
|
+
inverted: {
|
|
21
|
+
label: string;
|
|
22
|
+
description: string;
|
|
23
|
+
formType: string;
|
|
24
|
+
propType: string;
|
|
25
|
+
defaultValue: boolean;
|
|
26
|
+
editable: boolean;
|
|
27
|
+
required: boolean;
|
|
28
|
+
group: string;
|
|
29
|
+
};
|
|
20
30
|
numColumns: {
|
|
21
31
|
label: string;
|
|
22
32
|
description: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.2.1-
|
|
3
|
+
"version": "46.2.1-45f2e3.2+45f2e37a",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
]
|
|
80
80
|
]
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "45f2e37aeec4facacdf0aa6d3359267207a9a9cd"
|
|
83
83
|
}
|
package/src/mappings/FlatList.js
CHANGED
|
@@ -12,6 +12,10 @@ export const SEED_DATA = {
|
|
|
12
12
|
label: "Horizontal",
|
|
13
13
|
description: "Render list horizontally",
|
|
14
14
|
}),
|
|
15
|
+
inverted: createStaticBoolProp({
|
|
16
|
+
label: "Inverted",
|
|
17
|
+
description: "If true, reverses the direction.",
|
|
18
|
+
}),
|
|
15
19
|
numColumns: createNumColumnsType({
|
|
16
20
|
editable: true,
|
|
17
21
|
}),
|
package/src/mappings/FlatList.ts
CHANGED
|
@@ -17,6 +17,10 @@ export const SEED_DATA = {
|
|
|
17
17
|
label: "Horizontal",
|
|
18
18
|
description: "Render list horizontally",
|
|
19
19
|
}),
|
|
20
|
+
inverted: createStaticBoolProp({
|
|
21
|
+
label: "Inverted",
|
|
22
|
+
description: "If true, reverses the direction.",
|
|
23
|
+
}),
|
|
20
24
|
numColumns: createNumColumnsType({
|
|
21
25
|
editable: true,
|
|
22
26
|
}),
|