@draftbit/core 43.3.0 → 43.3.4-71ace3.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 +21 -5
- package/lib/commonjs/components/Accordion/AccordionItem.js.map +1 -1
- package/lib/commonjs/components/DeprecatedFAB.js +20 -4
- package/lib/commonjs/components/DeprecatedFAB.js.map +1 -1
- package/lib/commonjs/components/Elevation.js +3 -14
- package/lib/commonjs/components/Elevation.js.map +1 -1
- package/lib/commonjs/components/Stepper.js +28 -19
- package/lib/commonjs/components/Stepper.js.map +1 -1
- package/lib/commonjs/components/ToggleButton.js +86 -0
- package/lib/commonjs/components/ToggleButton.js.map +1 -0
- package/lib/commonjs/index.js +8 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mappings/ActionSheet.js.map +1 -1
- package/lib/commonjs/mappings/RadioButtonRow.js.map +1 -1
- package/lib/commonjs/mappings/Stepper.js +9 -0
- package/lib/commonjs/mappings/Stepper.js.map +1 -1
- package/lib/commonjs/mappings/TextArea.js +10 -1
- package/lib/commonjs/mappings/TextArea.js.map +1 -1
- package/lib/commonjs/mappings/ToggleButton.js +60 -0
- package/lib/commonjs/mappings/ToggleButton.js.map +1 -0
- package/lib/commonjs/mappings/Touchable.js.map +1 -1
- package/lib/commonjs/mappings/Video.js.map +1 -1
- package/lib/commonjs/mappings/WebView.js.map +1 -1
- package/lib/module/components/DatePicker/DatePickerComponent.js.map +1 -1
- package/lib/module/components/Picker/PickerComponent.android.js +10 -7
- package/lib/module/components/Picker/PickerComponent.android.js.map +1 -1
- package/lib/module/components/Stepper.js +27 -19
- package/lib/module/components/Stepper.js.map +1 -1
- package/lib/module/components/ToggleButton.js +67 -0
- package/lib/module/components/ToggleButton.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/mappings/Stepper.js +10 -1
- package/lib/module/mappings/Stepper.js.map +1 -1
- package/lib/module/mappings/TextArea.js +10 -1
- package/lib/module/mappings/TextArea.js.map +1 -1
- package/lib/module/mappings/ToggleButton.js +51 -0
- package/lib/module/mappings/ToggleButton.js.map +1 -0
- package/lib/typescript/src/components/Stepper.d.ts +2 -0
- package/lib/typescript/src/components/ToggleButton.d.ts +24 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/mappings/Stepper.d.ts +22 -0
- package/lib/typescript/src/mappings/TextArea.d.ts +10 -1
- package/lib/typescript/src/mappings/ToggleButton.d.ts +124 -0
- package/package.json +3 -3
- package/src/components/Stepper.js +23 -21
- package/src/components/Stepper.tsx +27 -19
- package/src/components/ToggleButton.js +39 -0
- package/src/components/ToggleButton.tsx +94 -0
- package/src/index.js +1 -0
- package/src/index.tsx +1 -0
- package/src/mappings/Stepper.js +10 -1
- package/src/mappings/Stepper.ts +10 -0
- package/src/mappings/TextArea.js +12 -1
- package/src/mappings/TextArea.ts +12 -1
- package/src/mappings/ToggleButton.js +50 -0
- package/src/mappings/ToggleButton.ts +62 -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 || 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,22 @@ 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.map flexDirection: "row",
|
|
78
|
+
alignItems: "center",
|
|
79
|
+
paddingLeft: 8
|
|
80
|
+
},
|
|
81
|
+
item: {
|
|
82
|
+
marginVertical: 6,
|
|
83
|
+
paddingLeft: 8
|
|
84
|
+
},
|
|
85
|
+
content: {
|
|
86
|
+
flex: 1,
|
|
87
|
+
justifyContent: "center"
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
var _default = (0, _theming.withTheme)(AccordionItem);
|
|
92
|
+
|
|
77
93
|
exports.default = _default;
|
|
78
94
|
//# sourceMappingURL=AccordionItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["AccordionItem.
|
|
1
|
+
{"version":3,"sources":["AccordionItem.js"],"names":["AccordionItem","Icon","icon","label","style","iconColor","theme","rest","textStyles","viewStyles","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"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AACA,MAAMA,aAAa,GAAG,QAA6D;AAAA,MAA5D;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,IAAR;AAAcC,IAAAA,KAAd;AAAqBC,IAAAA,KAArB;AAA4BC,IAAAA,SAA5B;AAAuCC,IAAAA,KAAvC;AAA8C,OAAGC;AAAjD,GAA4D;AAC/E,QAAM;AAAEC,IAAAA,UAAF;AAAcC,IAAAA;AAAd,MAA6B,8BAAcL,KAAd,CAAnC;AACA,sBAAQM,KAAK,CAACC,aAAN,CAAoBC,sBAApB,EAA+B;AAAER,IAAAA,KAAK,EAAE,CAACS,MAAM,CAACC,SAAR,EAAmBL,UAAnB,CAAT;AAAyC,OAAGF;AAA5C,GAA/B,eACJG,KAAK,CAACC,aAAN,CAAoBI,iBAApB,EAA0B;AAAEX,IAAAA,KAAK,EAAES,MAAM,CAACG;AAAhB,GAA1B,EACId,IAAI,gBAAIQ,KAAK,CAACC,aAAN,CAAoBV,IAApB,EAA0B;AAAEgB,IAAAA,IAAI,EAAEf,IAAR;AAAcgB,IAAAA,IAAI,EAAE,EAApB;AAAwBC,IAAAA,KAAK,EAAEd,SAAS,IAAIC,KAAK,CAACc,MAAN,CAAaC;AAAzD,GAA1B,CAAJ,GAAqG,IAD7G,eAEIX,KAAK,CAACC,aAAN,CAAoBI,iBAApB,EAA0B;AAAEX,IAAAA,KAAK,EAAE,CAACS,MAAM,CAACS,IAAR,EAAcT,MAAM,CAACU,OAArB;AAAT,GAA1B,eACIb,KAAK,CAACC,aAAN,CAAoBa,aAApB,EAA0B;AAAEC,IAAAA,UAAU,EAAE,KAAd;AAAqBrB,IAAAA,KAAK,EAAEI;AAA5B,GAA1B,EAAoEL,KAApE,CADJ,CAFJ,CADI,CAAR;AAKH,CAPD;;AAQA,MAAMU,MAAM,GAAGa,wBAAWC,MAAX,CAAkB;AAC7Bb,EAAAA,SAAS,EAAE;AACPc,IAAAA,OAAO,EAAE;AADF,GADkB;AAI7BZ,EAAAA,GAAG,EAAE;AACDa,IAAAA,aAAa,EAAE,KADd;AAEDC,IAAAA,UAAU,EAAE,QAFX;AAGDC,IAAAA,WAAW,EAAE;AAHZ,GAJwB;AAS7BT,EAAAA,IAAI,EAAE;AACFU,IAAAA,cAAc,EAAE,CADd;AAEFD,IAAAA,WAAW,EAAE;AAFX,GATuB;AAa7BR,EAAAA,OAAO,EAAE;AACLU,IAAAA,IAAI,EAAE,CADD;AAELC,IAAAA,cAAc,EAAE;AAFX;AAboB,CAAlB,CAAf;;eAkBe,wBAAUlC,aAAV,C","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"]}
|
|
@@ -27,8 +27,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
27
27
|
|
|
28
28
|
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; }
|
|
29
29
|
|
|
30
|
-
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); }
|
|
31
|
-
|
|
32
30
|
const FAB = _ref => {
|
|
33
31
|
let {
|
|
34
32
|
Icon,
|
|
@@ -130,7 +128,7 @@ const FAB = _ref => {
|
|
|
130
128
|
style: [{
|
|
131
129
|
elevation
|
|
132
130
|
}, style]
|
|
133
|
-
}, /*#__PURE__*/React.createElement(_Touchable.default,
|
|
131
|
+
}, /*#__PURE__*/React.createElement(_Touchable.default, { ...rest,
|
|
134
132
|
onPress: onPress,
|
|
135
133
|
accessibilityState: {
|
|
136
134
|
disabled
|
|
@@ -138,7 +136,7 @@ const FAB = _ref => {
|
|
|
138
136
|
accessibilityRole: "button",
|
|
139
137
|
disabled: disabled || loading,
|
|
140
138
|
style: buttonStyles
|
|
141
|
-
}
|
|
139
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
142
140
|
style: styles.content
|
|
143
141
|
}, icon && loading !== true ? /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
144
142
|
style: iconStyle
|
|
@@ -181,5 +179,23 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
181
179
|
|
|
182
180
|
var _default = (0, _theming.withTheme)(FAB);
|
|
183
181
|
|
|
182
|
+
exports.default = _default;
|
|
183
|
+
//# sourceMappingURL=DeprecatedFAB.js.map },
|
|
184
|
+
icon: {
|
|
185
|
+
alignItems: "center",
|
|
186
|
+
justifyContent: "center",
|
|
187
|
+
width: _Config.default.buttonIconSize
|
|
188
|
+
},
|
|
189
|
+
fixed: {
|
|
190
|
+
left: 0,
|
|
191
|
+
right: 0,
|
|
192
|
+
bottom: 0,
|
|
193
|
+
height: 64,
|
|
194
|
+
borderRadius: 0
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
var _default = (0, _theming.withTheme)(FAB);
|
|
199
|
+
|
|
184
200
|
exports.default = _default;
|
|
185
201
|
//# sourceMappingURL=DeprecatedFAB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["DeprecatedFAB.tsx"],"names":["FAB","Icon","icon","disabled","type","loading","color","colorOverride","label","onPress","elevation","style","theme","colors","disabledOpacity","roundness","typography","rest","backgroundColor","borderColor","textColor","borderWidth","buttonColor","primary","surface","alpha","rgb","string","StyleSheet","hairlineWidth","buttonStyle","borderRadius","alignItems","justifyContent","buttonStyles","styles","button","contentStyle","content","textStyle","textAlign","iconStyle","width","Config","buttonIconSize","FABSize","height","FABBorderRadius","push","marginLeft","marginRight","margin","FABFixedHeight","alignSelf","create","borderStyle","flexDirection","fixed","left","right","bottom"],"mappings":";;;;;;;AAAA;;AACA;;AASA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAuDA,MAAMA,GAAoB,GAAG,QAavB;AAAA,MAbwB;AAC5BC,IAAAA,IAD4B;AAE5BC,IAAAA,IAF4B;AAG5BC,IAAAA,QAAQ,GAAG,KAHiB;AAI5BC,IAAAA,IAAI,GAAG,OAJqB;AAK5BC,IAAAA,OAAO,GAAG,KALkB;AAM5BC,IAAAA,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,MAAX,CAAkB;AAC/BlB,EAAAA,MAAM,EAAE;AACNmB,IAAAA,WAAW,EAAE;AADP,GADuB;AAI/BjB,EAAAA,OAAO,EAAE;AACPkB,IAAAA,aAAa,EAAE,KADR;AAEPxB,IAAAA,UAAU,EAAE,QAFL;AAGPC,IAAAA,cAAc,EAAE;AAHT,GAJsB;AAS/B/B,EAAAA,IAAI,EAAE;AACJ8B,IAAAA,UAAU,EAAE,QADR;AAEJC,IAAAA,cAAc,EAAE,QAFZ;AAGJS,IAAAA,KAAK,EAAEC,gBAAOC;AAHV,GATyB;AAc/Ba,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,CADD;AAELC,IAAAA,KAAK,EAAE,CAFF;AAGLC,IAAAA,MAAM,EAAE,CAHH;AAILd,IAAAA,MAAM,EAAE,EAJH;AAKLf,IAAAA,YAAY,EAAE;AALT;AAdwB,CAAlB,CAAf;;eAuBe,wBAAU/B,GAAV,C","sourcesContent":["import * as React from \"react\";\nimport {\n ActivityIndicator,\n View,\n StyleSheet,\n TouchableHighlightProps,\n StyleProp,\n ViewStyle,\n TextStyle,\n} from \"react-native\";\nimport color from \"color\";\nimport Config from \"./Config\";\nimport Text from \"./Text\";\nimport Touchable from \"./Touchable\";\nimport Elevation from \"./Elevation\";\nimport { withTheme } from \"../theming\";\n\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\n\n/**\n * A floating action button represents the primary action in an application.\n *\n * <div class=\"screenshots\">\n * <img src=\"screenshots/fab-1.png\" />\n * <img src=\"screenshots/fab-2.png\" />\n * </div>\n *\n * ## Usage\n * ```js\n * import * as React from 'react';\n * import { StyleSheet } from 'react-native';\n * import { FAB } from '@draftbit/ui';\n *\n * const MyComponent = () => (\n * <FAB\n * style={styles.fab}\n * type=\"outline\"\n * icon=\"add\"\n * onPress={() => console.log('Pressed')}\n * />\n * );\n *\n * const styles = StyleSheet.create({\n * fab: {\n * position: 'absolute',\n * margin: 16,\n * right: 0,\n * bottom: 0,\n * },\n * })\n *\n * export default MyComponent;\n * ```\n */\n\ntype Props = {\n disabled?: boolean;\n type?: \"solid\" | \"extended\" | \"outline\" | \"fixed\" | \"standard\";\n loading?: boolean;\n icon?: string;\n color?: string;\n label?: string;\n onPress: () => void;\n elevation?: number;\n theme: Theme;\n style?: StyleProp<ViewStyle>;\n} & TouchableHighlightProps &\n IconSlot;\n\nconst FAB: React.FC<Props> = ({\n Icon,\n icon,\n disabled = false,\n type = \"solid\",\n loading = false,\n color: colorOverride,\n label,\n onPress,\n elevation = 0,\n style,\n theme: { colors, disabledOpacity, roundness, typography },\n ...rest\n}) => {\n let backgroundColor, borderColor, textColor, borderWidth;\n const buttonColor = colorOverride || colors.primary;\n\n if (type === \"standard\" || type === \"extended\" || type === \"fixed\") {\n backgroundColor = buttonColor;\n\n if (disabled) {\n textColor = color(colors.surface).alpha(disabledOpacity).rgb().string();\n } else {\n textColor = colors.surface;\n }\n } else {\n backgroundColor = \"transparent\";\n\n if (disabled) {\n textColor = color(buttonColor).alpha(disabledOpacity).rgb().string();\n } else {\n textColor = buttonColor;\n }\n }\n\n if (type === \"outline\") {\n if (disabled) {\n borderColor = color(buttonColor).alpha(disabledOpacity).rgb().string();\n } else {\n borderColor = buttonColor;\n }\n borderWidth = StyleSheet.hairlineWidth;\n } else {\n borderColor = \"transparent\";\n borderWidth = 0;\n }\n\n const buttonStyle: StyleProp<ViewStyle> = {\n backgroundColor,\n borderColor,\n borderWidth,\n borderRadius: roundness,\n alignItems: \"center\",\n justifyContent: \"center\",\n };\n\n const buttonStyles: StyleProp<ViewStyle>[] = [styles.button, buttonStyle];\n\n const contentStyle: StyleProp<ViewStyle>[] = [styles.content];\n\n const textStyle: StyleProp<TextStyle> = {\n textAlign: \"center\",\n color: textColor,\n };\n\n const iconStyle: StyleProp<ViewStyle>[] = [\n styles.icon,\n {\n width: Config.buttonIconSize,\n },\n ];\n\n if (type === \"standard\" || type === \"outline\") {\n buttonStyle.width = Config.FABSize;\n buttonStyle.height = Config.FABSize;\n buttonStyle.borderRadius = Config.FABBorderRadius;\n\n contentStyle.push({\n width: Config.FABSize,\n height: Config.FABSize,\n });\n }\n\n if (type === \"extended\" || type === \"fixed\") {\n iconStyle.push({\n marginLeft: 16,\n marginRight: -8,\n });\n\n textStyle.margin = 16;\n }\n\n if (type === \"fixed\") {\n buttonStyles.push({\n height: Config.FABFixedHeight,\n alignSelf: \"stretch\",\n });\n }\n\n return (\n <Elevation style={[{ elevation }, style]}>\n <Touchable\n {...rest}\n onPress={onPress}\n accessibilityState={{ disabled }}\n accessibilityRole=\"button\"\n disabled={disabled || loading}\n style={buttonStyles}\n >\n <View style={styles.content}>\n {icon && loading !== true ? (\n <View style={iconStyle}>\n <Icon\n name={icon}\n size={Config.buttonIconSize}\n color={textColor}\n />\n </View>\n ) : null}\n {loading ? (\n <ActivityIndicator\n size=\"small\"\n color={textColor}\n style={iconStyle}\n />\n ) : null}\n {label ? (\n <Text numberOfLines={1} style={[textStyle, typography.button]}>\n {label}\n </Text>\n ) : null}\n </View>\n </Touchable>\n </Elevation>\n );\n};\n\nconst styles = StyleSheet.create({\n button: {\n borderStyle: \"solid\",\n },\n content: {\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n icon: {\n alignItems: \"center\",\n justifyContent: \"center\",\n width: Config.buttonIconSize,\n },\n fixed: {\n left: 0,\n right: 0,\n bottom: 0,\n height: 64,\n borderRadius: 0,\n },\n});\n\nexport default withTheme(FAB);\n"]}
|
|
1
|
+
{"version":3,"sources":["DeprecatedFAB.js"],"names":["FAB","Icon","icon","disabled","type","loading","color","colorOverride","label","onPress","elevation","style","theme","colors","disabledOpacity","roundness","typography","rest","backgroundColor","borderColor","textColor","borderWidth","buttonColor","primary","surface","alpha","rgb","string","StyleSheet","hairlineWidth","buttonStyle","borderRadius","alignItems","justifyContent","buttonStyles","styles","button","contentStyle","content","textStyle","textAlign","iconStyle","width","Config","buttonIconSize","FABSize","height","FABBorderRadius","push","marginLeft","marginRight","margin","FABFixedHeight","alignSelf","React","createElement","Elevation","Touchable","accessibilityState","accessibilityRole","View","name","size","ActivityIndicator","Text","numberOfLines","create","borderStyle","flexDirection","fixed","left","right","bottom"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AACA,MAAMA,GAAG,GAAG,QAAuM;AAAA,MAAtM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,IAAR;AAAcC,IAAAA,QAAQ,GAAG,KAAzB;AAAgCC,IAAAA,IAAI,GAAG,OAAvC;AAAgDC,IAAAA,OAAO,GAAG,KAA1D;AAAiEC,IAAAA,KAAK,EAAEC,aAAxE;AAAuFC,IAAAA,KAAvF;AAA8FC,IAAAA,OAA9F;AAAuGC,IAAAA,SAAS,GAAG,CAAnH;AAAsHC,IAAAA,KAAtH;AAA6HC,IAAAA,KAAK,EAAE;AAAEC,MAAAA,MAAF;AAAUC,MAAAA,eAAV;AAA2BC,MAAAA,SAA3B;AAAsCC,MAAAA;AAAtC,KAApI;AAAwL,OAAGC;AAA3L,GAAsM;AAC/M,MAAIC,eAAJ,EAAqBC,WAArB,EAAkCC,SAAlC,EAA6CC,WAA7C;AACA,QAAMC,WAAW,GAAGf,aAAa,IAAIM,MAAM,CAACU,OAA5C;;AACA,MAAInB,IAAI,KAAK,UAAT,IAAuBA,IAAI,KAAK,UAAhC,IAA8CA,IAAI,KAAK,OAA3D,EAAoE;AAChEc,IAAAA,eAAe,GAAGI,WAAlB;;AACA,QAAInB,QAAJ,EAAc;AACViB,MAAAA,SAAS,GAAG,oBAAMP,MAAM,CAACW,OAAb,EAAsBC,KAAtB,CAA4BX,eAA5B,EAA6CY,GAA7C,GAAmDC,MAAnD,EAAZ;AACH,KAFD,MAGK;AACDP,MAAAA,SAAS,GAAGP,MAAM,CAACW,OAAnB;AACH;AACJ,GARD,MASK;AACDN,IAAAA,eAAe,GAAG,aAAlB;;AACA,QAAIf,QA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;AAIH1B,IAAAA,MAAM,EAAE,EAJL;AAKHf,IAAAA,YAAY,EAAE;AALX;AAdsB,CAAlB,CAAf;;eAsBe,wBAAU/B,GAAV,C","sourcesContent":["import * as React from \"react\";\nimport { ActivityIndicator, View, StyleSheet, } from \"react-native\";\nimport color from \"color\";\nimport Config from \"./Config\";\nimport Text from \"./Text\";\nimport Touchable from \"./Touchable\";\nimport Elevation from \"./Elevation\";\nimport { withTheme } from \"../theming\";\nconst FAB = ({ Icon, icon, disabled = false, type = \"solid\", loading = false, color: colorOverride, label, onPress, elevation = 0, style, theme: { colors, disabledOpacity, roundness, typography }, ...rest }) => {\n let backgroundColor, borderColor, textColor, borderWidth;\n const buttonColor = colorOverride || colors.primary;\n if (type === \"standard\" || type === \"extended\" || type === \"fixed\") {\n backgroundColor = buttonColor;\n if (disabled) {\n textColor = color(colors.surface).alpha(disabledOpacity).rgb().string();\n }\n else {\n textColor = colors.surface;\n }\n }\n else {\n backgroundColor = \"transparent\";\n if (disabled) {\n textColor = color(buttonColor).alpha(disabledOpacity).rgb().string();\n }\n else {\n textColor = buttonColor;\n }\n }\n if (type === \"outline\") {\n if (disabled) {\n borderColor = color(buttonColor).alpha(disabledOpacity).rgb().string();\n }\n else {\n borderColor = buttonColor;\n }\n borderWidth = StyleSheet.hairlineWidth;\n }\n else {\n borderColor = \"transparent\";\n borderWidth = 0;\n }\n const buttonStyle = {\n backgroundColor,\n borderColor,\n borderWidth,\n borderRadius: roundness,\n alignItems: \"center\",\n justifyContent: \"center\",\n };\n const buttonStyles = [styles.button, buttonStyle];\n const contentStyle = [styles.content];\n const textStyle = {\n textAlign: \"center\",\n color: textColor,\n };\n const iconStyle = [\n styles.icon,\n {\n width: Config.buttonIconSize,\n },\n ];\n if (type === \"standard\" || type === \"outline\") {\n buttonStyle.width = Config.FABSize;\n buttonStyle.height = Config.FABSize;\n buttonStyle.borderRadius = Config.FABBorderRadius;\n contentStyle.push({\n width: Config.FABSize,\n height: Config.FABSize,\n });\n }\n if (type === \"extended\" || type === \"fixed\") {\n iconStyle.push({\n marginLeft: 16,\n marginRight: -8,\n });\n textStyle.margin = 16;\n }\n if (type === \"fixed\") {\n buttonStyles.push({\n height: Config.FABFixedHeight,\n alignSelf: \"stretch\",\n });\n }\n return (React.createElement(Elevation, { style: [{ elevation }, style] },\n React.createElement(Touchable, { ...rest, onPress: onPress, accessibilityState: { disabled }, accessibilityRole: \"button\", disabled: disabled || loading, style: buttonStyles },\n React.createElement(View, { style: styles.content },\n icon && loading !== true ? (React.createElement(View, { style: iconStyle },\n React.createElement(Icon, { name: icon, size: Config.buttonIconSize, color: textColor }))) : null,\n loading ? (React.createElement(ActivityIndicator, { size: \"small\", color: textColor, style: iconStyle })) : null,\n label ? (React.createElement(Text, { numberOfLines: 1, style: [textStyle, typography.button] }, label)) : null))));\n};\nconst styles = StyleSheet.create({\n button: {\n borderStyle: \"solid\",\n },\n content: {\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n icon: {\n alignItems: \"center\",\n justifyContent: \"center\",\n width: Config.buttonIconSize,\n },\n fixed: {\n left: 0,\n right: 0,\n bottom: 0,\n height: 64,\n borderRadius: 0,\n },\n});\nexport default withTheme(FAB);\n"]}
|
|
@@ -19,6 +19,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
19
19
|
|
|
20
20
|
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; }
|
|
21
21
|
|
|
22
|
+
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); }
|
|
23
|
+
|
|
22
24
|
/* directly copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx#L62 */
|
|
23
25
|
const Elevation = _ref => {
|
|
24
26
|
let {
|
|
@@ -35,24 +37,11 @@ const Elevation = _ref => {
|
|
|
35
37
|
colors
|
|
36
38
|
} = theme;
|
|
37
39
|
const borderRadius = radius;
|
|
38
|
-
return /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
|
|
40
|
+
return /*#__PURE__*/React.createElement(_reactNative.Animated.View, _extends({}, rest, {
|
|
39
41
|
style: [{
|
|
40
42
|
borderRadius,
|
|
41
43
|
backgroundColor: colors.surface
|
|
42
44
|
}, elevation ? (0, _shadow.default)(elevation) : null, style]
|
|
43
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
44
|
-
style: {
|
|
45
|
-
overflow: "hidden",
|
|
46
|
-
borderRadius
|
|
47
|
-
}
|
|
48
|
-
}, children));
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
var _default = (0, _theming.withTheme)(Elevation);
|
|
52
|
-
|
|
53
|
-
exports.default = _default;
|
|
54
|
-
//# sourceMappingURL=Elevation.js.mape
|
|
55
|
-
}, elevation ? (0, _shadow.default)(elevation) : null, style]
|
|
56
45
|
}), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
57
46
|
style: {
|
|
58
47
|
overflow: "hidden",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Elevation.
|
|
1
|
+
{"version":3,"sources":["Elevation.tsx"],"names":["Elevation","style","theme","children","rest","elevation","borderRadius","radius","StyleSheet","flatten","colors","backgroundColor","surface","overflow"],"mappings":";;;;;;;AAAA;;AACA;;AAQA;;AACA;;;;;;;;;;AAQA;AACA,MAAMA,SAA0B,GAAG,QAAyC;AAAA,MAAxC;AAAEC,IAAAA,KAAF;AAASC,IAAAA,KAAT;AAAgBC,IAAAA,QAAhB;AAA0B,OAAGC;AAA7B,GAAwC;AAC1E,QAAM;AAAEC,IAAAA,SAAS,GAAG,CAAd;AAAiBC,IAAAA,YAAY,EAAEC;AAA/B,MACJC,wBAAWC,OAAX,CAAmBR,KAAnB,KAA6B,EAD/B;AAEA,QAAM;AAAES,IAAAA;AAAF,MAAaR,KAAnB;AACA,QAAMI,YAAY,GAAGC,MAArB;AAEA,sBACE,oBAAC,qBAAD,CAAU,IAAV,eACMH,IADN;AAEE,IAAA,KAAK,EAAE,CACL;AACEE,MAAAA,YADF;AAEEK,MAAAA,eAAe,EAAED,MAAM,CAACE;AAF1B,KADK,EAKLP,SAAS,GAAG,qBAAOA,SAAP,CAAH,GAAuB,IAL3B,EAMLJ,KANK;AAFT,mBAWE,oBAAC,iBAAD;AAAM,IAAA,KAAK,EAAE;AAAEY,MAAAA,QAAQ,EAAE,QAAZ;AAAsBP,MAAAA;AAAtB;AAAb,KAAoDH,QAApD,CAXF,CADF;AAeD,CArBD;;eAuBe,wBAAUH,SAAV,C","sourcesContent":["import * as React from \"react\";\nimport {\n Animated,\n StyleSheet,\n ViewProps,\n StyleProp,\n ViewStyle,\n View,\n} from \"react-native\";\nimport shadow from \"../styles/shadow\";\nimport { withTheme } from \"../theming\";\nimport type { Theme } from \"../styles/DefaultTheme\";\n\ntype Props = {\n style?: StyleProp<ViewStyle>;\n theme: Theme;\n} & ViewProps;\n\n/* directly copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx#L62 */\nconst Elevation: React.FC<Props> = ({ style, theme, children, ...rest }) => {\n const { elevation = 4, borderRadius: radius } =\n StyleSheet.flatten(style) || {};\n const { colors } = theme;\n const borderRadius = radius;\n\n return (\n <Animated.View\n {...rest}\n style={[\n {\n borderRadius,\n backgroundColor: colors.surface,\n },\n elevation ? shadow(elevation) : null,\n style,\n ]}\n >\n <View style={{ overflow: \"hidden\", borderRadius }}>{children}</View>\n </Animated.View>\n );\n};\n\nexport default withTheme(Elevation);\n"]}
|
|
@@ -13,6 +13,8 @@ var _theming = require("../theming");
|
|
|
13
13
|
|
|
14
14
|
var _IconButton = _interopRequireDefault(require("./IconButton"));
|
|
15
15
|
|
|
16
|
+
var _lodash = _interopRequireDefault(require("lodash.isnumber"));
|
|
17
|
+
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
|
|
18
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -23,6 +25,8 @@ const Stepper = _ref => {
|
|
|
23
25
|
let {
|
|
24
26
|
Icon,
|
|
25
27
|
value,
|
|
28
|
+
min,
|
|
29
|
+
max,
|
|
26
30
|
style,
|
|
27
31
|
onChange,
|
|
28
32
|
defaultValue,
|
|
@@ -38,32 +42,37 @@ const Stepper = _ref => {
|
|
|
38
42
|
} = _ref;
|
|
39
43
|
const [stateValue, setStateValue] = React.useState(value || defaultValue || 0);
|
|
40
44
|
React.useEffect(() => {
|
|
41
|
-
if (value
|
|
42
|
-
|
|
45
|
+
if (value || value === 0) {
|
|
46
|
+
onChange && onChange(stateValue);
|
|
43
47
|
}
|
|
44
|
-
}, [value]);
|
|
48
|
+
}, [onChange, stateValue, value]);
|
|
45
49
|
React.useEffect(() => {
|
|
46
|
-
|
|
47
|
-
|
|
50
|
+
let newValue = value || defaultValue || 0;
|
|
51
|
+
|
|
52
|
+
if ((0, _lodash.default)(max) && newValue > max) {
|
|
53
|
+
newValue = max;
|
|
48
54
|
}
|
|
49
|
-
}, [defaultValue]);
|
|
50
55
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
onChange && onChange(value - 1);
|
|
54
|
-
} else {
|
|
55
|
-
setStateValue(stateValue - 1);
|
|
56
|
+
if ((0, _lodash.default)(min) && newValue < min) {
|
|
57
|
+
newValue = min;
|
|
56
58
|
}
|
|
57
|
-
};
|
|
58
59
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
setStateValue(newValue);
|
|
61
|
+
}, [defaultValue, value, min, max]);
|
|
62
|
+
const handleMinus = React.useCallback(() => {
|
|
63
|
+
if ((0, _lodash.default)(min) && value === min) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
setStateValue(stateValue - 1);
|
|
68
|
+
}, [min, stateValue, value]);
|
|
69
|
+
const handlePlus = React.useCallback(() => {
|
|
70
|
+
if ((0, _lodash.default)(max) && value === max) {
|
|
71
|
+
return;
|
|
64
72
|
}
|
|
65
|
-
};
|
|
66
73
|
|
|
74
|
+
setStateValue(stateValue + 1);
|
|
75
|
+
}, [max, stateValue, value]);
|
|
67
76
|
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
68
77
|
style: [{
|
|
69
78
|
flexDirection: "row"
|
|
@@ -76,7 +85,7 @@ const Stepper = _ref => {
|
|
|
76
85
|
onPress: handleMinus,
|
|
77
86
|
size: iconSize,
|
|
78
87
|
color: iconColor,
|
|
79
|
-
disabled:
|
|
88
|
+
disabled: stateValue === 0
|
|
80
89
|
}), /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
81
90
|
style: [typography.body1, {
|
|
82
91
|
textAlign: "center",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Stepper.tsx"],"names":["Stepper","Icon","value","style","onChange","defaultValue","theme","colors","typography","roundness","iconSize","iconColor","strong","borderRadius","typeStyle","stateValue","setStateValue","React","useState","useEffect","handleMinus","handlePlus","flexDirection","body1","textAlign","alignSelf","color","medium","marginHorizontal"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAIA;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["Stepper.tsx"],"names":["Stepper","Icon","value","min","max","style","onChange","defaultValue","theme","colors","typography","roundness","iconSize","iconColor","strong","borderRadius","typeStyle","stateValue","setStateValue","React","useState","useEffect","newValue","handleMinus","useCallback","handlePlus","flexDirection","body1","textAlign","alignSelf","color","medium","marginHorizontal"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAIA;;AACA;;;;;;;;AAgBA,MAAMA,OAAwB,GAAG,QAa3B;AAAA,MAb4B;AAChCC,IAAAA,IADgC;AAEhCC,IAAAA,KAFgC;AAGhCC,IAAAA,GAHgC;AAIhCC,IAAAA,GAJgC;AAKhCC,IAAAA,KALgC;AAMhCC,IAAAA,QANgC;AAOhCC,IAAAA,YAPgC;AAQhCC,IAAAA,KAAK,EAAE;AAAEC,MAAAA,MAAF;AAAUC,MAAAA,UAAV;AAAsBC,MAAAA;AAAtB,KARyB;AAShCC,IAAAA,QAAQ,GAAG,EATqB;AAUhCC,IAAAA,SAAS,GAAGJ,MAAM,CAACK,MAVa;AAWhCC,IAAAA,YAAY,GAAGJ,SAXiB;AAYhCK,IAAAA;AAZgC,GAa5B;AACJ,QAAM,CAACC,UAAD,EAAaC,aAAb,IAA8BC,KAAK,CAACC,QAAN,CAClClB,KAAK,IAAIK,YAAT,IAAyB,CADS,CAApC;AAIAY,EAAAA,KAAK,CAACE,SAAN,CAAgB,MAAM;AACpB,QAAInB,KAAK,IAAIA,KAAK,KAAK,CAAvB,EAA0B;AACxBI,MAAAA,QAAQ,IAAIA,QAAQ,CAACW,UAAD,CAApB;AACD;AACF,GAJD,EAIG,CAACX,QAAD,EAAWW,UAAX,EAAuBf,KAAvB,CAJH;AAMAiB,EAAAA,KAAK,CAACE,SAAN,CAAgB,MAAM;AACpB,QAAIC,QAAQ,GAAGpB,KAAK,IAAIK,YAAT,IAAyB,CAAxC;;AAC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F,eAeE,oBAAC,iBAAD;AACE,IAAA,KAAK,EAAE,CACLP,UAAU,CAACiB,KADN,EAEL;AACEC,MAAAA,SAAS,EAAE,QADb;AAEEC,MAAAA,SAAS,EAAE,QAFb;AAGEC,MAAAA,KAAK,EAAErB,MAAM,CAACsB,MAHhB;AAIEC,MAAAA,gBAAgB,EAAE;AAJpB,KAFK,EAQLhB,SARK;AADT,KAYGd,KAAK,IAAIe,UAZZ,CAfF,eA6BE,oBAAC,mBAAD;AACE,IAAA,IAAI,EAAEhB,IADR;AAEE,IAAA,IAAI,EAAC,mBAFP;AAGE,IAAA,OAAO,EAAEwB,UAHX;AAIE,IAAA,IAAI,EAAEb,QAJR;AAKE,IAAA,KAAK,EAAEC;AALT,IA7BF,CADF;AAuCD,CAxFD;;eA0Fe,wBAAUb,OAAV,C","sourcesContent":["import * as React from \"react\";\nimport { View, Text, StyleProp, ViewStyle, TextStyle } from \"react-native\";\nimport { withTheme } from \"../theming\";\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\n\nimport IconButton from \"./IconButton\";\nimport isNumber from \"lodash.isnumber\";\n\ntype Props = {\n value?: number;\n min?: number;\n max?: number;\n theme: Theme;\n style?: StyleProp<ViewStyle>;\n onChange?: (value: number) => void;\n defaultValue?: number;\n iconSize?: number;\n iconColor?: string;\n borderRadius?: number;\n typeStyle?: StyleProp<TextStyle>;\n} & IconSlot;\n\nconst Stepper: React.FC<Props> = ({\n Icon,\n value,\n min,\n max,\n style,\n onChange,\n defaultValue,\n theme: { colors, typography, roundness },\n iconSize = 24,\n iconColor = colors.strong,\n borderRadius = roundness,\n typeStyle,\n}) => {\n const [stateValue, setStateValue] = React.useState(\n value || defaultValue || 0\n );\n\n React.useEffect(() => {\n if (value || value === 0) {\n onChange && onChange(stateValue);\n }\n }, [onChange, stateValue, value]);\n\n React.useEffect(() => {\n let newValue = value || defaultValue || 0;\n if (isNumber(max) && newValue > max) {\n newValue = max;\n }\n if (isNumber(min) && newValue < min) {\n newValue = min;\n }\n setStateValue(newValue);\n }, [defaultValue, value, min, max]);\n\n const handleMinus = React.useCallback(() => {\n if (isNumber(min) && value === min) {\n return;\n }\n setStateValue(stateValue - 1);\n }, [min, stateValue, value]);\n\n const handlePlus = React.useCallback(() => {\n if (isNumber(max) && value === max) {\n return;\n }\n setStateValue(stateValue + 1);\n }, [max, stateValue, value]);\n\n return (\n <View\n style={[\n { flexDirection: \"row\" },\n style,\n borderRadius ? { borderRadius } : {},\n ]}\n >\n <IconButton\n Icon={Icon}\n icon=\"MaterialIcons/remove\"\n onPress={handleMinus}\n size={iconSize}\n color={iconColor}\n disabled={stateValue === 0}\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 || stateValue}\n </Text>\n <IconButton\n Icon={Icon}\n icon=\"MaterialIcons/add\"\n onPress={handlePlus}\n size={iconSize}\n color={iconColor}\n />\n </View>\n );\n};\n\nexport default withTheme(Stepper);\n"]}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _theming = require("../theming");
|
|
11
|
+
|
|
12
|
+
var _reactNative = require("react-native");
|
|
13
|
+
|
|
14
|
+
var _IconButton = _interopRequireDefault(require("./IconButton"));
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
+
|
|
20
|
+
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; }
|
|
21
|
+
|
|
22
|
+
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); }
|
|
23
|
+
|
|
24
|
+
const ToggleButton = _ref => {
|
|
25
|
+
let {
|
|
26
|
+
Icon,
|
|
27
|
+
icon,
|
|
28
|
+
toggled = false,
|
|
29
|
+
onPress = () => {},
|
|
30
|
+
defaultValue,
|
|
31
|
+
disabled = false,
|
|
32
|
+
color = "primary",
|
|
33
|
+
colorSecondary = "surface",
|
|
34
|
+
borderColor = "divider",
|
|
35
|
+
iconSize = 25,
|
|
36
|
+
width = 50,
|
|
37
|
+
height = 50,
|
|
38
|
+
theme: {
|
|
39
|
+
colors
|
|
40
|
+
},
|
|
41
|
+
style,
|
|
42
|
+
...rest
|
|
43
|
+
} = _ref;
|
|
44
|
+
const [internalValue, setInternalValue] = React.useState(toggled || defaultValue || false);
|
|
45
|
+
React.useEffect(() => {
|
|
46
|
+
if (toggled != null) {
|
|
47
|
+
setInternalValue(toggled);
|
|
48
|
+
}
|
|
49
|
+
}, [toggled]);
|
|
50
|
+
React.useEffect(() => {
|
|
51
|
+
if (defaultValue != null) {
|
|
52
|
+
setInternalValue(defaultValue);
|
|
53
|
+
}
|
|
54
|
+
}, [defaultValue]);
|
|
55
|
+
|
|
56
|
+
const handlePress = () => {
|
|
57
|
+
setInternalValue(!internalValue);
|
|
58
|
+
onPress(!internalValue);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
return /*#__PURE__*/React.createElement(_IconButton.default, _extends({
|
|
62
|
+
Icon: Icon,
|
|
63
|
+
icon: icon,
|
|
64
|
+
size: iconSize,
|
|
65
|
+
color: internalValue ? colors[color] : colors[colorSecondary],
|
|
66
|
+
onPress: handlePress,
|
|
67
|
+
disabled: disabled,
|
|
68
|
+
style: [styles.mainContainer, {
|
|
69
|
+
width,
|
|
70
|
+
height,
|
|
71
|
+
backgroundColor: internalValue ? colors[colorSecondary] : colors[color],
|
|
72
|
+
borderColor: colors[borderColor]
|
|
73
|
+
}, style]
|
|
74
|
+
}, rest));
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const styles = _reactNative.StyleSheet.create({
|
|
78
|
+
mainContainer: {
|
|
79
|
+
borderWidth: 1
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
var _default = (0, _theming.withTheme)(ToggleButton);
|
|
84
|
+
|
|
85
|
+
exports.default = _default;
|
|
86
|
+
//# sourceMappingURL=ToggleButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ToggleButton.tsx"],"names":["ToggleButton","Icon","icon","toggled","onPress","defaultValue","disabled","color","colorSecondary","borderColor","iconSize","width","height","theme","colors","style","rest","internalValue","setInternalValue","React","useState","useEffect","handlePress","styles","mainContainer","backgroundColor","StyleSheet","create","borderWidth"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;;;;;AAoBA,MAAMA,YAA6B,GAAG,QAgBhC;AAAA,MAhBiC;AACrCC,IAAAA,IADqC;AAErCC,IAAA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T,GAAmBO,MAAM,CAACN,cAAD,CAJ/C;AAKE,IAAA,OAAO,EAAEc,WALX;AAME,IAAA,QAAQ,EAAEhB,QANZ;AAOE,IAAA,KAAK,EAAE,CACLiB,MAAM,CAACC,aADF,EAEL;AACEb,MAAAA,KADF;AAEEC,MAAAA,MAFF;AAGEa,MAAAA,eAAe,EAAER,aAAa,GAC1BH,MAAM,CAACN,cAAD,CADoB,GAE1BM,MAAM,CAACP,KAAD,CALZ;AAMEE,MAAAA,WAAW,EAAEK,MAAM,CAACL,WAAD;AANrB,KAFK,EAULM,KAVK;AAPT,KAmBMC,IAnBN,EADF;AAuBD,CA7DD;;AA+DA,MAAMO,MAAM,GAAGG,wBAAWC,MAAX,CAAkB;AAC/BH,EAAAA,aAAa,EAAE;AACbI,IAAAA,WAAW,EAAE;AADA;AADgB,CAAlB,CAAf;;eAMe,wBAAU5B,YAAV,C","sourcesContent":["import * as React from \"react\";\nimport { withTheme } from \"../theming\";\nimport { colorTypes } from \"@draftbit/types\";\nimport { StyleProp, StyleSheet, ViewStyle } from \"react-native\";\nimport IconButton from \"./IconButton\";\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\n\ntype Props = {\n icon: string;\n toggled?: boolean;\n onPress?: (value: boolean) => void;\n defaultValue?: boolean;\n disabled?: boolean;\n color?: colorTypes;\n colorSecondary?: colorTypes;\n borderColor?: colorTypes;\n iconSize?: number;\n width?: number;\n height?: number;\n style?: StyleProp<ViewStyle>;\n theme: Theme;\n} & IconSlot;\n\nconst ToggleButton: React.FC<Props> = ({\n Icon,\n icon,\n toggled = false,\n onPress = () => {},\n defaultValue,\n disabled = false,\n color = \"primary\",\n colorSecondary = \"surface\",\n borderColor = \"divider\",\n iconSize = 25,\n width = 50,\n height = 50,\n theme: { colors },\n style,\n ...rest\n}) => {\n const [internalValue, setInternalValue] = React.useState<boolean>(\n toggled || defaultValue || false\n );\n\n React.useEffect(() => {\n if (toggled != null) {\n setInternalValue(toggled);\n }\n }, [toggled]);\n\n React.useEffect(() => {\n if (defaultValue != null) {\n setInternalValue(defaultValue);\n }\n }, [defaultValue]);\n\n const handlePress = () => {\n setInternalValue(!internalValue);\n onPress(!internalValue);\n };\n\n return (\n <IconButton\n Icon={Icon}\n icon={icon}\n size={iconSize}\n color={internalValue ? colors[color] : colors[colorSecondary]}\n onPress={handlePress}\n disabled={disabled}\n style={[\n styles.mainContainer,\n {\n width,\n height,\n backgroundColor: internalValue\n ? colors[colorSecondary]\n : colors[color],\n borderColor: colors[borderColor],\n },\n style,\n ]}\n {...rest}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n mainContainer: {\n borderWidth: 1,\n },\n});\n\nexport default withTheme(ToggleButton);\n"]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -369,6 +369,12 @@ Object.defineProperty(exports, "ThemeProvider", {
|
|
|
369
369
|
return _theming.ThemeProvider;
|
|
370
370
|
}
|
|
371
371
|
});
|
|
372
|
+
Object.defineProperty(exports, "ToggleButton", {
|
|
373
|
+
enumerable: true,
|
|
374
|
+
get: function () {
|
|
375
|
+
return _ToggleButton.default;
|
|
376
|
+
}
|
|
377
|
+
});
|
|
372
378
|
Object.defineProperty(exports, "Touchable", {
|
|
373
379
|
enumerable: true,
|
|
374
380
|
get: function () {
|
|
@@ -440,6 +446,8 @@ var _Switch = _interopRequireWildcard(require("./components/Switch"));
|
|
|
440
446
|
|
|
441
447
|
var _TextField = _interopRequireDefault(require("./components/TextField"));
|
|
442
448
|
|
|
449
|
+
var _ToggleButton = _interopRequireDefault(require("./components/ToggleButton"));
|
|
450
|
+
|
|
443
451
|
var _Touchable = _interopRequireDefault(require("./components/Touchable"));
|
|
444
452
|
|
|
445
453
|
var _Accordion = require("./components/Accordion");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAEA;;AASA;;AAQA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA","sourcesContent":["export { injectIcon } from \"./interfaces/Icon\";\nexport { withTheme, ThemeProvider } from \"./theming\";\nexport { default as Provider } from \"./Provider\";\nexport { default as DefaultTheme } from \"./styles/DefaultTheme\";\n\nexport { Link } from \"./components/Text\";\nexport { ButtonSolid, ButtonOutline } from \"./components/Button\";\nexport { default as Avatar } from \"./components/CircleImage\";\nexport { default as AvatarEdit } from \"./components/AvatarEdit\";\nexport { default as Card } from \"./components/Card\";\nexport { default as Carousel } from \"./components/Carousel\";\nexport { Checkbox, CheckboxGroup, CheckboxRow } from \"./components/Checkbox\";\nexport { default as CircleImage } from \"./components/CircleImage\";\nexport { default as Container } from \"./components/Container\";\nexport { default as Divider } from \"./components/Divider\";\nexport { default as FAB } from \"./components/FAB\";\nexport { default as FieldSearchBarFull } from \"./components/FieldSearchBarFull\";\nexport { default as IconButton } from \"./components/IconButton\";\nexport { default as Image } from \"./components/Image\";\nexport { default as NumberInput } from \"./components/NumberInput\";\nexport { default as ScreenContainer } from \"./components/ScreenContainer\";\nexport { default as StarRating } from \"./components/StarRating\";\nexport { default as Surface } from \"./components/Surface\";\nexport { default as Switch, SwitchRow } from \"./components/Switch\";\nexport { default as TextField } from \"./components/TextField\";\nexport { default as ToggleButton } from \"./components/ToggleButton\";\nexport { default as Touchable } from \"./components/Touchable\";\nexport { AccordionGroup, AccordionItem } from \"./components/Accordion\";\nexport {\n ActionSheet,\n ActionSheetItem,\n ActionSheetCancel,\n} from \"./components/ActionSheet\";\nexport { Swiper, SwiperItem } from \"./components/Swiper\";\n\nexport {\n Center,\n Circle,\n Square,\n Row,\n Stack,\n Spacer,\n} from \"./components/Layout\";\n\nexport {\n RadioButton,\n RadioButtonGroup,\n RadioButtonRow,\n RadioButtonFieldGroup,\n} from \"./components/RadioButton/index\";\n\n/* Deprecated: Fix or Delete! */\nexport { default as Button } from \"./components/DeprecatedButton\";\nexport { default as CardBlock } from \"./components/CardBlock\";\nexport { default as CardContainer } from \"./components/CardContainer\";\nexport { default as CardContainerRating } from \"./components/CardContainerRating\";\nexport { default as CardInline } from \"./components/CardInline\";\nexport { default as DatePicker } from \"./components/DatePicker/DatePicker\";\nexport { default as HeaderLarge } from \"./components/HeaderLarge\";\nexport { default as HeaderMedium } from \"./components/HeaderMedium\";\nexport { default as HeaderOverline } from \"./components/HeaderOverline\";\nexport { default as Picker } from \"./components/Picker/Picker\";\nexport { default as ProgressBar } from \"./components/ProgressBar\";\nexport { default as ProgressCircle } from \"./components/ProgressCircle\";\nexport { default as RowBodyIcon } from \"./components/RowBodyIcon\";\nexport { default as RowHeadlineImageCaption } from \"./components/RowHeadlineImageCaption\";\nexport { default as RowHeadlineImageIcon } from \"./components/RowHeadlineImageIcon\";\nexport { default as Slider } from \"./components/Slider\";\nexport { default as Stepper } from \"./components/Stepper\";\nexport { useAuthState } from \"./components/useAuthState\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ActionSheet.
|
|
1
|
+
{"version":3,"sources":["ActionSheet.ts"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","container","props","visible","group","GROUPS","data","label"],"mappings":";;;;;;;AAAA;;AAEO,MAAMA,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,cADiB;AAEvBC,EAAAA,GAAG,EAAE,aAFkB;AAGvBC,EAAAA,WAAW,EAAE,wBAHU;AAIvBC,EAAAA,QAAQ,EAAEC,uBAAgBC,SAJH;AAKvBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,OAAO,EAAE,iCAAqB;AAC5BC,MAAAA,KAAK,EAAEC,cAAOC,IADc;AAE5BC,MAAAA,KAAK,EAAE;AAFqB,KAArB;AADJ;AALgB,CAAlB","sourcesContent":["import { COMPONENT_TYPES, createStaticBoolProp, GROUPS } from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Action Sheet\",\n tag: \"ActionSheet\",\n description: \"Action Sheet container\",\n category: COMPONENT_TYPES.container,\n props: {\n visible: createStaticBoolProp({\n group: GROUPS.data,\n label: \"Show Action Sheet\",\n }),\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["RadioButtonRow.
|
|
1
|
+
{"version":3,"sources":["RadioButtonRow.js"],"names":["SEED_DATA","name","tag","category","COMPONENT_TYPES","input","layout","props","label","description","required","defaultValue","direction","options","value","color","group","GROUPS","basic","unselectedColor"],"mappings":";;;;;;;AAAA;;AACO,MAAMA,SAAS,GAAG;AACrBC,EAAAA,IAAI,EAAE,kBADe;AAErBC,EAAAA,GAAG,EAAE,gBAFgB;AAGrBC,EAAAA,QAAQ,EAAEC,uBAAgBC,KAHL;AAIrBC,EAAAA,MAAM,EAAE,EAJa;AAKrBC,EAAAA,KAAK,EAAE;AACHC,IAAAA,KAAK,EAAE,2BAAe;AAClBA,MAAAA,KAAK,EAAE,OADW;AAElBC,MAAAA,WAAW,EAAE,qCAFK;AAGlBC,MAAAA,QAAQ,EAAE,IAHQ;AAIlBC,MAAAA,YAAY,EAAE;AAJI,KAAf,CADJ;AAOHC,IAAAA,SAAS,EAAE,+BAAmB;AAC1BJ,MAAAA,KAAK,EAAE,WADmB;AAE1BC,MAAAA,WAAW,EAAE,8DAFa;AAG1BI,MAAAA,OAAO,EAAE,CAAC,KAAD,EAAQ,aAAR;AAHiB,KAAnB,CAPR;AAYHC,IAAAA,KAAK,EAAE,2BAAe;AAClBN,MAAAA,KAAK,EAAE,OADW;AAElBC,MAAAA,WAAW,EAAE,2BAFK;AAGlBE,MAAAA,YAAY,EAAE,IAHI;AAIlBD,MAAAA,QAAQ,EAAE;AAJQ,KAAf,CAZJ;AAkBHK,IAAAA,KAAK,EAAE,4BAAgB;AACnBC,MAAAA,KAAK,EAAEC,cAAOC,KADK;AAEnBT,MAAAA,WAAW,EAAE,sBAFM;AAGnBE,MAAAA,YAAY,EAAE;AAHK,KAAhB,CAlBJ;AAuBHQ,IAAAA,eAAe,EAAE,4BAAgB;AAC7BH,MAAAA,KAAK,EAAEC,cAAOC,KADe;AAE7BV,MAAAA,KAAK,EAAE,kBAFsB;AAG7BC,MAAAA,WAAW,EAAE,iCAHgB;AAI7BE,MAAAA,YAAY,EAAE;AAJe,KAAhB;AAvBd;AALc,CAAlB","sourcesContent":["import { createTextProp, createTextEnumProp, COMPONENT_TYPES, createColorProp, GROUPS, } from \"@draftbit/types\";\nexport const SEED_DATA = {\n name: \"Radio Button Row\",\n tag: \"RadioButtonRow\",\n category: COMPONENT_TYPES.input,\n layout: {},\n props: {\n label: createTextProp({\n label: \"Label\",\n description: \"Label to show with the radio button\",\n required: true,\n defaultValue: \"First Option\",\n }),\n direction: createTextEnumProp({\n label: \"Direction\",\n description: \"Whether the checkbox will appear on the left or on the right\",\n options: [\"row\", \"row-reverse\"],\n }),\n value: createTextProp({\n label: \"Value\",\n description: \"Value of the radio button\",\n defaultValue: null,\n required: true,\n }),\n color: createColorProp({\n group: GROUPS.basic,\n description: \"Color for the button\",\n defaultValue: \"primary\",\n }),\n unselectedColor: createColorProp({\n group: GROUPS.basic,\n label: \"Unselected Color\",\n description: \"Unselected Color for the button\",\n defaultValue: \"primary\",\n }),\n },\n};\n"]}
|
|
@@ -25,6 +25,15 @@ const SEED_DATA = [{
|
|
|
25
25
|
}),
|
|
26
26
|
iconColor: (0, _types.createColorProp)({
|
|
27
27
|
defaultValue: "strong"
|
|
28
|
+
}),
|
|
29
|
+
min: (0, _types.createStaticNumberProp)({
|
|
30
|
+
label: "Minimum",
|
|
31
|
+
description: "Minimum Number",
|
|
32
|
+
defaultValue: 0
|
|
33
|
+
}),
|
|
34
|
+
max: (0, _types.createStaticNumberProp)({
|
|
35
|
+
label: "Maximum",
|
|
36
|
+
description: "Maximum Number"
|
|
28
37
|
})
|
|
29
38
|
}
|
|
30
39
|
}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Stepper.ts"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","input","layout","triggers","Triggers","OnChange","props","fieldName","defaultValue","handlerPropName","valuePropName","iconSize","iconColor"],"mappings":";;;;;;;AAAA;;
|
|
1
|
+
{"version":3,"sources":["Stepper.ts"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","input","layout","triggers","Triggers","OnChange","props","fieldName","defaultValue","handlerPropName","valuePropName","iconSize","iconColor","min","label","max"],"mappings":";;;;;;;AAAA;;AASO,MAAMA,SAAS,GAAG,CACvB;AACEC,EAAAA,IAAI,EAAE,SADR;AAEEC,EAAAA,GAAG,EAAE,SAFP;AAGEC,EAAAA,WAAW,EAAE,uDAHf;AAIEC,EAAAA,QAAQ,EAAEC,uBAAgBC,KAJ5B;AAKEC,EAAAA,MAAM,EAAE,EALV;AAMEC,EAAAA,QAAQ,EAAE,CAACC,gBAASC,QAAV,CANZ;AAOEC,EAAAA,KAAK,EAAE;AACLC,IAAAA,SAAS,EAAE,gCAAoB;AAC7BC,MAAAA,YAAY,EAAE,cADe;AAE7BC,MAAAA,eAAe,EAAE,UAFY;AAG7BC,MAAAA,aAAa,EAAE;AAHc,KAApB,CADN;AAMLC,IAAAA,QAAQ,EAAE,+BAAmB;AAAEH,MAAAA,YAAY,EAAE;AAAhB,KAAnB,CANL;AAOLI,IAAAA,SAAS,EAAE,4BAAgB;AAAEJ,MAAAA,YAAY,EAAE;AAAhB,KAAhB,CAPN;AAQLK,IAAAA,GAAG,EAAE,mCAAuB;AAC1BC,MAAAA,KAAK,EAAE,SADmB;AAE1BhB,MAAAA,WAAW,EAAE,gBAFa;AAG1BU,MAAAA,YAAY,EAAE;AAHY,KAAvB,CARA;AAaLO,IAAAA,GAAG,EAAE,mCAAuB;AAC1BD,MAAAA,KAAK,EAAE,SADmB;AAE1BhB,MAAAA,WAAW,EAAE;AAFa,KAAvB;AAbA;AAPT,CADuB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createIconSizeProp,\n createColorProp,\n createFieldNameProp,\n createStaticNumberProp,\n Triggers,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = [\n {\n name: \"Stepper\",\n tag: \"Stepper\",\n description: \"A component used to control the quantity of something\",\n category: COMPONENT_TYPES.input,\n layout: {},\n triggers: [Triggers.OnChange],\n props: {\n fieldName: createFieldNameProp({\n defaultValue: \"stepperValue\",\n handlerPropName: \"onChange\",\n valuePropName: \"value\",\n }),\n iconSize: createIconSizeProp({ defaultValue: 24 }),\n iconColor: createColorProp({ defaultValue: \"strong\" }),\n min: createStaticNumberProp({\n label: \"Minimum\",\n description: \"Minimum Number\",\n defaultValue: 0,\n }),\n max: createStaticNumberProp({\n label: \"Maximum\",\n description: \"Maximum Number\",\n }),\n },\n },\n];\n"]}
|
|
@@ -13,7 +13,16 @@ const SEED_DATA = {
|
|
|
13
13
|
description: "An input field that allows for multiple lines.",
|
|
14
14
|
category: _types.COMPONENT_TYPES.input,
|
|
15
15
|
layout: {
|
|
16
|
-
|
|
16
|
+
borderLeftWidth: 1,
|
|
17
|
+
borderRightWidth: 1,
|
|
18
|
+
borderTopWidth: 1,
|
|
19
|
+
borderBottomWidth: 1,
|
|
20
|
+
borderColor: "divider",
|
|
21
|
+
paddingLeft: 8,
|
|
22
|
+
paddingRight: 8,
|
|
23
|
+
paddingTop: 8,
|
|
24
|
+
paddingBottom: 8,
|
|
25
|
+
borderRadius: 8
|
|
17
26
|
},
|
|
18
27
|
triggers: [_types.Triggers.OnChangeText],
|
|
19
28
|
props: { ..._types.TEXT_INPUT_PROPS,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["TextArea.ts"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","input","layout","
|
|
1
|
+
{"version":3,"sources":["TextArea.ts"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","input","layout","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","borderColor","paddingLeft","paddingRight","paddingTop","paddingBottom","borderRadius","triggers","Triggers","OnChangeText","props","TEXT_INPUT_PROPS","placeholder","defaultValue","multiline","label","group","GROUPS","uncategorized","formType","FORM_TYPES","boolean","propType","PROP_TYPES","BOOLEAN","editable","required","numberOfLines","basic","number","NUMBER","fieldName","FIELD_NAME","handlerPropName"],"mappings":";;;;;;;AAAA;;AAUO,MAAMA,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,WADiB;AAEvBC,EAAAA,GAAG,EAAE,WAFkB;AAGvBC,EAAAA,WAAW,EAAE,gDAHU;AAIvBC,EAAAA,QAAQ,EAAEC,uBAAgBC,KAJH;AAKvBC,EAAAA,MAAM,EAAE;AACNC,IAAAA,eAAe,EAAE,CADX;AAENC,IAAAA,gBAAgB,EAAE,CAFZ;AAGNC,IAAAA,cAAc,EAAE,CAHV;AAINC,IAAAA,iBAAiB,EAAE,CAJb;AAKNC,IAAAA,WAAW,EAAE,SALP;AAMNC,IAA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ers,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Text Area\",\n tag: \"TextInput\",\n description: \"An input field that allows for multiple lines.\",\n category: COMPONENT_TYPES.input,\n layout: {\n borderLeftWidth: 1,\n borderRightWidth: 1,\n borderTopWidth: 1,\n borderBottomWidth: 1,\n borderColor: \"divider\",\n paddingLeft: 8,\n paddingRight: 8,\n paddingTop: 8,\n paddingBottom: 8,\n borderRadius: 8,\n },\n triggers: [Triggers.OnChangeText],\n props: {\n ...TEXT_INPUT_PROPS,\n placeholder: {\n ...TEXT_INPUT_PROPS.placeholder,\n defaultValue:\n \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.\",\n },\n multiline: {\n label: \"Multiline\",\n description: \"Multiline\",\n group: GROUPS.uncategorized,\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n defaultValue: true,\n editable: true,\n required: false,\n },\n numberOfLines: {\n label: \"Number Of Lines\",\n description: \"Number Of Lines\",\n group: GROUPS.basic,\n formType: FORM_TYPES.number,\n propType: PROP_TYPES.NUMBER,\n defaultValue: 4,\n editable: true,\n required: false,\n },\n fieldName: {\n ...FIELD_NAME,\n defaultValue: \"textInputValue\",\n handlerPropName: \"onChangeText\",\n },\n },\n};\n"]}
|