@draftbit/core 46.1.4-e6469c.0 → 46.2.1-435444.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/ActionSheet/index.js.map +1 -1
- package/lib/commonjs/components/CardContainer.js +16 -5
- package/lib/commonjs/components/CardContainer.js.map +1 -1
- package/lib/commonjs/components/Carousel.js +3 -1
- package/lib/commonjs/components/Carousel.js.map +1 -1
- package/lib/commonjs/components/Config.js +3 -3
- package/lib/commonjs/components/Config.js.map +1 -1
- package/lib/commonjs/components/DatePicker/DatePicker.js +3 -3
- package/lib/commonjs/components/DatePicker/DatePicker.js.map +1 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponentType.js.map +1 -1
- package/lib/commonjs/components/DeprecatedCardWrapper.js +2 -14
- package/lib/commonjs/components/DeprecatedCardWrapper.js.map +1 -1
- package/lib/commonjs/components/Picker/Picker.js +4 -5
- package/lib/commonjs/components/Picker/Picker.js.map +1 -1
- package/lib/commonjs/components/Picker/PickerComponent.android.js +135 -0
- package/lib/commonjs/components/Picker/PickerComponent.android.js.map +1 -0
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +161 -0
- package/lib/commonjs/components/Picker/PickerComponent.ios.js.map +1 -0
- package/lib/commonjs/components/Picker/PickerComponent.web.js +136 -0
- package/lib/commonjs/components/Picker/PickerComponent.web.js.map +1 -0
- package/lib/commonjs/components/Picker/PickerTypes.js +6 -0
- package/lib/commonjs/components/Picker/PickerTypes.js.map +1 -0
- package/lib/commonjs/components/RadioButton/RadioButton.js +1 -1
- package/lib/commonjs/components/RadioButton/RadioButton.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js.map +1 -1
- package/lib/commonjs/components/StepIndicator.js +1 -1
- package/lib/commonjs/components/StepIndicator.js.map +1 -1
- package/lib/commonjs/components/Stepper.js +1 -1
- package/lib/commonjs/components/Stepper.js.map +1 -1
- package/lib/commonjs/mappings/NumberInput.js +241 -0
- package/lib/commonjs/mappings/NumberInput.js.map +1 -0
- package/lib/commonjs/mappings/RadioButton.js.map +1 -1
- package/lib/commonjs/mappings/RadioButtonGroup.js.map +1 -1
- package/lib/commonjs/mappings/RadioButtonRow.js.map +1 -1
- package/lib/commonjs/mappings/Text.js +33 -26
- package/lib/commonjs/mappings/Text.js.map +1 -1
- package/lib/commonjs/mappings/TextArea.js +181 -2
- package/lib/commonjs/mappings/TextArea.js.map +1 -1
- package/lib/commonjs/mappings/TextField.js +191 -2
- package/lib/commonjs/mappings/TextField.js.map +1 -1
- package/lib/commonjs/mappings/TextInput.js +180 -29
- package/lib/commonjs/mappings/TextInput.js.map +1 -1
- package/lib/commonjs/utilities.js +1 -1
- package/lib/commonjs/utilities.js.map +1 -1
- package/lib/module/components/Carousel.js +3 -1
- package/lib/module/components/Carousel.js.map +1 -1
- package/lib/module/components/Config.js +3 -3
- package/lib/module/components/Config.js.map +1 -1
- package/lib/module/components/Container.js +17 -5
- package/lib/module/components/Container.js.map +1 -1
- package/lib/module/components/DatePicker/DatePicker.js +3 -3
- package/lib/module/components/DatePicker/DatePicker.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/components/Picker/Picker.js +4 -5
- package/lib/module/components/Picker/Picker.js.map +1 -1
- package/lib/module/components/Picker/PickerComponent.android.js +112 -0
- package/lib/module/components/Picker/PickerComponent.android.js.map +1 -0
- package/lib/module/components/Picker/PickerComponent.ios.js +135 -0
- package/lib/module/components/Picker/PickerComponent.ios.js.map +1 -0
- package/lib/module/components/Picker/PickerComponent.web.js +113 -0
- package/lib/module/components/Picker/PickerComponent.web.js.map +1 -0
- package/lib/module/components/Picker/PickerTypes.js +2 -0
- package/lib/module/components/Picker/PickerTypes.js.map +1 -0
- package/lib/module/components/RadioButton/RadioButton.js +1 -1
- package/lib/module/components/RadioButton/RadioButton.js.map +1 -1
- package/lib/module/components/RadioButton/RadioButtonRow.js +1 -1
- package/lib/module/components/RadioButton/RadioButtonRow.js.map +1 -1
- package/lib/module/components/StepIndicator.js +1 -1
- package/lib/module/components/StepIndicator.js.map +1 -1
- package/lib/module/components/Stepper.js +1 -1
- package/lib/module/components/Stepper.js.map +1 -1
- package/lib/module/components/Touchable.js +2 -16
- package/lib/module/components/Touchable.js.map +1 -1
- package/lib/module/mappings/NumberInput.js +231 -0
- package/lib/module/mappings/NumberInput.js.map +1 -0
- package/lib/module/mappings/Text.js +33 -26
- package/lib/module/mappings/Text.js.map +1 -1
- package/lib/module/mappings/TextArea.js +182 -3
- package/lib/module/mappings/TextArea.js.map +1 -1
- package/lib/module/mappings/TextField.js +192 -3
- package/lib/module/mappings/TextField.js.map +1 -1
- package/lib/module/mappings/TextInput.js +180 -29
- package/lib/module/mappings/TextInput.js.map +1 -1
- package/lib/module/utilities.js +1 -1
- package/lib/module/utilities.js.map +1 -1
- package/lib/typescript/src/components/Picker/PickerComponent.android.d.ts +6 -0
- package/lib/typescript/src/components/Picker/PickerComponent.ios.d.ts +7 -0
- package/lib/typescript/src/components/Picker/PickerComponent.web.d.ts +6 -0
- package/lib/typescript/src/components/Picker/PickerTypes.d.ts +18 -0
- package/lib/typescript/src/mappings/NumberInput.d.ts +297 -0
- package/lib/typescript/src/mappings/Text.d.ts +24 -10
- package/lib/typescript/src/mappings/TextArea.d.ts +1 -11
- package/lib/typescript/src/mappings/TextField.d.ts +4 -4
- package/lib/typescript/src/mappings/TextInput.d.ts +3 -254
- package/package.json +3 -3
- package/src/components/ActionSheet/ActionSheet.js +1 -1
- package/src/components/Carousel.js +4 -2
- package/src/components/Checkbox/Checkbox.js +3 -3
- package/src/components/Checkbox/CheckboxGroupRow.js +2 -2
- package/src/components/Checkbox/CheckboxRow.js +3 -3
- package/src/components/CircularProgress.js +29 -26
- package/src/components/DatePicker/DatePicker.js +1 -1
- package/src/components/NumberInput.js +1 -1
- package/src/components/Picker/Picker.js +8 -8
- package/src/components/Picker/Picker.tsx +8 -6
- package/src/components/Picker/PickerComponent.android.js +69 -0
- package/src/components/Picker/PickerComponent.android.tsx +116 -0
- package/src/components/Picker/PickerComponent.ios.js +79 -0
- package/src/components/Picker/PickerComponent.ios.tsx +142 -0
- package/src/components/Picker/PickerComponent.web.js +70 -0
- package/src/components/Picker/PickerComponent.web.tsx +117 -0
- package/src/components/Picker/PickerTypes.js +1 -0
- package/src/components/Picker/PickerTypes.ts +18 -0
- package/src/components/Portal/Portal.js +2 -2
- package/src/components/Portal/PortalConsumer.js +0 -1
- package/src/components/Portal/PortalHost.js +43 -41
- package/src/components/Portal/PortalManager.js +21 -18
- package/src/components/ProgressBar.js +9 -9
- package/src/components/RadioButton/RadioButton.js +3 -3
- package/src/components/RadioButton/RadioButtonGroup.js +1 -1
- package/src/components/RadioButton/RadioButtonRow.js +3 -3
- package/src/components/StepIndicator.js +225 -225
- package/src/components/Stepper.js +2 -2
- package/src/components/Text.js +0 -1
- package/src/components/TextField.js +62 -59
- package/src/constants.js +1 -1
- package/src/mappings/NumberInput.js +248 -0
- package/src/mappings/NumberInput.ts +267 -0
- package/src/mappings/Text.js +33 -26
- package/src/mappings/Text.ts +34 -27
- package/src/mappings/TextArea.js +210 -3
- package/src/mappings/TextArea.ts +216 -3
- package/src/mappings/TextField.js +220 -3
- package/src/mappings/TextField.ts +227 -3
- package/src/mappings/TextInput.js +208 -31
- package/src/mappings/TextInput.ts +214 -34
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Component","View","Text","StyleSheet","Animated","TouchableWithoutFeedback","STEP_STATUS","CURRENT","FINISHED","UNFINISHED","StepIndicator","constructor","props","stepCount","direction","progressBarBackgroundStyle","backgroundColor","state","customStyles","separatorUnFinishedColor","position","left","width","separatorStrokeWidth","top","height","bottom","separatorStrokeUnfinishedWidth","right","event","setState","progressBarSize","nativeEvent","layout","onCurrentPositionChanged","currentPosition","progressBarStyle","separatorFinishedColor","separatorStrokeFinishedWidth","progressAnim","steps","push","stepPressed","styles","stepContainer","flexDirection","renderStep","stepIndicatorContainer","currentStepIndicatorSize","labels","renderLabel","labelViews","map","label","index","selectedStepLabelStyle","color","currentStepLabelColor","labelColor","stepLabelItem","stepStatus","getStepStatus","stepLabel","fontSize","labelSize","fontFamily","labelFontFamily","stepLabelsContainer","paddingHorizontal","paddingVertical","alignItems","labelAlign","renderStepIndicator","stepStyle","indicatorLabelStyle","stepIndicatorCurrentColor","borderWidth","currentStepStrokeWidth","borderColor","stepStrokeCurrentColor","sizeAnim","borderRadius","borderRadiusAnim","currentStepIndicatorLabelFontSize","stepIndicatorLabelCurrentColor","stepIndicatorFinishedColor","stepStrokeWidth","stepStrokeFinishedColor","stepIndicatorSize","stepIndicatorLabelFontSize","stepIndicatorLabelFinishedColor","stepIndicatorUnFinishedColor","stepStrokeUnFinishedColor","overflow","stepIndicatorLabelUnFinishedColor","step","stepPosition","animateToPosition","setValue","sequence","timing","toValue","duration","parallel","start","defaultStyles","Object","assign","Value","onPress","render","container","flex","renderProgressBarBackground","renderProgressBar","renderStepLabels","componentDidUpdate","prevProps","create","justifyContent","zIndex","textAlign","fontWeight","defaultProps"],"sources":["StepIndicator.tsx"],"sourcesContent":["// @ts-nocheck\nimport React, { Component } from \"react\";\nimport {\n View,\n Text,\n StyleSheet,\n Animated,\n TouchableWithoutFeedback,\n} from \"react-native\";\n\nconst STEP_STATUS = {\n CURRENT: \"current\",\n FINISHED: \"finished\",\n UNFINISHED: \"unfinished\",\n};\n\ninterface CustomStyles {\n stepIndicatorSize?: number;\n currentStepIndicatorSize?: number;\n separatorStrokeWidth?: number;\n separatorStrokeUnfinishedWidth?: number;\n separatorStrokeFinishedWidth?: number;\n currentStepStrokeWidth: number;\n stepStrokeWidth?: number;\n stepStrokeCurrentColor?: string;\n stepStrokeFinishedColor: string;\n stepStrokeUnFinishedColor: string;\n separatorFinishedColor: string;\n separatorUnFinishedColor: string;\n stepIndicatorFinishedColor: string;\n stepIndicatorUnFinishedColor: string;\n stepIndicatorCurrentColor: string;\n stepIndicatorLabelFontSize: number;\n currentStepIndicatorLabelFontSize?: number;\n stepIndicatorLabelCurrentColor: string;\n stepIndicatorLabelFinishedColor: string;\n stepIndicatorLabelUnFinishedColor: string;\n labelColor?: string;\n labelSize?: number;\n labelAlign?: string;\n currentStepLabelColor?: string;\n labelFontFamily?: string;\n}\n\ntype Props = {\n stepCount: number;\n currentPosition: number;\n customStyles: CustomStyles;\n};\n\ntype State = {\n width: number;\n height: number;\n progressBarSize: number;\n customStyles: CustomStyles;\n};\n\nexport default class StepIndicator extends Component<Props, State> {\n constructor(props: Props) {\n super(props);\n\n const defaultStyles = {\n stepIndicatorSize: 30,\n currentStepIndicatorSize: 40,\n separatorStrokeWidth: 3,\n separatorStrokeUnfinishedWidth: 0,\n separatorStrokeFinishedWidth: 0,\n currentStepStrokeWidth: 5,\n stepStrokeWidth: 0,\n stepStrokeCurrentColor: \"#4aae4f\",\n stepStrokeFinishedColor: \"#4aae4f\",\n stepStrokeUnFinishedColor: \"#4aae4f\",\n separatorFinishedColor: \"#4aae4f\",\n separatorUnFinishedColor: \"#a4d4a5\",\n stepIndicatorFinishedColor: \"#4aae4f\",\n stepIndicatorUnFinishedColor: \"#a4d4a5\",\n stepIndicatorCurrentColor: \"#ffffff\",\n stepIndicatorLabelFontSize: 15,\n currentStepIndicatorLabelFontSize: 15,\n stepIndicatorLabelCurrentColor: \"#000000\",\n stepIndicatorLabelFinishedColor: \"#ffffff\",\n stepIndicatorLabelUnFinishedColor: \"rgba(255,255,255,0.5)\",\n labelColor: \"#000000\",\n labelSize: 13,\n labelAlign: \"center\",\n currentStepLabelColor: \"#4aae4f\",\n };\n\n const customStyles = Object.assign(defaultStyles, props.customStyles);\n\n this.state = {\n width: 0,\n height: 1,\n progressBarSize: -2,\n customStyles,\n };\n\n this.progressAnim = new Animated.Value(0);\n this.sizeAnim = new Animated.Value(\n this.state.customStyles.stepIndicatorSize\n );\n this.borderRadiusAnim = new Animated.Value(\n this.state.customStyles.stepIndicatorSize / 2\n );\n }\n\n stepPressed(position) {\n if (this.props.onPress) {\n this.props.onPress(position);\n }\n }\n\n render() {\n const { labels, direction } = this.props;\n return (\n <View\n style={[\n styles.container,\n direction === \"vertical\"\n ? { flexDirection: \"row\", flex: 1 }\n : { flexDirection: \"column\" },\n ]}\n >\n {this.state.width !== 0 && this.renderProgressBarBackground()}\n {this.state.width !== 0 && this.renderProgressBar()}\n {this.renderStepIndicator()}\n {labels && this.renderStepLabels()}\n </View>\n );\n }\n\n componentDidUpdate(prevProps) {\n // if (prevProps.customStyles !== this.props.customStyles) {\n // this.setState((state) => ({\n // customStyles: Object.assign(\n // state.customStyles,\n // this.props.customStyles\n // ),\n // }));\n // }\n\n if (prevProps.currentPosition !== this.props.currentPosition) {\n this.onCurrentPositionChanged(this.props.currentPosition);\n }\n }\n\n renderProgressBarBackground = () => {\n const { stepCount, direction } = this.props;\n let progressBarBackgroundStyle;\n if (direction === \"vertical\") {\n progressBarBackgroundStyle = {\n backgroundColor: this.state.customStyles.separatorUnFinishedColor,\n position: \"absolute\",\n left:\n (this.state.width - this.state.customStyles.separatorStrokeWidth) / 2,\n top: this.state.height / (2 * stepCount),\n bottom: this.state.height / (2 * stepCount),\n width:\n this.state.customStyles.separatorStrokeUnfinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeUnfinishedWidth,\n };\n } else {\n progressBarBackgroundStyle = {\n backgroundColor: this.state.customStyles.separatorUnFinishedColor,\n position: \"absolute\",\n top:\n (this.state.height - this.state.customStyles.separatorStrokeWidth) /\n 2,\n left: this.state.width / (2 * stepCount),\n right: this.state.width / (2 * stepCount),\n height:\n this.state.customStyles.separatorStrokeUnfinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeUnfinishedWidth,\n };\n }\n return (\n <View\n onLayout={(event) => {\n if (direction === \"vertical\") {\n this.setState(\n { progressBarSize: event.nativeEvent.layout.height },\n () => {\n this.onCurrentPositionChanged(this.props.currentPosition);\n }\n );\n } else {\n this.setState(\n { progressBarSize: event.nativeEvent.layout.width },\n () => {\n this.onCurrentPositionChanged(this.props.currentPosition);\n }\n );\n }\n }}\n style={progressBarBackgroundStyle}\n />\n );\n };\n\n renderProgressBar = () => {\n const { stepCount, direction } = this.props;\n let progressBarStyle;\n if (direction === \"vertical\") {\n progressBarStyle = {\n backgroundColor: this.state.customStyles.separatorFinishedColor,\n position: \"absolute\",\n left:\n (this.state.width - this.state.customStyles.separatorStrokeWidth) / 2,\n top: this.state.height / (2 * stepCount),\n bottom: this.state.height / (2 * stepCount),\n width:\n this.state.customStyles.separatorStrokeFinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeFinishedWidth,\n height: this.progressAnim,\n };\n } else {\n progressBarStyle = {\n backgroundColor: this.state.customStyles.separatorFinishedColor,\n position: \"absolute\",\n top:\n (this.state.height - this.state.customStyles.separatorStrokeWidth) /\n 2,\n left: this.state.width / (2 * stepCount),\n right: this.state.width / (2 * stepCount),\n height:\n this.state.customStyles.separatorStrokeFinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeFinishedWidth,\n width: this.progressAnim,\n };\n }\n return <Animated.View style={progressBarStyle} />;\n };\n\n renderStepIndicator = () => {\n let steps = [];\n const { stepCount, direction } = this.props;\n for (let position = 0; position < stepCount; position++) {\n steps.push(\n <TouchableWithoutFeedback\n key={position}\n onPress={() => this.stepPressed(position)}\n >\n <View\n style={[\n styles.stepContainer,\n direction === \"vertical\"\n ? { flexDirection: \"column\" }\n : { flexDirection: \"row\" },\n ]}\n >\n {this.renderStep(position)}\n </View>\n </TouchableWithoutFeedback>\n );\n }\n return (\n <View\n onLayout={(event) =>\n this.setState({\n width: event.nativeEvent.layout.width,\n height: event.nativeEvent.layout.height,\n })\n }\n style={[\n styles.stepIndicatorContainer,\n direction === \"vertical\"\n ? {\n flexDirection: \"column\",\n width: this.state.customStyles.currentStepIndicatorSize,\n }\n : {\n flexDirection: \"row\",\n height: this.state.customStyles.currentStepIndicatorSize,\n },\n ]}\n >\n {steps}\n </View>\n );\n };\n\n renderStepLabels = () => {\n const { labels, direction, currentPosition, renderLabel } = this.props;\n var labelViews = labels.map((label, index) => {\n const selectedStepLabelStyle =\n index === currentPosition\n ? { color: this.state.customStyles.currentStepLabelColor }\n : { color: this.state.customStyles.labelColor };\n return (\n <TouchableWithoutFeedback\n style={styles.stepLabelItem}\n key={index}\n onPress={() => this.stepPressed(index)}\n >\n <View style={styles.stepLabelItem}>\n {renderLabel ? (\n renderLabel({\n position: index,\n stepStatus: this.getStepStatus(index),\n label,\n currentPosition,\n })\n ) : (\n <Text\n style={[\n styles.stepLabel,\n selectedStepLabelStyle,\n {\n fontSize: this.state.customStyles.labelSize,\n fontFamily: this.state.customStyles.labelFontFamily,\n },\n ]}\n >\n {label}\n </Text>\n )}\n </View>\n </TouchableWithoutFeedback>\n );\n });\n\n return (\n <View\n style={[\n styles.stepLabelsContainer,\n direction === \"vertical\"\n ? { flexDirection: \"column\", paddingHorizontal: 4 }\n : { flexDirection: \"row\", paddingVertical: 4 },\n { alignItems: this.state.customStyles.labelAlign },\n ]}\n >\n {labelViews}\n </View>\n );\n };\n\n renderStep = (position) => {\n const { renderStepIndicator } = this.props;\n let stepStyle;\n let indicatorLabelStyle;\n\n switch (this.getStepStatus(position)) {\n case STEP_STATUS.CURRENT: {\n stepStyle = {\n backgroundColor: this.state.customStyles.stepIndicatorCurrentColor,\n borderWidth: this.state.customStyles.currentStepStrokeWidth,\n borderColor: this.state.customStyles.stepStrokeCurrentColor,\n height: this.sizeAnim,\n width: this.sizeAnim,\n borderRadius: this.borderRadiusAnim,\n };\n indicatorLabelStyle = {\n fontSize: this.state.customStyles.currentStepIndicatorLabelFontSize,\n color: this.state.customStyles.stepIndicatorLabelCurrentColor,\n };\n\n break;\n }\n case STEP_STATUS.FINISHED: {\n stepStyle = {\n backgroundColor: this.state.customStyles.stepIndicatorFinishedColor,\n borderWidth: this.state.customStyles.stepStrokeWidth,\n borderColor: this.state.customStyles.stepStrokeFinishedColor,\n height: this.state.customStyles.stepIndicatorSize,\n width: this.state.customStyles.stepIndicatorSize,\n borderRadius: this.state.customStyles.stepIndicatorSize / 2,\n };\n indicatorLabelStyle = {\n fontSize: this.state.customStyles.stepIndicatorLabelFontSize,\n color: this.state.customStyles.stepIndicatorLabelFinishedColor,\n };\n break;\n }\n\n case STEP_STATUS.UNFINISHED: {\n stepStyle = {\n backgroundColor: this.state.customStyles.stepIndicatorUnFinishedColor,\n borderWidth: this.state.customStyles.stepStrokeWidth,\n borderColor: this.state.customStyles.stepStrokeUnFinishedColor,\n height: this.state.customStyles.stepIndicatorSize,\n width: this.state.customStyles.stepIndicatorSize,\n borderRadius: this.state.customStyles.stepIndicatorSize / 2,\n };\n indicatorLabelStyle = {\n overflow: \"hidden\",\n fontSize: this.state.customStyles.stepIndicatorLabelFontSize,\n color: this.state.customStyles.stepIndicatorLabelUnFinishedColor,\n };\n break;\n }\n default:\n }\n\n return (\n <Animated.View key={\"step-indicator\"} style={[styles.step, stepStyle]}>\n {renderStepIndicator ? (\n renderStepIndicator({\n position,\n stepStatus: this.getStepStatus(position),\n })\n ) : (\n <Text style={indicatorLabelStyle}>{`${position + 1}`}</Text>\n )}\n </Animated.View>\n );\n };\n\n getStepStatus = (stepPosition) => {\n const { currentPosition } = this.props;\n if (stepPosition === currentPosition) {\n return STEP_STATUS.CURRENT;\n } else if (stepPosition < currentPosition) {\n return STEP_STATUS.FINISHED;\n } else {\n return STEP_STATUS.UNFINISHED;\n }\n };\n\n onCurrentPositionChanged = (position) => {\n let { stepCount } = this.props;\n if (position > stepCount - 1) {\n position = stepCount - 1;\n }\n const animateToPosition =\n (this.state.progressBarSize / (stepCount - 1)) * position;\n this.sizeAnim.setValue(this.state.customStyles.stepIndicatorSize);\n this.borderRadiusAnim.setValue(\n this.state.customStyles.stepIndicatorSize / 2\n );\n Animated.sequence([\n Animated.timing(this.progressAnim, {\n toValue: animateToPosition,\n duration: 200,\n }),\n Animated.parallel([\n Animated.timing(this.sizeAnim, {\n toValue: this.state.customStyles.currentStepIndicatorSize,\n duration: 100,\n }),\n Animated.timing(this.borderRadiusAnim, {\n toValue: this.state.customStyles.currentStepIndicatorSize / 2,\n duration: 100,\n }),\n ]),\n ]).start();\n };\n}\n\nconst styles = StyleSheet.create({\n container: {\n backgroundColor: \"transparent\",\n },\n stepIndicatorContainer: {\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"space-around\",\n backgroundColor: \"transparent\",\n },\n stepLabelsContainer: {\n justifyContent: \"space-around\",\n },\n step: {\n alignItems: \"center\",\n justifyContent: \"center\",\n zIndex: 2,\n },\n stepContainer: {\n flex: 1,\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n stepLabel: {\n fontSize: 12,\n textAlign: \"center\",\n fontWeight: \"500\",\n },\n stepLabelItem: {\n flex: 1,\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n});\n\nStepIndicator.defaultProps = {\n currentPosition: 0,\n stepCount: 5,\n customStyles: {},\n direction: \"horizontal\",\n};\n"],"mappings":";;AAAA;AACA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,SACEC,IADF,EAEEC,IAFF,EAGEC,UAHF,EAIEC,QAJF,EAKEC,wBALF,QAMO,cANP;AAQA,MAAMC,WAAW,GAAG;EAClBC,OAAO,EAAE,SADS;EAElBC,QAAQ,EAAE,UAFQ;EAGlBC,UAAU,EAAE;AAHM,CAApB;AA+CA,eAAe,MAAMC,aAAN,SAA4BV,SAA5B,CAAoD;EACjEW,WAAW,CAACC,KAAD,EAAe;IACxB,MAAMA,KAAN;;IADwB,qDAwFI,MAAM;MAClC,MAAM;QAAEC,SAAF;QAAaC;MAAb,IAA2B,KAAKF,KAAtC;MACA,IAAIG,0BAAJ;;MACA,IAAID,SAAS,KAAK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E;EAHH;AA7BgB,CAAlB,CAAf;AAoCA7G,aAAa,CAACiH,YAAd,GAA6B;EAC3BxF,eAAe,EAAE,CADU;EAE3BtB,SAAS,EAAE,CAFgB;EAG3BK,YAAY,EAAE,EAHa;EAI3BJ,SAAS,EAAE;AAJgB,CAA7B"}
|
|
1
|
+
{"version":3,"names":["React","Component","View","Text","StyleSheet","Animated","TouchableWithoutFeedback","STEP_STATUS","CURRENT","FINISHED","UNFINISHED","StepIndicator","constructor","props","stepCount","direction","progressBarBackgroundStyle","backgroundColor","state","customStyles","separatorUnFinishedColor","position","left","width","separatorStrokeWidth","top","height","bottom","separatorStrokeUnfinishedWidth","right","event","setState","progressBarSize","nativeEvent","layout","onCurrentPositionChanged","currentPosition","progressBarStyle","separatorFinishedColor","separatorStrokeFinishedWidth","progressAnim","steps","push","stepPressed","styles","stepContainer","flexDirection","renderStep","stepIndicatorContainer","currentStepIndicatorSize","labels","renderLabel","labelViews","map","label","index","selectedStepLabelStyle","color","currentStepLabelColor","labelColor","stepLabelItem","stepStatus","getStepStatus","stepLabel","fontSize","labelSize","fontFamily","labelFontFamily","stepLabelsContainer","paddingHorizontal","paddingVertical","alignItems","labelAlign","renderStepIndicator","stepStyle","indicatorLabelStyle","stepIndicatorCurrentColor","borderWidth","currentStepStrokeWidth","borderColor","stepStrokeCurrentColor","sizeAnim","borderRadius","borderRadiusAnim","currentStepIndicatorLabelFontSize","stepIndicatorLabelCurrentColor","stepIndicatorFinishedColor","stepStrokeWidth","stepStrokeFinishedColor","stepIndicatorSize","stepIndicatorLabelFontSize","stepIndicatorLabelFinishedColor","stepIndicatorUnFinishedColor","stepStrokeUnFinishedColor","overflow","stepIndicatorLabelUnFinishedColor","step","stepPosition","animateToPosition","setValue","sequence","timing","toValue","duration","parallel","start","defaultStyles","Object","assign","Value","onPress","render","container","flex","renderProgressBarBackground","renderProgressBar","renderStepLabels","componentDidUpdate","prevProps","create","justifyContent","zIndex","textAlign","fontWeight","defaultProps"],"sources":["StepIndicator.tsx"],"sourcesContent":["// @ts-nocheck\nimport React, { Component } from \"react\";\nimport {\n View,\n Text,\n StyleSheet,\n Animated,\n TouchableWithoutFeedback,\n} from \"react-native\";\n\nconst STEP_STATUS = {\n CURRENT: \"current\",\n FINISHED: \"finished\",\n UNFINISHED: \"unfinished\",\n};\n\ninterface CustomStyles {\n stepIndicatorSize?: number;\n currentStepIndicatorSize?: number;\n separatorStrokeWidth?: number;\n separatorStrokeUnfinishedWidth?: number;\n separatorStrokeFinishedWidth?: number;\n currentStepStrokeWidth: number;\n stepStrokeWidth?: number;\n stepStrokeCurrentColor?: string;\n stepStrokeFinishedColor: string;\n stepStrokeUnFinishedColor: string;\n separatorFinishedColor: string;\n separatorUnFinishedColor: string;\n stepIndicatorFinishedColor: string;\n stepIndicatorUnFinishedColor: string;\n stepIndicatorCurrentColor: string;\n stepIndicatorLabelFontSize: number;\n currentStepIndicatorLabelFontSize?: number;\n stepIndicatorLabelCurrentColor: string;\n stepIndicatorLabelFinishedColor: string;\n stepIndicatorLabelUnFinishedColor: string;\n labelColor?: string;\n labelSize?: number;\n labelAlign?: string;\n currentStepLabelColor?: string;\n labelFontFamily?: string;\n}\n\ntype Props = {\n stepCount: number;\n currentPosition: number;\n customStyles: CustomStyles;\n};\n\ntype State = {\n width: number;\n height: number;\n progressBarSize: number;\n customStyles: CustomStyles;\n};\n\nexport default class StepIndicator extends Component<Props, State> {\n constructor(props: Props) {\n super(props);\n\n const defaultStyles = {\n stepIndicatorSize: 30,\n currentStepIndicatorSize: 40,\n separatorStrokeWidth: 3,\n separatorStrokeUnfinishedWidth: 0,\n separatorStrokeFinishedWidth: 0,\n currentStepStrokeWidth: 5,\n stepStrokeWidth: 0,\n stepStrokeCurrentColor: \"#4aae4f\",\n stepStrokeFinishedColor: \"#4aae4f\",\n stepStrokeUnFinishedColor: \"#4aae4f\",\n separatorFinishedColor: \"#4aae4f\",\n separatorUnFinishedColor: \"#a4d4a5\",\n stepIndicatorFinishedColor: \"#4aae4f\",\n stepIndicatorUnFinishedColor: \"#a4d4a5\",\n stepIndicatorCurrentColor: \"#ffffff\",\n stepIndicatorLabelFontSize: 15,\n currentStepIndicatorLabelFontSize: 15,\n stepIndicatorLabelCurrentColor: \"#000000\",\n stepIndicatorLabelFinishedColor: \"#ffffff\",\n stepIndicatorLabelUnFinishedColor: \"rgba(255,255,255,0.5)\",\n labelColor: \"#000000\",\n labelSize: 13,\n labelAlign: \"center\",\n currentStepLabelColor: \"#4aae4f\",\n };\n\n const customStyles = Object.assign(defaultStyles, props.customStyles);\n\n this.state = {\n width: 0,\n height: 1,\n progressBarSize: -2,\n customStyles,\n };\n\n this.progressAnim = new Animated.Value(0);\n this.sizeAnim = new Animated.Value(\n this.state.customStyles.stepIndicatorSize\n );\n this.borderRadiusAnim = new Animated.Value(\n this.state.customStyles.stepIndicatorSize / 2\n );\n }\n\n stepPressed(position) {\n if (this.props.onPress) {\n this.props.onPress(position);\n }\n }\n\n render() {\n const { labels, direction } = this.props;\n return (\n <View\n style={[\n styles.container,\n direction === \"vertical\"\n ? { flexDirection: \"row\", flex: 1 }\n : { flexDirection: \"column\" },\n ]}\n >\n {this.state.width !== 0 && this.renderProgressBarBackground()}\n {this.state.width !== 0 && this.renderProgressBar()}\n {this.renderStepIndicator()}\n {labels && this.renderStepLabels()}\n </View>\n );\n }\n\n componentDidUpdate(prevProps) {\n // if (prevProps.customStyles !== this.props.customStyles) {\n // this.setState((state) => ({\n // customStyles: Object.assign(\n // state.customStyles,\n // this.props.customStyles\n // ),\n // }));\n // }\n\n if (prevProps.currentPosition !== this.props.currentPosition) {\n this.onCurrentPositionChanged(this.props.currentPosition);\n }\n }\n\n renderProgressBarBackground = () => {\n const { stepCount, direction } = this.props;\n let progressBarBackgroundStyle;\n if (direction === \"vertical\") {\n progressBarBackgroundStyle = {\n backgroundColor: this.state.customStyles.separatorUnFinishedColor,\n position: \"absolute\",\n left:\n (this.state.width - this.state.customStyles.separatorStrokeWidth) / 2,\n top: this.state.height / (2 * stepCount),\n bottom: this.state.height / (2 * stepCount),\n width:\n this.state.customStyles.separatorStrokeUnfinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeUnfinishedWidth,\n };\n } else {\n progressBarBackgroundStyle = {\n backgroundColor: this.state.customStyles.separatorUnFinishedColor,\n position: \"absolute\",\n top:\n (this.state.height - this.state.customStyles.separatorStrokeWidth) /\n 2,\n left: this.state.width / (2 * stepCount),\n right: this.state.width / (2 * stepCount),\n height:\n this.state.customStyles.separatorStrokeUnfinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeUnfinishedWidth,\n };\n }\n return (\n <View\n onLayout={(event) => {\n if (direction === \"vertical\") {\n this.setState(\n { progressBarSize: event.nativeEvent.layout.height },\n () => {\n this.onCurrentPositionChanged(this.props.currentPosition);\n }\n );\n } else {\n this.setState(\n { progressBarSize: event.nativeEvent.layout.width },\n () => {\n this.onCurrentPositionChanged(this.props.currentPosition);\n }\n );\n }\n }}\n style={progressBarBackgroundStyle}\n />\n );\n };\n\n renderProgressBar = () => {\n const { stepCount, direction } = this.props;\n let progressBarStyle;\n if (direction === \"vertical\") {\n progressBarStyle = {\n backgroundColor: this.state.customStyles.separatorFinishedColor,\n position: \"absolute\",\n left:\n (this.state.width - this.state.customStyles.separatorStrokeWidth) / 2,\n top: this.state.height / (2 * stepCount),\n bottom: this.state.height / (2 * stepCount),\n width:\n this.state.customStyles.separatorStrokeFinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeFinishedWidth,\n height: this.progressAnim,\n };\n } else {\n progressBarStyle = {\n backgroundColor: this.state.customStyles.separatorFinishedColor,\n position: \"absolute\",\n top:\n (this.state.height - this.state.customStyles.separatorStrokeWidth) /\n 2,\n left: this.state.width / (2 * stepCount),\n right: this.state.width / (2 * stepCount),\n height:\n this.state.customStyles.separatorStrokeFinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeFinishedWidth,\n width: this.progressAnim,\n };\n }\n return <Animated.View style={progressBarStyle} />;\n };\n\n renderStepIndicator = () => {\n let steps = [];\n const { stepCount, direction } = this.props;\n for (let position = 0; position < stepCount; position++) {\n steps.push(\n <TouchableWithoutFeedback\n key={position}\n onPress={() => this.stepPressed(position)}\n >\n <View\n style={[\n styles.stepContainer,\n direction === \"vertical\"\n ? { flexDirection: \"column\" }\n : { flexDirection: \"row\" },\n ]}\n >\n {this.renderStep(position)}\n </View>\n </TouchableWithoutFeedback>\n );\n }\n return (\n <View\n onLayout={(event) =>\n this.setState({\n width: event.nativeEvent.layout.width,\n height: event.nativeEvent.layout.height,\n })\n }\n style={[\n styles.stepIndicatorContainer,\n direction === \"vertical\"\n ? {\n flexDirection: \"column\",\n width: this.state.customStyles.currentStepIndicatorSize,\n }\n : {\n flexDirection: \"row\",\n height: this.state.customStyles.currentStepIndicatorSize,\n },\n ]}\n >\n {steps}\n </View>\n );\n };\n\n renderStepLabels = () => {\n const { labels, direction, currentPosition, renderLabel } = this.props;\n var labelViews = labels.map((label, index) => {\n const selectedStepLabelStyle =\n index === currentPosition\n ? { color: this.state.customStyles.currentStepLabelColor }\n : { color: this.state.customStyles.labelColor };\n return (\n <TouchableWithoutFeedback\n style={styles.stepLabelItem}\n key={index}\n onPress={() => this.stepPressed(index)}\n >\n <View style={styles.stepLabelItem}>\n {renderLabel ? (\n renderLabel({\n position: index,\n stepStatus: this.getStepStatus(index),\n label,\n currentPosition,\n })\n ) : (\n <Text\n style={[\n styles.stepLabel,\n selectedStepLabelStyle,\n {\n fontSize: this.state.customStyles.labelSize,\n fontFamily: this.state.customStyles.labelFontFamily,\n },\n ]}\n >\n {label}\n </Text>\n )}\n </View>\n </TouchableWithoutFeedback>\n );\n });\n\n return (\n <View\n style={[\n styles.stepLabelsContainer,\n direction === \"vertical\"\n ? { flexDirection: \"column\", paddingHorizontal: 4 }\n : { flexDirection: \"row\", paddingVertical: 4 },\n { alignItems: this.state.customStyles.labelAlign },\n ]}\n >\n {labelViews}\n </View>\n );\n };\n\n renderStep = (position) => {\n const { renderStepIndicator } = this.props;\n let stepStyle;\n let indicatorLabelStyle;\n\n switch (this.getStepStatus(position)) {\n case STEP_STATUS.CURRENT: {\n stepStyle = {\n backgroundColor: this.state.customStyles.stepIndicatorCurrentColor,\n borderWidth: this.state.customStyles.currentStepStrokeWidth,\n borderColor: this.state.customStyles.stepStrokeCurrentColor,\n height: this.sizeAnim,\n width: this.sizeAnim,\n borderRadius: this.borderRadiusAnim,\n };\n indicatorLabelStyle = {\n fontSize: this.state.customStyles.currentStepIndicatorLabelFontSize,\n color: this.state.customStyles.stepIndicatorLabelCurrentColor,\n };\n\n break;\n }\n case STEP_STATUS.FINISHED: {\n stepStyle = {\n backgroundColor: this.state.customStyles.stepIndicatorFinishedColor,\n borderWidth: this.state.customStyles.stepStrokeWidth,\n borderColor: this.state.customStyles.stepStrokeFinishedColor,\n height: this.state.customStyles.stepIndicatorSize,\n width: this.state.customStyles.stepIndicatorSize,\n borderRadius: this.state.customStyles.stepIndicatorSize / 2,\n };\n indicatorLabelStyle = {\n fontSize: this.state.customStyles.stepIndicatorLabelFontSize,\n color: this.state.customStyles.stepIndicatorLabelFinishedColor,\n };\n break;\n }\n\n case STEP_STATUS.UNFINISHED: {\n stepStyle = {\n backgroundColor: this.state.customStyles.stepIndicatorUnFinishedColor,\n borderWidth: this.state.customStyles.stepStrokeWidth,\n borderColor: this.state.customStyles.stepStrokeUnFinishedColor,\n height: this.state.customStyles.stepIndicatorSize,\n width: this.state.customStyles.stepIndicatorSize,\n borderRadius: this.state.customStyles.stepIndicatorSize / 2,\n };\n indicatorLabelStyle = {\n overflow: \"hidden\",\n fontSize: this.state.customStyles.stepIndicatorLabelFontSize,\n color: this.state.customStyles.stepIndicatorLabelUnFinishedColor,\n };\n break;\n }\n default:\n }\n\n return (\n <Animated.View key={\"step-indicator\"} style={[styles.step, stepStyle]}>\n {renderStepIndicator ? (\n renderStepIndicator({\n position,\n stepStatus: this.getStepStatus(position),\n })\n ) : (\n <Text style={indicatorLabelStyle}>{`${position + 1}`}</Text>\n )}\n </Animated.View>\n );\n };\n\n getStepStatus = (stepPosition) => {\n const { currentPosition } = this.props;\n if (stepPosition === currentPosition) {\n return STEP_STATUS.CURRENT;\n } else if (stepPosition < currentPosition) {\n return STEP_STATUS.FINISHED;\n } else {\n return STEP_STATUS.UNFINISHED;\n }\n };\n\n onCurrentPositionChanged = (position) => {\n let { stepCount } = this.props;\n if (position > stepCount - 1) {\n position = stepCount - 1;\n }\n const animateToPosition =\n (this.state.progressBarSize / (stepCount - 1)) * position;\n this.sizeAnim.setValue(this.state.customStyles.stepIndicatorSize);\n this.borderRadiusAnim.setValue(\n this.state.customStyles.stepIndicatorSize / 2\n );\n Animated.sequence([\n Animated.timing(this.progressAnim, {\n toValue: animateToPosition,\n duration: 200,\n }),\n Animated.parallel([\n Animated.timing(this.sizeAnim, {\n toValue: this.state.customStyles.currentStepIndicatorSize,\n duration: 100,\n }),\n Animated.timing(this.borderRadiusAnim, {\n toValue: this.state.customStyles.currentStepIndicatorSize / 2,\n duration: 100,\n }),\n ]),\n ]).start();\n };\n}\n\nconst styles = StyleSheet.create({\n container: {\n backgroundColor: \"transparent\",\n },\n stepIndicatorContainer: {\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"space-around\",\n backgroundColor: \"transparent\",\n },\n stepLabelsContainer: {\n justifyContent: \"space-around\",\n },\n step: {\n alignItems: \"center\",\n justifyContent: \"center\",\n zIndex: 2,\n },\n stepContainer: {\n flex: 1,\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n stepLabel: {\n fontSize: 12,\n textAlign: \"center\",\n fontWeight: \"500\",\n },\n stepLabelItem: {\n flex: 1,\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n});\n\nStepIndicator.defaultProps = {\n currentPosition: 0,\n stepCount: 5,\n customStyles: {},\n direction: \"horizontal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EAAE;IACnBoD,cAAc,EAAE;EADG,CAVU;EAa/BxB,IAAI,EAAE;IACJzB,UAAU,EAAE,QADR;IAEJiD,cAAc,EAAE,QAFZ;IAGJC,MAAM,EAAE;EAHJ,CAbyB;EAkB/B5E,aAAa,EAAE;IACboE,IAAI,EAAE,CADO;IAEbnE,aAAa,EAAE,KAFF;IAGbyB,UAAU,EAAE,QAHC;IAIbiD,cAAc,EAAE;EAJH,CAlBgB;EAwB/BzD,SAAS,EAAE;IACTC,QAAQ,EAAE,EADD;IAET0D,SAAS,EAAE,QAFF;IAGTC,UAAU,EAAE;EAHH,CAxBoB;EA6B/B/D,aAAa,EAAE;IACbqD,IAAI,EAAE,CADO;IAEb1C,UAAU,EAAE,QAFC;IAGbiD,cAAc,EAAE;EAHH;AA7BgB,CAAlB,CAAf;AAoCA7G,aAAa,CAACiH,YAAd,GAA6B;EAC3BxF,eAAe,EAAE,CADU;EAE3BtB,SAAS,EAAE,CAFgB;EAG3BK,YAAY,EAAE,EAHa;EAI3BJ,SAAS,EAAE;AAJgB,CAA7B"}
|
|
@@ -21,7 +21,7 @@ const Stepper = _ref => {
|
|
|
21
21
|
},
|
|
22
22
|
Icon
|
|
23
23
|
} = _ref;
|
|
24
|
-
const [value, setValue] = useState(defaultValue
|
|
24
|
+
const [value, setValue] = useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : 0);
|
|
25
25
|
|
|
26
26
|
const isValidValue = valueArg => valueArg >= min && valueArg <= max;
|
|
27
27
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useState","View","Text","isNumber","withTheme","IconButton","Stepper","min","Infinity","max","value","valueProp","defaultValue","style","typeStyle","iconSize","iconColor","onChange","theme","colors","typography","Icon","setValue","isValidValue","valueArg","handlePlusOrMinus","type","newValue","flexDirection","opacity","body1","textAlign","alignSelf","color","medium","marginHorizontal"],"sources":["Stepper.tsx"],"sourcesContent":["import React, { FC, useEffect, useState } from \"react\";\nimport { View, Text, StyleProp, ViewStyle, TextStyle } from \"react-native\";\nimport { isNumber } from \"lodash\";\n\nimport { withTheme } from \"../theming\";\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\nimport IconButton from \"./IconButton\";\n\ntype Props = {\n min: number;\n max: number;\n value?: number;\n defaultValue?: number;\n style?: StyleProp<ViewStyle>;\n typeStyle?: StyleProp<TextStyle>;\n iconSize: number;\n iconColor?: string;\n onChange?: (value: number) => void;\n theme: Theme;\n} & IconSlot;\n\nconst Stepper: FC<Props> = ({\n min = -Infinity,\n max = Infinity,\n value: valueProp,\n defaultValue,\n style,\n typeStyle,\n iconSize = 24,\n iconColor,\n onChange,\n theme: { colors, typography },\n Icon,\n}) => {\n const [value, setValue] = useState(defaultValue ?? 0);\n\n const isValidValue = (valueArg: number) => valueArg >= min && valueArg <= max;\n\n const handlePlusOrMinus = (type: \"plus\" | \"minus\") => {\n const newValue = type === \"plus\" ? value + 1 : value - 1;\n\n if (isValidValue(newValue)) {\n setValue(newValue);\n onChange?.(newValue);\n }\n };\n\n useEffect(() => {\n if (\n valueProp != null &&\n isNumber(valueProp) &&\n valueProp !== value &&\n isValidValue(valueProp)\n ) {\n setValue(valueProp);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [valueProp]);\n\n return (\n <View style={[{ flexDirection: \"row\" }, style]}>\n <IconButton\n Icon={Icon}\n icon=\"MaterialIcons/remove\"\n onPress={() => handlePlusOrMinus(\"minus\")}\n size={iconSize}\n color={iconColor}\n disabled={value === min}\n style={{ opacity: value === min ? 0.5 : 1 }}\n />\n\n <Text\n style={[\n typography.body1,\n {\n textAlign: \"center\",\n alignSelf: \"center\",\n color: colors.medium,\n marginHorizontal: 8,\n },\n typeStyle,\n ]}\n >\n {value}\n </Text>\n\n <IconButton\n Icon={Icon}\n icon=\"MaterialIcons/add\"\n onPress={() => handlePlusOrMinus(\"plus\")}\n size={iconSize}\n color={iconColor}\n disabled={value === max}\n style={{ opacity: value === max ? 0.5 : 1 }}\n />\n </View>\n );\n};\n\nexport default withTheme(Stepper);\n"],"mappings":"AAAA,OAAOA,KAAP,IAAoBC,SAApB,EAA+BC,QAA/B,QAA+C,OAA/C;AACA,SAASC,IAAT,EAAeC,IAAf,QAA4D,cAA5D;AACA,SAASC,QAAT,QAAyB,QAAzB;AAEA,SAASC,SAAT,QAA0B,YAA1B;AAGA,OAAOC,UAAP,MAAuB,cAAvB;;AAeA,MAAMC,OAAkB,GAAG,QAYrB;EAAA,IAZsB;IAC1BC,GAAG,GAAG,CAACC,QADmB;IAE1BC,GAAG,GAAGD,QAFoB;IAG1BE,KAAK,EAAEC,SAHmB;IAI1BC,YAJ0B;IAK1BC,KAL0B;IAM1BC,SAN0B;IAO1BC,QAAQ,GAAG,EAPe;IAQ1BC,SAR0B;IAS1BC,QAT0B;IAU1BC,KAAK,EAAE;MAAEC,MAAF;MAAUC;IAAV,CAVmB;IAW1BC;EAX0B,CAYtB;EACJ,MAAM,CAACX,KAAD,EAAQY,QAAR,IAAoBtB,QAAQ,CAACY,
|
|
1
|
+
{"version":3,"names":["React","useEffect","useState","View","Text","isNumber","withTheme","IconButton","Stepper","min","Infinity","max","value","valueProp","defaultValue","style","typeStyle","iconSize","iconColor","onChange","theme","colors","typography","Icon","setValue","isValidValue","valueArg","handlePlusOrMinus","type","newValue","flexDirection","opacity","body1","textAlign","alignSelf","color","medium","marginHorizontal"],"sources":["Stepper.tsx"],"sourcesContent":["import React, { FC, useEffect, useState } from \"react\";\nimport { View, Text, StyleProp, ViewStyle, TextStyle } from \"react-native\";\nimport { isNumber } from \"lodash\";\n\nimport { withTheme } from \"../theming\";\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\nimport IconButton from \"./IconButton\";\n\ntype Props = {\n min: number;\n max: number;\n value?: number;\n defaultValue?: number;\n style?: StyleProp<ViewStyle>;\n typeStyle?: StyleProp<TextStyle>;\n iconSize: number;\n iconColor?: string;\n onChange?: (value: number) => void;\n theme: Theme;\n} & IconSlot;\n\nconst Stepper: FC<Props> = ({\n min = -Infinity,\n max = Infinity,\n value: valueProp,\n defaultValue,\n style,\n typeStyle,\n iconSize = 24,\n iconColor,\n onChange,\n theme: { colors, typography },\n Icon,\n}) => {\n const [value, setValue] = useState(defaultValue ?? 0);\n\n const isValidValue = (valueArg: number) => valueArg >= min && valueArg <= max;\n\n const handlePlusOrMinus = (type: \"plus\" | \"minus\") => {\n const newValue = type === \"plus\" ? value + 1 : value - 1;\n\n if (isValidValue(newValue)) {\n setValue(newValue);\n onChange?.(newValue);\n }\n };\n\n useEffect(() => {\n if (\n valueProp != null &&\n isNumber(valueProp) &&\n valueProp !== value &&\n isValidValue(valueProp)\n ) {\n setValue(valueProp);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [valueProp]);\n\n return (\n <View style={[{ flexDirection: \"row\" }, style]}>\n <IconButton\n Icon={Icon}\n icon=\"MaterialIcons/remove\"\n onPress={() => handlePlusOrMinus(\"minus\")}\n size={iconSize}\n color={iconColor}\n disabled={value === min}\n style={{ opacity: value === min ? 0.5 : 1 }}\n />\n\n <Text\n style={[\n typography.body1,\n {\n textAlign: \"center\",\n alignSelf: \"center\",\n color: colors.medium,\n marginHorizontal: 8,\n },\n typeStyle,\n ]}\n >\n {value}\n </Text>\n\n <IconButton\n Icon={Icon}\n icon=\"MaterialIcons/add\"\n onPress={() => handlePlusOrMinus(\"plus\")}\n size={iconSize}\n color={iconColor}\n disabled={value === max}\n style={{ opacity: value === max ? 0.5 : 1 }}\n />\n </View>\n );\n};\n\nexport default withTheme(Stepper);\n"],"mappings":"AAAA,OAAOA,KAAP,IAAoBC,SAApB,EAA+BC,QAA/B,QAA+C,OAA/C;AACA,SAASC,IAAT,EAAeC,IAAf,QAA4D,cAA5D;AACA,SAASC,QAAT,QAAyB,QAAzB;AAEA,SAASC,SAAT,QAA0B,YAA1B;AAGA,OAAOC,UAAP,MAAuB,cAAvB;;AAeA,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AEE,IAAI,EAAC,sBAFP;IAGE,OAAO,EAAE,MAAMI,iBAAiB,CAAC,OAAD,CAHlC;IAIE,IAAI,EAAEV,QAJR;IAKE,KAAK,EAAEC,SALT;IAME,QAAQ,EAAEN,KAAK,KAAKH,GANtB;IAOE,KAAK,EAAE;MAAEsB,OAAO,EAAEnB,KAAK,KAAKH,GAAV,GAAgB,GAAhB,GAAsB;IAAjC;EAPT,EADF,eAWE,oBAAC,IAAD;IACE,KAAK,EAAE,CACLa,UAAU,CAACU,KADN,EAEL;MACEC,SAAS,EAAE,QADb;MAEEC,SAAS,EAAE,QAFb;MAGEC,KAAK,EAAEd,MAAM,CAACe,MAHhB;MAIEC,gBAAgB,EAAE;IAJpB,CAFK,EAQLrB,SARK;EADT,GAYGJ,KAZH,CAXF,eA0BE,oBAAC,UAAD;IACE,IAAI,EAAEW,IADR;IAEE,IAAI,EAAC,mBAFP;IAGE,OAAO,EAAE,MAAMI,iBAAiB,CAAC,MAAD,CAHlC;IAIE,IAAI,EAAEV,QAJR;IAKE,KAAK,EAAEC,SALT;IAME,QAAQ,EAAEN,KAAK,KAAKD,GANtB;IAOE,KAAK,EAAE;MAAEoB,OAAO,EAAEnB,KAAK,KAAKD,GAAV,GAAgB,GAAhB,GAAsB;IAAjC;EAPT,EA1BF,CADF;AAsCD,CA5ED;;AA8EA,eAAeL,SAAS,CAACE,OAAD,CAAxB"}
|
|
@@ -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 React from "react";
|
|
2
4
|
import { Pressable } from "react-native";
|
|
3
5
|
export default function Touchable(_ref) {
|
|
@@ -8,22 +10,6 @@ export default function Touchable(_ref) {
|
|
|
8
10
|
style,
|
|
9
11
|
...props
|
|
10
12
|
} = _ref;
|
|
11
|
-
return /*#__PURE__*/React.createElement(Pressable, {
|
|
12
|
-
onPress: onPress,
|
|
13
|
-
disabled: disabled,
|
|
14
|
-
hitSlop: 8,
|
|
15
|
-
style: _ref2 => {
|
|
16
|
-
let {
|
|
17
|
-
pressed
|
|
18
|
-
} = _ref2;
|
|
19
|
-
return [{
|
|
20
|
-
opacity: pressed || disabled ? 0.75 : 1
|
|
21
|
-
}, style];
|
|
22
|
-
},
|
|
23
|
-
...props
|
|
24
|
-
}, children);
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=Touchable.js.map
|
|
27
13
|
return /*#__PURE__*/React.createElement(Pressable, _extends({
|
|
28
14
|
onPress: onPress,
|
|
29
15
|
disabled: disabled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Pressable","Touchable","children","disabled","onPress","style","props","
|
|
1
|
+
{"version":3,"names":["React","Pressable","Touchable","children","disabled","onPress","style","props","pressed","opacity"],"sources":["Touchable.tsx"],"sourcesContent":["import React from \"react\";\nimport { Pressable, ViewStyle, PressableProps } from \"react-native\";\n\ntype Props = {\n disabled?: boolean;\n children: React.ReactNode;\n style?: ViewStyle;\n onPress?: () => void;\n} & PressableProps;\n\nexport default function Touchable({\n children,\n disabled,\n onPress,\n style,\n ...props\n}: Props) {\n return (\n <Pressable\n onPress={onPress}\n disabled={disabled}\n hitSlop={8}\n style={({ pressed }) => {\n return [\n {\n opacity: pressed || disabled ? 0.75 : 1,\n },\n style,\n ];\n }}\n {...props}\n >\n {children}\n </Pressable>\n );\n}\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,SAAT,QAAqD,cAArD;AASA,eAAe,SAASC,SAAT,OAML;EAAA,IANwB;IAChCC,QADgC;IAEhCC,QAFgC;IAGhCC,OAHgC;IAIhCC,KAJgC;IAKhC,GAAGC;EAL6B,CAMxB;EACR,oBACE,oBAAC,SAAD;IACE,OAAO,EAAEF,OADX;IAEE,QAAQ,EAAED,QAFZ;IAGE,OAAO,EAAE,CAHX;IAIE,KAAK,EAAE,SAAiB;MAAA,IAAhB;QAAEI;MAAF,CAAgB;MACtB,OAAO,CACL;QACEC,OAAO,EAAED,OAAO,IAAIJ,QAAX,GAAsB,IAAtB,GAA6B;MADxC,CADK,EAILE,KAJK,CAAP;IAMD;EAXH,GAYMC,KAZN,GAcGJ,QAdH,CADF;AAkBD"}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, FIELD_NAME, Triggers } from "@draftbit/types";
|
|
2
|
+
const NUMBER_INPUT_PROPS = {
|
|
3
|
+
allowFontScaling: {
|
|
4
|
+
group: GROUPS.advanced,
|
|
5
|
+
label: "Allow Font Scaling",
|
|
6
|
+
description: "Whether fonts should scale to respect Text Size in the user's accessibility settings. (Default: true)",
|
|
7
|
+
editable: true,
|
|
8
|
+
required: false,
|
|
9
|
+
defaultValue: null,
|
|
10
|
+
formType: FORM_TYPES.boolean,
|
|
11
|
+
propType: PROP_TYPES.BOOLEAN
|
|
12
|
+
},
|
|
13
|
+
autoFocus: {
|
|
14
|
+
group: GROUPS.basic,
|
|
15
|
+
label: "Auto Focus",
|
|
16
|
+
description: "Focuses the input on load in and brings up the keyboard",
|
|
17
|
+
editable: true,
|
|
18
|
+
required: false,
|
|
19
|
+
defaultValue: null,
|
|
20
|
+
formType: FORM_TYPES.boolean,
|
|
21
|
+
propType: PROP_TYPES.BOOLEAN
|
|
22
|
+
},
|
|
23
|
+
caretHidden: {
|
|
24
|
+
group: GROUPS.advanced,
|
|
25
|
+
label: "Hide Caret",
|
|
26
|
+
description: "Hides the caret(the line small line underneath each showing where you're editing/typing",
|
|
27
|
+
editable: true,
|
|
28
|
+
required: false,
|
|
29
|
+
defaultValue: null,
|
|
30
|
+
formType: FORM_TYPES.boolean,
|
|
31
|
+
propType: PROP_TYPES.BOOLEAN
|
|
32
|
+
},
|
|
33
|
+
contextMenuHidden: {
|
|
34
|
+
group: GROUPS.advanced,
|
|
35
|
+
label: "Hide Context Menu",
|
|
36
|
+
description: "Hides the system context menu (Default: false)",
|
|
37
|
+
editable: true,
|
|
38
|
+
required: false,
|
|
39
|
+
defaultValue: null,
|
|
40
|
+
formType: FORM_TYPES.boolean,
|
|
41
|
+
propType: PROP_TYPES.BOOLEAN
|
|
42
|
+
},
|
|
43
|
+
editable: {
|
|
44
|
+
group: GROUPS.advanced,
|
|
45
|
+
label: "Editable",
|
|
46
|
+
description: "If false, the text is not editable",
|
|
47
|
+
editable: true,
|
|
48
|
+
required: false,
|
|
49
|
+
defaultValue: true,
|
|
50
|
+
formType: FORM_TYPES.boolean,
|
|
51
|
+
propType: PROP_TYPES.BOOLEAN
|
|
52
|
+
},
|
|
53
|
+
keyboardAppearance: {
|
|
54
|
+
group: GROUPS.advanced,
|
|
55
|
+
label: "Keyboard Appearance",
|
|
56
|
+
description: "Determines the color of the keyboard.(iOS Only)",
|
|
57
|
+
editable: true,
|
|
58
|
+
required: false,
|
|
59
|
+
defaultValue: null,
|
|
60
|
+
options: ["default", "light", "dark"],
|
|
61
|
+
formType: FORM_TYPES.flatArray,
|
|
62
|
+
propType: PROP_TYPES.STRING
|
|
63
|
+
},
|
|
64
|
+
keyboardType: {
|
|
65
|
+
group: GROUPS.advanced,
|
|
66
|
+
label: "Keyboard Type",
|
|
67
|
+
description: "Determines what keyboard is given to the user.",
|
|
68
|
+
editable: true,
|
|
69
|
+
required: false,
|
|
70
|
+
defaultValue: null,
|
|
71
|
+
options: ["numeric", "numbers-and-punctuation", "number-pad"],
|
|
72
|
+
formType: FORM_TYPES.flatArray,
|
|
73
|
+
propType: PROP_TYPES.STRING
|
|
74
|
+
},
|
|
75
|
+
maxLength: {
|
|
76
|
+
group: GROUPS.basic,
|
|
77
|
+
label: "Max Length",
|
|
78
|
+
description: "Limits the input to a set number of characters.",
|
|
79
|
+
editable: true,
|
|
80
|
+
required: false,
|
|
81
|
+
defaultValue: null,
|
|
82
|
+
min: 0,
|
|
83
|
+
step: 1,
|
|
84
|
+
precision: 0,
|
|
85
|
+
formType: FORM_TYPES.number,
|
|
86
|
+
propType: PROP_TYPES.NUMBER
|
|
87
|
+
},
|
|
88
|
+
placeholder: {
|
|
89
|
+
group: GROUPS.basic,
|
|
90
|
+
label: "Placeholder Text",
|
|
91
|
+
description: "The text that is shown on load when no value is available.",
|
|
92
|
+
editable: true,
|
|
93
|
+
required: false,
|
|
94
|
+
defaultValue: "Enter a number...",
|
|
95
|
+
formType: FORM_TYPES.string,
|
|
96
|
+
propType: PROP_TYPES.STRING
|
|
97
|
+
},
|
|
98
|
+
placeholderTextColor: {
|
|
99
|
+
group: GROUPS.basic,
|
|
100
|
+
label: "Placeholder Text Color",
|
|
101
|
+
description: "The color of the placeholder text.",
|
|
102
|
+
editable: true,
|
|
103
|
+
required: false,
|
|
104
|
+
defaultValue: null,
|
|
105
|
+
formType: FORM_TYPES.color,
|
|
106
|
+
propType: PROP_TYPES.STRING
|
|
107
|
+
},
|
|
108
|
+
returnKeyLabel: {
|
|
109
|
+
group: GROUPS.advanced,
|
|
110
|
+
label: "Return Key Label",
|
|
111
|
+
description: "(Android Only) Sets the label on the return key (use this instead of rewturnKeyType)",
|
|
112
|
+
editable: true,
|
|
113
|
+
required: false,
|
|
114
|
+
defaultValue: null,
|
|
115
|
+
formType: FORM_TYPES.string,
|
|
116
|
+
propType: PROP_TYPES.STRING
|
|
117
|
+
},
|
|
118
|
+
returnKeyType: {
|
|
119
|
+
group: GROUPS.advanced,
|
|
120
|
+
label: "Return Key Type",
|
|
121
|
+
description: "Determines how the return key should look like",
|
|
122
|
+
editable: true,
|
|
123
|
+
required: false,
|
|
124
|
+
defaultValue: null,
|
|
125
|
+
options: ["done", "go", "next", "search", "send", "none", "previous", "default", "emergency-call", "google", "join", "route", "yahoo"],
|
|
126
|
+
formType: FORM_TYPES.flatArray,
|
|
127
|
+
propType: PROP_TYPES.STRING
|
|
128
|
+
},
|
|
129
|
+
selectionColor: {
|
|
130
|
+
group: GROUPS.advanced,
|
|
131
|
+
label: "Selection Color",
|
|
132
|
+
description: "Color of the highlighted portion when selecting.",
|
|
133
|
+
editable: true,
|
|
134
|
+
required: false,
|
|
135
|
+
defaultValue: null,
|
|
136
|
+
formType: FORM_TYPES.color,
|
|
137
|
+
propType: PROP_TYPES.STRING
|
|
138
|
+
},
|
|
139
|
+
selectTextOnFocus: {
|
|
140
|
+
group: GROUPS.advanced,
|
|
141
|
+
label: "Select Text on Focus",
|
|
142
|
+
description: "If true, all the text will automatically be selected on focus",
|
|
143
|
+
editable: true,
|
|
144
|
+
required: false,
|
|
145
|
+
defaultValue: null,
|
|
146
|
+
formType: FORM_TYPES.boolean,
|
|
147
|
+
propType: PROP_TYPES.BOOLEAN
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
export const SEED_DATA_PROPS = {
|
|
151
|
+
style: {
|
|
152
|
+
group: GROUPS.basic,
|
|
153
|
+
label: "Style",
|
|
154
|
+
description: "Text Style",
|
|
155
|
+
editable: false,
|
|
156
|
+
required: false,
|
|
157
|
+
formType: FORM_TYPES.typeStyle,
|
|
158
|
+
propType: PROP_TYPES.THEME,
|
|
159
|
+
defaultValue: null
|
|
160
|
+
},
|
|
161
|
+
clearButtonMode: {
|
|
162
|
+
group: GROUPS.basic,
|
|
163
|
+
label: "Clear Button Mode",
|
|
164
|
+
description: "Enables a button within the textInput to clear the data entered",
|
|
165
|
+
editable: true,
|
|
166
|
+
required: false,
|
|
167
|
+
options: ["never", "while-editing", "unless-editing", "always"],
|
|
168
|
+
defaultValue: null,
|
|
169
|
+
formType: FORM_TYPES.flatArray,
|
|
170
|
+
propType: PROP_TYPES.STRING
|
|
171
|
+
},
|
|
172
|
+
clearTextOnFocus: {
|
|
173
|
+
group: GROUPS.basic,
|
|
174
|
+
label: "Clear Text on Focus",
|
|
175
|
+
description: "If true, clears the text field automatically when its focused.",
|
|
176
|
+
editable: true,
|
|
177
|
+
required: false,
|
|
178
|
+
defaultValue: null,
|
|
179
|
+
formType: FORM_TYPES.boolean,
|
|
180
|
+
propType: PROP_TYPES.BOOLEAN
|
|
181
|
+
},
|
|
182
|
+
enablesReturnKeyAutomatically: {
|
|
183
|
+
group: GROUPS.basic,
|
|
184
|
+
label: "Enables Return Key Automatically",
|
|
185
|
+
description: "If true, the keyboard disables the return key when there is no text and automatically enables it when there is (Default: false)",
|
|
186
|
+
editable: true,
|
|
187
|
+
required: false,
|
|
188
|
+
defaultValue: null,
|
|
189
|
+
formType: FORM_TYPES.boolean,
|
|
190
|
+
propType: PROP_TYPES.BOOLEAN
|
|
191
|
+
},
|
|
192
|
+
underlineColorAndroid: {
|
|
193
|
+
group: GROUPS.basic,
|
|
194
|
+
label: "Underline color",
|
|
195
|
+
description: "(Android Only) The color of the underline(the line underneath the text when finished typing.",
|
|
196
|
+
editable: true,
|
|
197
|
+
required: false,
|
|
198
|
+
defaultValue: null,
|
|
199
|
+
formType: FORM_TYPES.color,
|
|
200
|
+
propType: PROP_TYPES.THEME
|
|
201
|
+
},
|
|
202
|
+
fieldName: { ...FIELD_NAME,
|
|
203
|
+
defaultValue: "numberInputValue",
|
|
204
|
+
handlerPropName: "onChangeText"
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
export const SEED_DATA = [{
|
|
208
|
+
name: "Number Input",
|
|
209
|
+
tag: "NumberInput",
|
|
210
|
+
description: "An input field that allows users to type in data.",
|
|
211
|
+
category: COMPONENT_TYPES.input,
|
|
212
|
+
preview_image_url: "https://res.cloudinary.com/altos/image/upload/draftbit/Jigsaw/TextInput.png",
|
|
213
|
+
supports_list_render: false,
|
|
214
|
+
layout: {
|
|
215
|
+
borderLeftWidth: 1,
|
|
216
|
+
borderRightWidth: 1,
|
|
217
|
+
borderTopWidth: 1,
|
|
218
|
+
borderBottomWidth: 1,
|
|
219
|
+
borderColor: "divider",
|
|
220
|
+
paddingLeft: 8,
|
|
221
|
+
paddingRight: 8,
|
|
222
|
+
paddingTop: 8,
|
|
223
|
+
paddingBottom: 8,
|
|
224
|
+
borderRadius: 8
|
|
225
|
+
},
|
|
226
|
+
triggers: [Triggers.OnChangeText],
|
|
227
|
+
props: { ...SEED_DATA_PROPS,
|
|
228
|
+
...NUMBER_INPUT_PROPS
|
|
229
|
+
}
|
|
230
|
+
}];
|
|
231
|
+
//# sourceMappingURL=NumberInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["GROUPS","COMPONENT_TYPES","FORM_TYPES","PROP_TYPES","FIELD_NAME","Triggers","NUMBER_INPUT_PROPS","allowFontScaling","group","advanced","label","description","editable","required","defaultValue","formType","boolean","propType","BOOLEAN","autoFocus","basic","caretHidden","contextMenuHidden","keyboardAppearance","options","flatArray","STRING","keyboardType","maxLength","min","step","precision","number","NUMBER","placeholder","string","placeholderTextColor","color","returnKeyLabel","returnKeyType","selectionColor","selectTextOnFocus","SEED_DATA_PROPS","style","typeStyle","THEME","clearButtonMode","clearTextOnFocus","enablesReturnKeyAutomatically","underlineColorAndroid","fieldName","handlerPropName","SEED_DATA","name","tag","category","input","preview_image_url","supports_list_render","layout","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","borderColor","paddingLeft","paddingRight","paddingTop","paddingBottom","borderRadius","triggers","OnChangeText","props"],"sources":["NumberInput.ts"],"sourcesContent":["import {\n GROUPS,\n COMPONENT_TYPES,\n FORM_TYPES,\n PROP_TYPES,\n FIELD_NAME,\n Triggers,\n} from \"@draftbit/types\";\n\nconst NUMBER_INPUT_PROPS = {\n allowFontScaling: {\n group: GROUPS.advanced,\n label: \"Allow Font Scaling\",\n description:\n \"Whether fonts should scale to respect Text Size in the user's accessibility settings. (Default: true)\",\n editable: true,\n required: false,\n defaultValue: null,\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n },\n autoFocus: {\n group: GROUPS.basic,\n label: \"Auto Focus\",\n description: \"Focuses the input on load in and brings up the keyboard\",\n editable: true,\n required: false,\n defaultValue: null,\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n },\n caretHidden: {\n group: GROUPS.advanced,\n label: \"Hide Caret\",\n description:\n \"Hides the caret(the line small line underneath each showing where you're editing/typing\",\n editable: true,\n required: false,\n defaultValue: null,\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n },\n contextMenuHidden: {\n group: GROUPS.advanced,\n label: \"Hide Context Menu\",\n description: \"Hides the system context menu (Default: false)\",\n editable: true,\n required: false,\n defaultValue: null,\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n },\n editable: {\n group: GROUPS.advanced,\n label: \"Editable\",\n description: \"If false, the text is not editable\",\n editable: true,\n required: false,\n defaultValue: true,\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n },\n keyboardAppearance: {\n group: GROUPS.advanced,\n label: \"Keyboard Appearance\",\n description: \"Determines the color of the keyboard.(iOS Only)\",\n editable: true,\n required: false,\n defaultValue: null,\n options: [\"default\", \"light\", \"dark\"],\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n },\n keyboardType: {\n group: GROUPS.advanced,\n label: \"Keyboard Type\",\n description: \"Determines what keyboard is given to the user.\",\n editable: true,\n required: false,\n defaultValue: null,\n options: [\"numeric\", \"numbers-and-punctuation\", \"number-pad\"],\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n },\n maxLength: {\n group: GROUPS.basic,\n label: \"Max Length\",\n description: \"Limits the input to a set number of characters.\",\n editable: true,\n required: false,\n defaultValue: null,\n min: 0,\n step: 1,\n precision: 0,\n formType: FORM_TYPES.number,\n propType: PROP_TYPES.NUMBER,\n },\n placeholder: {\n group: GROUPS.basic,\n label: \"Placeholder Text\",\n description: \"The text that is shown on load when no value is available.\",\n editable: true,\n required: false,\n defaultValue: \"Enter a number...\",\n formType: FORM_TYPES.string,\n propType: PROP_TYPES.STRING,\n },\n placeholderTextColor: {\n group: GROUPS.basic,\n label: \"Placeholder Text Color\",\n description: \"The color of the placeholder text.\",\n editable: true,\n required: false,\n defaultValue: null,\n formType: FORM_TYPES.color,\n propType: PROP_TYPES.STRING,\n },\n returnKeyLabel: {\n group: GROUPS.advanced,\n label: \"Return Key Label\",\n description:\n \"(Android Only) Sets the label on the return key (use this instead of rewturnKeyType)\",\n editable: true,\n required: false,\n defaultValue: null,\n formType: FORM_TYPES.string,\n propType: PROP_TYPES.STRING,\n },\n returnKeyType: {\n group: GROUPS.advanced,\n label: \"Return Key Type\",\n description: \"Determines how the return key should look like\",\n editable: true,\n required: false,\n defaultValue: null,\n options: [\n \"done\",\n \"go\",\n \"next\",\n \"search\",\n \"send\",\n \"none\",\n \"previous\",\n \"default\",\n \"emergency-call\",\n \"google\",\n \"join\",\n \"route\",\n \"yahoo\",\n ],\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n },\n selectionColor: {\n group: GROUPS.advanced,\n label: \"Selection Color\",\n description: \"Color of the highlighted portion when selecting.\",\n editable: true,\n required: false,\n defaultValue: null,\n formType: FORM_TYPES.color,\n propType: PROP_TYPES.STRING,\n },\n selectTextOnFocus: {\n group: GROUPS.advanced,\n label: \"Select Text on Focus\",\n description:\n \"If true, all the text will automatically be selected on focus\",\n editable: true,\n required: false,\n defaultValue: null,\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n },\n};\n\nexport const SEED_DATA_PROPS = {\n style: {\n group: GROUPS.basic,\n label: \"Style\",\n description: \"Text Style\",\n editable: false,\n required: false,\n formType: FORM_TYPES.typeStyle,\n propType: PROP_TYPES.THEME,\n defaultValue: null,\n },\n clearButtonMode: {\n group: GROUPS.basic,\n label: \"Clear Button Mode\",\n description:\n \"Enables a button within the textInput to clear the data entered\",\n editable: true,\n required: false,\n options: [\"never\", \"while-editing\", \"unless-editing\", \"always\"],\n defaultValue: null,\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n },\n clearTextOnFocus: {\n group: GROUPS.basic,\n label: \"Clear Text on Focus\",\n description:\n \"If true, clears the text field automatically when its focused.\",\n editable: true,\n required: false,\n defaultValue: null,\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n },\n enablesReturnKeyAutomatically: {\n group: GROUPS.basic,\n label: \"Enables Return Key Automatically\",\n description:\n \"If true, the keyboard disables the return key when there is no text and automatically enables it when there is (Default: false)\",\n editable: true,\n required: false,\n defaultValue: null,\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n },\n underlineColorAndroid: {\n group: GROUPS.basic,\n label: \"Underline color\",\n description:\n \"(Android Only) The color of the underline(the line underneath the text when finished typing.\",\n editable: true,\n required: false,\n defaultValue: null,\n formType: FORM_TYPES.color,\n propType: PROP_TYPES.THEME,\n },\n fieldName: {\n ...FIELD_NAME,\n defaultValue: \"numberInputValue\",\n handlerPropName: \"onChangeText\",\n },\n};\n\nexport const SEED_DATA = [\n {\n name: \"Number Input\",\n tag: \"NumberInput\",\n description: \"An input field that allows users to type in data.\",\n category: COMPONENT_TYPES.input,\n preview_image_url:\n \"https://res.cloudinary.com/altos/image/upload/draftbit/Jigsaw/TextInput.png\",\n supports_list_render: false,\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 ...SEED_DATA_PROPS,\n ...NUMBER_INPUT_PROPS,\n },\n },\n];\n"],"mappings":"AAAA,SACEA,MADF,EAEEC,eAFF,EAGEC,UAHF,EAIEC,UAJF,EAKEC,UALF,EAMEC,QANF,QAOO,iBAPP;AASA,MAAMC,kBAAkB,GAAG;EACzBC,gBAAgB,EAAE;IAChBC,KAAK,EAAER,MAAM,CAACS,QADE;IAEhBC,KAAK,EAAE,oBAFS;IAGhBC,W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NC,WAAW,EAAE,CANP;IAONC,YAAY,EAAE,CAPR;IAQNC,UAAU,EAAE,CARN;IASNC,aAAa,EAAE,CATT;IAUNC,YAAY,EAAE;EAVR,CARV;EAoBEC,QAAQ,EAAE,CAACjE,QAAQ,CAACkE,YAAV,CApBZ;EAqBEC,KAAK,EAAE,EACL,GAAG9B,eADE;IAEL,GAAGpC;EAFE;AArBT,CADuB,CAAlB"}
|
|
@@ -5,7 +5,18 @@ const SEED_DATA_PROPS = {
|
|
|
5
5
|
name: "accessibilityLabel",
|
|
6
6
|
label: "accessibilityLabel",
|
|
7
7
|
description: "Overrides the text that's read by the screen reader when the user interacts with the element. By default, the label is constructed by traversing all the children and accumulating all the Text nodes separated by space.",
|
|
8
|
-
editable:
|
|
8
|
+
editable: true,
|
|
9
|
+
required: false,
|
|
10
|
+
formType: FORM_TYPES.string,
|
|
11
|
+
propType: PROP_TYPES.STRING,
|
|
12
|
+
defaultValue: null
|
|
13
|
+
},
|
|
14
|
+
accessibilityHint: {
|
|
15
|
+
group: GROUPS.accessibility,
|
|
16
|
+
name: "accessibilityHint",
|
|
17
|
+
label: "accessibilityHint",
|
|
18
|
+
description: "An accessibility hint helps users understand what will happen when they perform an action on the accessibility element when that result is not clear from the accessibility label.",
|
|
19
|
+
editable: true,
|
|
9
20
|
required: false,
|
|
10
21
|
formType: FORM_TYPES.string,
|
|
11
22
|
propType: PROP_TYPES.STRING,
|
|
@@ -17,7 +28,7 @@ const SEED_DATA_PROPS = {
|
|
|
17
28
|
label: "accessibilityRole",
|
|
18
29
|
description: "Tells the screen reader to treat the currently focused on element as having a specific role.Possible values for AccessibilityRole is one of:\n'none' - The element has no role.\n'button' - The element should be treated as a button.\n'link' - The element should be treated as a link.\n'header' - The element is a header that divides content into sections.\n'search' - The element should be treated as a search field.\n'image' - The element should be treated as an image.\n'key' - The element should be treated like a keyboard key.\n'text' - The element should be treated as text.\n'summary' - The element provides app summary information.\n'imagebutton' - The element has the role of both an image and also a button.\n'adjustable' - The element allows adjustment over a range of values.\nOn iOS, these roles map to corresponding Accessibility Traits. Image button has the same functionality as if the trait was set to both 'image' and 'button'. See the Accessibility guide for more information.On Android, these roles have similar functionality on TalkBack as adding Accessibility Traits does on Voiceover in iOS",
|
|
19
30
|
options: ["none", "button", "link", "header", "search", "image", "key", "text", "summary", "imagebutton", "adjustable"],
|
|
20
|
-
editable:
|
|
31
|
+
editable: true,
|
|
21
32
|
required: false,
|
|
22
33
|
formType: FORM_TYPES.flatArray,
|
|
23
34
|
propType: PROP_TYPES.STRING,
|
|
@@ -27,8 +38,8 @@ const SEED_DATA_PROPS = {
|
|
|
27
38
|
group: GROUPS.accessibility,
|
|
28
39
|
name: "accessible",
|
|
29
40
|
label: "accessible",
|
|
30
|
-
description: "When set to true, indicates that the view is an accessibility element. The default value for a Text element is true.See the Accessibility guide for more information.",
|
|
31
|
-
editable:
|
|
41
|
+
description: "When set to true, indicates that the view is an accessibility element. The default value for a Text element is true. See the Accessibility guide for more information.",
|
|
42
|
+
editable: true,
|
|
32
43
|
required: false,
|
|
33
44
|
formType: FORM_TYPES.boolean,
|
|
34
45
|
propType: PROP_TYPES.BOOLEAN,
|
|
@@ -39,7 +50,7 @@ const SEED_DATA_PROPS = {
|
|
|
39
50
|
name: "adjustsFontSizeToFit",
|
|
40
51
|
label: "adjustsFontSizeToFit",
|
|
41
52
|
description: "Specifies whether fonts should be scaled down automatically to fit given style constraints.",
|
|
42
|
-
editable:
|
|
53
|
+
editable: true,
|
|
43
54
|
required: false,
|
|
44
55
|
formType: FORM_TYPES.boolean,
|
|
45
56
|
propType: PROP_TYPES.BOOLEAN,
|
|
@@ -50,7 +61,7 @@ const SEED_DATA_PROPS = {
|
|
|
50
61
|
name: "allowFontScaling",
|
|
51
62
|
label: "allowFontScaling",
|
|
52
63
|
description: "Specifies whether fonts should scale to respect Text Size accessibility settings. The default is true.",
|
|
53
|
-
editable:
|
|
64
|
+
editable: true,
|
|
54
65
|
required: false,
|
|
55
66
|
formType: FORM_TYPES.boolean,
|
|
56
67
|
propType: PROP_TYPES.BOOLEAN,
|
|
@@ -60,9 +71,9 @@ const SEED_DATA_PROPS = {
|
|
|
60
71
|
group: GROUPS.advanced,
|
|
61
72
|
name: "dataDetectorType",
|
|
62
73
|
label: "dataDetectorType",
|
|
63
|
-
description: "Determines the types of data converted to clickable URLs in the text element. By default no data types are detected.You can provide only one type.Possible values for dataDetectorType are:\n'phoneNumber'\n'link'\n'email'\n'none'\n'all'\n",
|
|
74
|
+
description: "Determines the types of data converted to clickable URLs in the text element. By default no data types are detected. You can provide only one type. Possible values for dataDetectorType are:\n'phoneNumber'\n'link'\n'email'\n'none'\n'all'\n",
|
|
64
75
|
options: ["phoneNumber", "link", "email", "none", "all"],
|
|
65
|
-
editable:
|
|
76
|
+
editable: true,
|
|
66
77
|
required: false,
|
|
67
78
|
formType: FORM_TYPES.flatArray,
|
|
68
79
|
propType: PROP_TYPES.STRING,
|
|
@@ -73,7 +84,7 @@ const SEED_DATA_PROPS = {
|
|
|
73
84
|
name: "disabled",
|
|
74
85
|
label: "disabled",
|
|
75
86
|
description: "Specifies the disabled state of the text view for testing purposes",
|
|
76
|
-
editable:
|
|
87
|
+
editable: true,
|
|
77
88
|
required: false,
|
|
78
89
|
formType: FORM_TYPES.boolean,
|
|
79
90
|
propType: PROP_TYPES.BOOLEAN,
|
|
@@ -96,25 +107,21 @@ const SEED_DATA_PROPS = {
|
|
|
96
107
|
name: "maxFontSizeMultiplier",
|
|
97
108
|
label: "maxFontSizeMultiplier",
|
|
98
109
|
description: "Specifies largest possible scale a font can reach when allowFontScaling is enabled. Possible values:\nnull/undefined (default): inherit from the parent node or the global default (0)\n0: no max, ignore parent/global default\n>= 1: sets the maxFontSizeMultiplier of this node to this value\n",
|
|
99
|
-
editable:
|
|
110
|
+
editable: true,
|
|
100
111
|
required: false,
|
|
101
112
|
formType: FORM_TYPES.number,
|
|
102
113
|
propType: PROP_TYPES.NUMBER,
|
|
103
114
|
defaultValue: null
|
|
104
115
|
},
|
|
105
|
-
|
|
106
|
-
group: GROUPS.
|
|
107
|
-
name: "
|
|
108
|
-
label: "
|
|
109
|
-
description: "
|
|
110
|
-
editable:
|
|
116
|
+
nativeID: {
|
|
117
|
+
group: GROUPS.accessibility,
|
|
118
|
+
name: "nativeID",
|
|
119
|
+
label: "nativeID",
|
|
120
|
+
description: "Used to locate this view from native code.",
|
|
121
|
+
editable: true,
|
|
111
122
|
required: false,
|
|
112
|
-
formType: FORM_TYPES.
|
|
113
|
-
propType: PROP_TYPES.
|
|
114
|
-
min: 0.01,
|
|
115
|
-
step: 0.01,
|
|
116
|
-
precision: 2,
|
|
117
|
-
max: 1.0,
|
|
123
|
+
formType: FORM_TYPES.string,
|
|
124
|
+
propType: PROP_TYPES.STRING,
|
|
118
125
|
defaultValue: null
|
|
119
126
|
},
|
|
120
127
|
numberOfLines: {
|
|
@@ -135,7 +142,7 @@ const SEED_DATA_PROPS = {
|
|
|
135
142
|
name: "selectable",
|
|
136
143
|
label: "selectable",
|
|
137
144
|
description: "Lets the user select text, to use the native copy and paste functionality.",
|
|
138
|
-
editable:
|
|
145
|
+
editable: true,
|
|
139
146
|
required: false,
|
|
140
147
|
formType: FORM_TYPES.boolean,
|
|
141
148
|
propType: PROP_TYPES.BOOLEAN,
|
|
@@ -146,7 +153,7 @@ const SEED_DATA_PROPS = {
|
|
|
146
153
|
name: "selectionColor",
|
|
147
154
|
label: "selectionColor",
|
|
148
155
|
description: "The highlight color of the text.",
|
|
149
|
-
editable:
|
|
156
|
+
editable: true,
|
|
150
157
|
required: false,
|
|
151
158
|
formType: FORM_TYPES.color,
|
|
152
159
|
propType: PROP_TYPES.THEME,
|
|
@@ -157,7 +164,7 @@ const SEED_DATA_PROPS = {
|
|
|
157
164
|
name: "suppressHighlighting",
|
|
158
165
|
label: "suppressHighlighting",
|
|
159
166
|
description: "When true, no visual change is made when text is pressed down. By default, a gray oval highlights the text on press down.",
|
|
160
|
-
editable:
|
|
167
|
+
editable: true,
|
|
161
168
|
required: false,
|
|
162
169
|
formType: FORM_TYPES.boolean,
|
|
163
170
|
propType: PROP_TYPES.BOOLEAN,
|
|
@@ -169,7 +176,7 @@ const SEED_DATA_PROPS = {
|
|
|
169
176
|
label: "textBreakStrategy",
|
|
170
177
|
description: "Set text break strategy on Android API Level 23+, possible values are simple, highQuality, balanced The default value is highQuality.",
|
|
171
178
|
options: ["simple", "highQuality", "balanced"],
|
|
172
|
-
editable:
|
|
179
|
+
editable: true,
|
|
173
180
|
required: false,
|
|
174
181
|
formType: FORM_TYPES.flatArray,
|
|
175
182
|
propType: PROP_TYPES.STRING,
|