@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":["STEP_STATUS","CURRENT","FINISHED","UNFINISHED","StepIndicator","Component","constructor","props","stepCount","direction","progressBarBackgroundStyle","backgroundColor","state","customStyles","separatorUnFinishedColor","position","left","width","separatorStrokeWidth","top","height","bottom","separatorStrokeUnfinishedWidth","right","event","setState","progressBarSize","nativeEvent","layout","onCurrentPositionChanged","currentPosition","progressBarStyle","separatorFinishedColor","separatorStrokeFinishedWidth","progressAnim","steps","push","stepPressed","styles","stepContainer","flexDirection","renderStep","stepIndicatorContainer","currentStepIndicatorSize","labels","renderLabel","labelViews","map","label","index","selectedStepLabelStyle","color","currentStepLabelColor","labelColor","stepLabelItem","stepStatus","getStepStatus","stepLabel","fontSize","labelSize","fontFamily","labelFontFamily","stepLabelsContainer","paddingHorizontal","paddingVertical","alignItems","labelAlign","renderStepIndicator","stepStyle","indicatorLabelStyle","stepIndicatorCurrentColor","borderWidth","currentStepStrokeWidth","borderColor","stepStrokeCurrentColor","sizeAnim","borderRadius","borderRadiusAnim","currentStepIndicatorLabelFontSize","stepIndicatorLabelCurrentColor","stepIndicatorFinishedColor","stepStrokeWidth","stepStrokeFinishedColor","stepIndicatorSize","stepIndicatorLabelFontSize","stepIndicatorLabelFinishedColor","stepIndicatorUnFinishedColor","stepStrokeUnFinishedColor","overflow","stepIndicatorLabelUnFinishedColor","step","stepPosition","animateToPosition","setValue","Animated","sequence","timing","toValue","duration","parallel","start","defaultStyles","Object","assign","Value","onPress","render","container","flex","renderProgressBarBackground","renderProgressBar","renderStepLabels","componentDidUpdate","prevProps","StyleSheet","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":";;;;;;;AACA;;AACA;;;;;;;;AAQA,MAAMA,WAAW,GAAG;EAClBC,OAAO,EAAE,SADS;EAElBC,QAAQ,EAAE,UAFQ;EAGlBC,UAAU,EAAE;AAHM,CAApB;;AA+Ce,MAAMC,aAAN,SAA4BC,gBAA5B,CAAoD;EACjEC,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,UAAlB,EAA8B;QAC5BC,0BAA0B,GAAG;UAC3BC,eAAe,EAAE,KAAKC,KAAL,CAAWC,YAAX,CAAwBC,wBADd;UAE3BC,QAAQ,EAAE,UAFiB;UAG3B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YAAY,EAAE,EAHa;EAI3BJ,SAAS,EAAE;AAJgB,CAA7B"}
|
|
1
|
+
{"version":3,"names":["STEP_STATUS","CURRENT","FINISHED","UNFINISHED","StepIndicator","Component","constructor","props","stepCount","direction","progressBarBackgroundStyle","backgroundColor","state","customStyles","separatorUnFinishedColor","position","left","width","separatorStrokeWidth","top","height","bottom","separatorStrokeUnfinishedWidth","right","event","setState","progressBarSize","nativeEvent","layout","onCurrentPositionChanged","currentPosition","progressBarStyle","separatorFinishedColor","separatorStrokeFinishedWidth","progressAnim","steps","push","stepPressed","styles","stepContainer","flexDirection","renderStep","stepIndicatorContainer","currentStepIndicatorSize","labels","renderLabel","labelViews","map","label","index","selectedStepLabelStyle","color","currentStepLabelColor","labelColor","stepLabelItem","stepStatus","getStepStatus","stepLabel","fontSize","labelSize","fontFamily","labelFontFamily","stepLabelsContainer","paddingHorizontal","paddingVertical","alignItems","labelAlign","renderStepIndicator","stepStyle","indicatorLabelStyle","stepIndicatorCurrentColor","borderWidth","currentStepStrokeWidth","borderColor","stepStrokeCurrentColor","sizeAnim","borderRadius","borderRadiusAnim","currentStepIndicatorLabelFontSize","stepIndicatorLabelCurrentColor","stepIndicatorFinishedColor","stepStrokeWidth","stepStrokeFinishedColor","stepIndicatorSize","stepIndicatorLabelFontSize","stepIndicatorLabelFinishedColor","stepIndicatorUnFinishedColor","stepStrokeUnFinishedColor","overflow","stepIndicatorLabelUnFinishedColor","step","stepPosition","animateToPosition","setValue","Animated","sequence","timing","toValue","duration","parallel","start","defaultStyles","Object","assign","Value","onPress","render","container","flex","renderProgressBarBackground","renderProgressBar","renderStepLabels","componentDidUpdate","prevProps","StyleSheet","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":";;;;;;;AACA;;AACA;;;;;;;;AAQA,MAAMA,WAAW,GAAG;EAClBC,OAAO,EAAE,SADS;EAElBC,QAAQ,EAAE,UAFQ;EAGlBC,UAAU,EAAE;AAHM,CAApB;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E;EAJH,CAlBgB;EAwB/B3D,SAAS,EAAE;IACTC,QAAQ,EAAE,EADD;IAET4D,SAAS,EAAE,QAFF;IAGTC,UAAU,EAAE;EAHH,CAxBoB;EA6B/BjE,aAAa,EAAE;IACbsD,IAAI,EAAE,CADO;IAEb3C,UAAU,EAAE,QAFC;IAGbmD,cAAc,EAAE;EAHH;AA7BgB,CAAlB,CAAf;;AAoCAhH,aAAa,CAACoH,YAAd,GAA6B;EAC3B1F,eAAe,EAAE,CADU;EAE3BtB,SAAS,EAAE,CAFgB;EAG3BK,YAAY,EAAE,EAHa;EAI3BJ,SAAS,EAAE;AAJgB,CAA7B"}
|
|
@@ -38,7 +38,7 @@ const Stepper = _ref => {
|
|
|
38
38
|
},
|
|
39
39
|
Icon
|
|
40
40
|
} = _ref;
|
|
41
|
-
const [value, setValue] = (0, _react.useState)(defaultValue
|
|
41
|
+
const [value, setValue] = (0, _react.useState)(defaultValue !== null && defaultValue !== void 0 ? defaultValue : 0);
|
|
42
42
|
|
|
43
43
|
const isValidValue = valueArg => valueArg >= min && valueArg <= max;
|
|
44
44
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Stepper","min","Infinity","max","value","valueProp","defaultValue","style","typeStyle","iconSize","iconColor","onChange","theme","colors","typography","Icon","setValue","useState","isValidValue","valueArg","handlePlusOrMinus","type","newValue","useEffect","isNumber","flexDirection","opacity","body1","textAlign","alignSelf","color","medium","marginHorizontal","withTheme"],"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;;AACA;;AACA;;AAEA;;AAGA;;;;;;;;AAeA,MAAMA,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,IAAoB,IAAAC,eAAA,EAASX,
|
|
1
|
+
{"version":3,"names":["Stepper","min","Infinity","max","value","valueProp","defaultValue","style","typeStyle","iconSize","iconColor","onChange","theme","colors","typography","Icon","setValue","useState","isValidValue","valueArg","handlePlusOrMinus","type","newValue","useEffect","isNumber","flexDirection","opacity","body1","textAlign","alignSelf","color","medium","marginHorizontal","withTheme"],"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;;AACA;;AACA;;AAEA;;AAGA;;;;;;;;AAeA,MAAMA,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,IAAoB,IAAAC,eAAA,EAASX,YAAT,aAASA,YAAT,cAASA,YAAT,GAAyB,CAAzB,CAA1B;;EAEA,MAAMY,YAAY,GAAIC,QAAD,IAAsBA,QAAQ,IAAIlB,GAAZ,IAAmBkB,QAAQ,IAAIhB,GAA1E;;EAEA,MAAMiB,iBAAiB,GAAIC,IAAD,IAA4B;IACpD,MAAMC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O,EAAE,MAAMK,iBAAiB,CAAC,MAAD,CAHlC;IAIE,IAAI,EAAEX,QAJR;IAKE,KAAK,EAAEC,SALT;IAME,QAAQ,EAAEN,KAAK,KAAKD,GANtB;IAOE,KAAK,EAAE;MAAEuB,OAAO,EAAEtB,KAAK,KAAKD,GAAV,GAAgB,GAAhB,GAAsB;IAAjC;EAPT,EA1BF,CADF;AAsCD,CA5ED;;eA8Ee,IAAA8B,kBAAA,EAAUjC,OAAV,C"}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SEED_DATA_PROPS = exports.SEED_DATA = void 0;
|
|
7
|
+
|
|
8
|
+
var _types = require("@draftbit/types");
|
|
9
|
+
|
|
10
|
+
const NUMBER_INPUT_PROPS = {
|
|
11
|
+
allowFontScaling: {
|
|
12
|
+
group: _types.GROUPS.advanced,
|
|
13
|
+
label: "Allow Font Scaling",
|
|
14
|
+
description: "Whether fonts should scale to respect Text Size in the user's accessibility settings. (Default: true)",
|
|
15
|
+
editable: true,
|
|
16
|
+
required: false,
|
|
17
|
+
defaultValue: null,
|
|
18
|
+
formType: _types.FORM_TYPES.boolean,
|
|
19
|
+
propType: _types.PROP_TYPES.BOOLEAN
|
|
20
|
+
},
|
|
21
|
+
autoFocus: {
|
|
22
|
+
group: _types.GROUPS.basic,
|
|
23
|
+
label: "Auto Focus",
|
|
24
|
+
description: "Focuses the input on load in and brings up the keyboard",
|
|
25
|
+
editable: true,
|
|
26
|
+
required: false,
|
|
27
|
+
defaultValue: null,
|
|
28
|
+
formType: _types.FORM_TYPES.boolean,
|
|
29
|
+
propType: _types.PROP_TYPES.BOOLEAN
|
|
30
|
+
},
|
|
31
|
+
caretHidden: {
|
|
32
|
+
group: _types.GROUPS.advanced,
|
|
33
|
+
label: "Hide Caret",
|
|
34
|
+
description: "Hides the caret(the line small line underneath each showing where you're editing/typing",
|
|
35
|
+
editable: true,
|
|
36
|
+
required: false,
|
|
37
|
+
defaultValue: null,
|
|
38
|
+
formType: _types.FORM_TYPES.boolean,
|
|
39
|
+
propType: _types.PROP_TYPES.BOOLEAN
|
|
40
|
+
},
|
|
41
|
+
contextMenuHidden: {
|
|
42
|
+
group: _types.GROUPS.advanced,
|
|
43
|
+
label: "Hide Context Menu",
|
|
44
|
+
description: "Hides the system context menu (Default: false)",
|
|
45
|
+
editable: true,
|
|
46
|
+
required: false,
|
|
47
|
+
defaultValue: null,
|
|
48
|
+
formType: _types.FORM_TYPES.boolean,
|
|
49
|
+
propType: _types.PROP_TYPES.BOOLEAN
|
|
50
|
+
},
|
|
51
|
+
editable: {
|
|
52
|
+
group: _types.GROUPS.advanced,
|
|
53
|
+
label: "Editable",
|
|
54
|
+
description: "If false, the text is not editable",
|
|
55
|
+
editable: true,
|
|
56
|
+
required: false,
|
|
57
|
+
defaultValue: true,
|
|
58
|
+
formType: _types.FORM_TYPES.boolean,
|
|
59
|
+
propType: _types.PROP_TYPES.BOOLEAN
|
|
60
|
+
},
|
|
61
|
+
keyboardAppearance: {
|
|
62
|
+
group: _types.GROUPS.advanced,
|
|
63
|
+
label: "Keyboard Appearance",
|
|
64
|
+
description: "Determines the color of the keyboard.(iOS Only)",
|
|
65
|
+
editable: true,
|
|
66
|
+
required: false,
|
|
67
|
+
defaultValue: null,
|
|
68
|
+
options: ["default", "light", "dark"],
|
|
69
|
+
formType: _types.FORM_TYPES.flatArray,
|
|
70
|
+
propType: _types.PROP_TYPES.STRING
|
|
71
|
+
},
|
|
72
|
+
keyboardType: {
|
|
73
|
+
group: _types.GROUPS.advanced,
|
|
74
|
+
label: "Keyboard Type",
|
|
75
|
+
description: "Determines what keyboard is given to the user.",
|
|
76
|
+
editable: true,
|
|
77
|
+
required: false,
|
|
78
|
+
defaultValue: null,
|
|
79
|
+
options: ["numeric", "numbers-and-punctuation", "number-pad"],
|
|
80
|
+
formType: _types.FORM_TYPES.flatArray,
|
|
81
|
+
propType: _types.PROP_TYPES.STRING
|
|
82
|
+
},
|
|
83
|
+
maxLength: {
|
|
84
|
+
group: _types.GROUPS.basic,
|
|
85
|
+
label: "Max Length",
|
|
86
|
+
description: "Limits the input to a set number of characters.",
|
|
87
|
+
editable: true,
|
|
88
|
+
required: false,
|
|
89
|
+
defaultValue: null,
|
|
90
|
+
min: 0,
|
|
91
|
+
step: 1,
|
|
92
|
+
precision: 0,
|
|
93
|
+
formType: _types.FORM_TYPES.number,
|
|
94
|
+
propType: _types.PROP_TYPES.NUMBER
|
|
95
|
+
},
|
|
96
|
+
placeholder: {
|
|
97
|
+
group: _types.GROUPS.basic,
|
|
98
|
+
label: "Placeholder Text",
|
|
99
|
+
description: "The text that is shown on load when no value is available.",
|
|
100
|
+
editable: true,
|
|
101
|
+
required: false,
|
|
102
|
+
defaultValue: "Enter a number...",
|
|
103
|
+
formType: _types.FORM_TYPES.string,
|
|
104
|
+
propType: _types.PROP_TYPES.STRING
|
|
105
|
+
},
|
|
106
|
+
placeholderTextColor: {
|
|
107
|
+
group: _types.GROUPS.basic,
|
|
108
|
+
label: "Placeholder Text Color",
|
|
109
|
+
description: "The color of the placeholder text.",
|
|
110
|
+
editable: true,
|
|
111
|
+
required: false,
|
|
112
|
+
defaultValue: null,
|
|
113
|
+
formType: _types.FORM_TYPES.color,
|
|
114
|
+
propType: _types.PROP_TYPES.STRING
|
|
115
|
+
},
|
|
116
|
+
returnKeyLabel: {
|
|
117
|
+
group: _types.GROUPS.advanced,
|
|
118
|
+
label: "Return Key Label",
|
|
119
|
+
description: "(Android Only) Sets the label on the return key (use this instead of rewturnKeyType)",
|
|
120
|
+
editable: true,
|
|
121
|
+
required: false,
|
|
122
|
+
defaultValue: null,
|
|
123
|
+
formType: _types.FORM_TYPES.string,
|
|
124
|
+
propType: _types.PROP_TYPES.STRING
|
|
125
|
+
},
|
|
126
|
+
returnKeyType: {
|
|
127
|
+
group: _types.GROUPS.advanced,
|
|
128
|
+
label: "Return Key Type",
|
|
129
|
+
description: "Determines how the return key should look like",
|
|
130
|
+
editable: true,
|
|
131
|
+
required: false,
|
|
132
|
+
defaultValue: null,
|
|
133
|
+
options: ["done", "go", "next", "search", "send", "none", "previous", "default", "emergency-call", "google", "join", "route", "yahoo"],
|
|
134
|
+
formType: _types.FORM_TYPES.flatArray,
|
|
135
|
+
propType: _types.PROP_TYPES.STRING
|
|
136
|
+
},
|
|
137
|
+
selectionColor: {
|
|
138
|
+
group: _types.GROUPS.advanced,
|
|
139
|
+
label: "Selection Color",
|
|
140
|
+
description: "Color of the highlighted portion when selecting.",
|
|
141
|
+
editable: true,
|
|
142
|
+
required: false,
|
|
143
|
+
defaultValue: null,
|
|
144
|
+
formType: _types.FORM_TYPES.color,
|
|
145
|
+
propType: _types.PROP_TYPES.STRING
|
|
146
|
+
},
|
|
147
|
+
selectTextOnFocus: {
|
|
148
|
+
group: _types.GROUPS.advanced,
|
|
149
|
+
label: "Select Text on Focus",
|
|
150
|
+
description: "If true, all the text will automatically be selected on focus",
|
|
151
|
+
editable: true,
|
|
152
|
+
required: false,
|
|
153
|
+
defaultValue: null,
|
|
154
|
+
formType: _types.FORM_TYPES.boolean,
|
|
155
|
+
propType: _types.PROP_TYPES.BOOLEAN
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
const SEED_DATA_PROPS = {
|
|
159
|
+
style: {
|
|
160
|
+
group: _types.GROUPS.basic,
|
|
161
|
+
label: "Style",
|
|
162
|
+
description: "Text Style",
|
|
163
|
+
editable: false,
|
|
164
|
+
required: false,
|
|
165
|
+
formType: _types.FORM_TYPES.typeStyle,
|
|
166
|
+
propType: _types.PROP_TYPES.THEME,
|
|
167
|
+
defaultValue: null
|
|
168
|
+
},
|
|
169
|
+
clearButtonMode: {
|
|
170
|
+
group: _types.GROUPS.basic,
|
|
171
|
+
label: "Clear Button Mode",
|
|
172
|
+
description: "Enables a button within the textInput to clear the data entered",
|
|
173
|
+
editable: true,
|
|
174
|
+
required: false,
|
|
175
|
+
options: ["never", "while-editing", "unless-editing", "always"],
|
|
176
|
+
defaultValue: null,
|
|
177
|
+
formType: _types.FORM_TYPES.flatArray,
|
|
178
|
+
propType: _types.PROP_TYPES.STRING
|
|
179
|
+
},
|
|
180
|
+
clearTextOnFocus: {
|
|
181
|
+
group: _types.GROUPS.basic,
|
|
182
|
+
label: "Clear Text on Focus",
|
|
183
|
+
description: "If true, clears the text field automatically when its focused.",
|
|
184
|
+
editable: true,
|
|
185
|
+
required: false,
|
|
186
|
+
defaultValue: null,
|
|
187
|
+
formType: _types.FORM_TYPES.boolean,
|
|
188
|
+
propType: _types.PROP_TYPES.BOOLEAN
|
|
189
|
+
},
|
|
190
|
+
enablesReturnKeyAutomatically: {
|
|
191
|
+
group: _types.GROUPS.basic,
|
|
192
|
+
label: "Enables Return Key Automatically",
|
|
193
|
+
description: "If true, the keyboard disables the return key when there is no text and automatically enables it when there is (Default: false)",
|
|
194
|
+
editable: true,
|
|
195
|
+
required: false,
|
|
196
|
+
defaultValue: null,
|
|
197
|
+
formType: _types.FORM_TYPES.boolean,
|
|
198
|
+
propType: _types.PROP_TYPES.BOOLEAN
|
|
199
|
+
},
|
|
200
|
+
underlineColorAndroid: {
|
|
201
|
+
group: _types.GROUPS.basic,
|
|
202
|
+
label: "Underline color",
|
|
203
|
+
description: "(Android Only) The color of the underline(the line underneath the text when finished typing.",
|
|
204
|
+
editable: true,
|
|
205
|
+
required: false,
|
|
206
|
+
defaultValue: null,
|
|
207
|
+
formType: _types.FORM_TYPES.color,
|
|
208
|
+
propType: _types.PROP_TYPES.THEME
|
|
209
|
+
},
|
|
210
|
+
fieldName: { ..._types.FIELD_NAME,
|
|
211
|
+
defaultValue: "numberInputValue",
|
|
212
|
+
handlerPropName: "onChangeText"
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
exports.SEED_DATA_PROPS = SEED_DATA_PROPS;
|
|
216
|
+
const SEED_DATA = [{
|
|
217
|
+
name: "Number Input",
|
|
218
|
+
tag: "NumberInput",
|
|
219
|
+
description: "An input field that allows users to type in data.",
|
|
220
|
+
category: _types.COMPONENT_TYPES.input,
|
|
221
|
+
preview_image_url: "https://res.cloudinary.com/altos/image/upload/draftbit/Jigsaw/TextInput.png",
|
|
222
|
+
supports_list_render: false,
|
|
223
|
+
layout: {
|
|
224
|
+
borderLeftWidth: 1,
|
|
225
|
+
borderRightWidth: 1,
|
|
226
|
+
borderTopWidth: 1,
|
|
227
|
+
borderBottomWidth: 1,
|
|
228
|
+
borderColor: "divider",
|
|
229
|
+
paddingLeft: 8,
|
|
230
|
+
paddingRight: 8,
|
|
231
|
+
paddingTop: 8,
|
|
232
|
+
paddingBottom: 8,
|
|
233
|
+
borderRadius: 8
|
|
234
|
+
},
|
|
235
|
+
triggers: [_types.Triggers.OnChangeText],
|
|
236
|
+
props: { ...SEED_DATA_PROPS,
|
|
237
|
+
...NUMBER_INPUT_PROPS
|
|
238
|
+
}
|
|
239
|
+
}];
|
|
240
|
+
exports.SEED_DATA = SEED_DATA;
|
|
241
|
+
//# sourceMappingURL=NumberInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NUMBER_INPUT_PROPS","allowFontScaling","group","GROUPS","advanced","label","description","editable","required","defaultValue","formType","FORM_TYPES","boolean","propType","PROP_TYPES","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","FIELD_NAME","handlerPropName","SEED_DATA","name","tag","category","COMPONENT_TYPES","input","preview_image_url","supports_list_render","layout","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","borderColor","paddingLeft","paddingRight","paddingTop","paddingBottom","borderRadius","triggers","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;;AASA,MAAMA,kBAAkB,GAAG;EACzBC,gBAAgB,EAAE;IAChBC,KAAK,EAAEC,aAAA,CAAOC,QADE;IAEhBC,KAAK,EAAE,oBAFS;IAGhBC,WAAW,EACT,uGAJc;IAKhBC,QAAQ,EAAE,IALM;IAMhBC,QAAQ,EAAE,KANM;IAOhBC,YAAY,EAAE,IAPE;IAQhBC,QAAQ,EAAEC,iBAAA,CAAWC,OARL;IAShBC,QAAQ,EAAEC,iBAAA,CAAWC;EATL,CADO;EAYzBC,SAAS,EAAE;IACTd,KAAK,EAAEC,aAAA,CAAOc,KADL;IAETZ,KAAK,EAAE,YAFE;IAGTC,WAAW,EAAE,yDAHJ;IAITC,QAAQ,EAAE,IAJD;IAKTC,QAAQ,EAAE,KALD;IAMTC,YAAY,EAAE,IANL;IAOTC,QAAQ,EAAEC,iBAAA,CAAWC,OAPZ;IAQTC,QAAQ,EAAEC,iBAAA,CAAWC;EARZ,CAZc;EAsBzBG,WAAW,EAAE;IACXhB,KAAK,EAAEC,aAAA,CAAOC,QADH;IAEXC,KAAK,EAAE,YAFI;IAGXC,WAAW,EACT,yFAJS;IAKXC,QAAQ,EAAE,IALC;IAMXC,QAAQ,EAAE,KANC;IAOXC,YAAY,EAAE,IAPH;IAQXC,QAAQ,EAAEC,iBAAA,CAAWC,OARV;IASXC,QAAQ,EAAEC,iBAAA,CAAWC;EATV,CAtBY;EAiCzBI,iBAAiB,EAAE;IACjBjB,KAAK,EAAEC,aAAA,CAAOC,QADG;IAEjBC,KAAK,EAAE,mBAFU;IAGjBC,WAAW,EAAE,gDAHI;IAIjBC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EATA,CA7CM;EAwD7BK,SAAS,EAAE,EACT,GAAGC,iBADM;IAETvC,YAAY,EAAE,kBAFL;IAGTwC,eAAe,EAAE;EAHR;AAxDkB,CAAxB;;AA+DA,MAAMC,SAAS,GAAG,CACvB;EACEC,IAAI,EAAE,cADR;EAEEC,GAAG,EAAE,aAFP;EAGE9C,WAAW,EAAE,mDAHf;EAIE+C,QAAQ,EAAEC,sBAAA,CAAgBC,KAJ5B;EAKEC,iBAAiB,EACf,6EANJ;EAOEC,oBAAoB,EAAE,KAPxB;EAQEC,MAAM,EAAE;IACNC,eAAe,EAAE,CADX;IAENC,gBAAgB,EAAE,CAFZ;IAGNC,cAAc,EAAE,CAHV;IAINC,iBAAiB,EAAE,CAJb;IAKNC,WAAW,EAAE,SALP;IAMNC,WAAW,EAAE,CANP;IAONC,YAAY,EAAE,CAPR;IAQNC,UAAU,EAAE,CARN;IASNC,aAAa,EAAE,CATT;IAUNC,YAAY,EAAE;EAVR,CARV;EAoBEC,QAAQ,EAAE,CAACC,eAAA,CAASC,YAAV,CApBZ;EAqBEC,KAAK,EAAE,EACL,GAAGjC,eADE;IAEL,GAAGvC;EAFE;AArBT,CADuB,CAAlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SEED_DATA","name","tag","category","COMPONENT_TYPES","input","triggers","Triggers","OnPress","props","value","createTextProp","label","description","defaultValue","required","color","createColorProp","group","GROUPS","basic","unselectedColor","disabled","createBoolProp","size","createNumberProp","min","max","step","precision","selectedIcon","createIconProp","unselectedIcon"],"sources":["RadioButton.
|
|
1
|
+
{"version":3,"names":["SEED_DATA","name","tag","category","COMPONENT_TYPES","input","triggers","Triggers","OnPress","props","value","createTextProp","label","description","defaultValue","required","color","createColorProp","group","GROUPS","basic","unselectedColor","disabled","createBoolProp","size","createNumberProp","min","max","step","precision","selectedIcon","createIconProp","unselectedIcon"],"sources":["RadioButton.js"],"sourcesContent":["import { GROUPS, COMPONENT_TYPES, createBoolProp, createColorProp, createNumberProp, createIconProp, createTextProp, Triggers, } from \"@draftbit/types\";\nexport const SEED_DATA = {\n name: \"Radio Button\",\n tag: \"RadioButton\",\n category: COMPONENT_TYPES.input,\n triggers: [Triggers.OnPress],\n props: {\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 disabled: createBoolProp({\n label: \"Disabled\",\n description: \"Whether radio button is disabled\",\n }),\n size: createNumberProp({\n group: GROUPS.basic,\n label: \"Size\",\n description: \"Specifies the size of the button\",\n defaultValue: 24,\n min: 16,\n max: 128,\n step: 1,\n precision: 0,\n }),\n selectedIcon: createIconProp({\n label: \"Selected Icon\",\n description: \"Icon to show when the radio button is selected\",\n defaultValue: \"MaterialIcons/radio-button-checked\",\n }),\n unselectedIcon: createIconProp({\n label: \"Unselected Icon\",\n description: \"Icon to show when the radio button is unselected\",\n defaultValue: \"MaterialIcons/radio-button-unchecked\",\n }),\n },\n};\n"],"mappings":";;;;;;;AAAA;;AACO,MAAMA,SAAS,GAAG;EACrBC,IAAI,EAAE,cADe;EAErBC,GAAG,EAAE,aAFgB;EAGrBC,QAAQ,EAAEC,sBAAA,CAAgBC,KAHL;EAIrBC,QAAQ,EAAE,CAACC,eAAA,CAASC,OAAV,CAJW;EAKrBC,KAAK,EAAE;IACHC,KAAK,EAAE,IAAAC,qBAAA,EAAe;MAClBC,KAAK,EAAE,OADW;MAElBC,WAAW,EAAE,2BAFK;MAGlBC,YAAY,EAAE,IAHI;MAIlBC,QAAQ,EAAE;IAJQ,CAAf,CADJ;IAOHC,KAAK,EAAE,IAAAC,sBAAA,EAAgB;MACnBC,KAAK,EAAEC,aAAA,CAAOC,KADK;MAEnBP,WAAW,EAAE,sBAFM;MAGnBC,YAAY,EAAE;IAHK,CAAhB,CAPJ;IAYHO,eAAe,EAAE,IAAAJ,sBAAA,EAAgB;MAC7BC,KAAK,EAAEC,aAAA,CAAOC,KADe;MAE7BR,KAAK,EAAE,kBAFsB;MAG7BC,WAAW,EAAE,iCAHgB;MAI7BC,YAAY,EAAE;IAJe,CAAhB,CAZd;IAkBHQ,QAAQ,EAAE,IAAAC,qBAAA,EAAe;MACrBX,KAAK,EAAE,UADc;MAErBC,WAAW,EAAE;IAFQ,CAAf,CAlBP;IAsBHW,IAAI,EAAE,IAAAC,uBAAA,EAAiB;MACnBP,KAAK,EAAEC,aAAA,CAAOC,KADK;MAEnBR,KAAK,EAAE,MAFY;MAGnBC,WAAW,EAAE,kCAHM;MAInBC,YAAY,EAAE,EAJK;MAKnBY,GAAG,EAAE,EALc;MAMnBC,GAAG,EAAE,GANc;MAOnBC,IAAI,EAAE,CAPa;MAQnBC,SAAS,EAAE;IARQ,CAAjB,CAtBH;IAgCHC,YAAY,EAAE,IAAAC,qBAAA,EAAe;MACzBnB,KAAK,EAAE,eADkB;MAEzBC,WAAW,EAAE,gDAFY;MAGzBC,YAAY,EAAE;IAHW,CAAf,CAhCX;IAqCHkB,cAAc,EAAE,IAAAD,qBAAA,EAAe;MAC3BnB,KAAK,EAAE,iBADoB;MAE3BC,WAAW,EAAE,kDAFc;MAG3BC,YAAY,EAAE;IAHa,CAAf;EArCb;AALc,CAAlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SEED_DATA","name","tag","category","COMPONENT_TYPES","input","layout","triggers","Triggers","OnValueChange","props","direction","createDirectionProp","fieldName","createFieldNameProp","handlerPropName","valuePropName","defaultValue"],"sources":["RadioButtonGroup.
|
|
1
|
+
{"version":3,"names":["SEED_DATA","name","tag","category","COMPONENT_TYPES","input","layout","triggers","Triggers","OnValueChange","props","direction","createDirectionProp","fieldName","createFieldNameProp","handlerPropName","valuePropName","defaultValue"],"sources":["RadioButtonGroup.js"],"sourcesContent":["import { COMPONENT_TYPES, createFieldNameProp, createDirectionProp, Triggers, } from \"@draftbit/types\";\nexport const SEED_DATA = {\n name: \"Radio Button Group\",\n tag: \"RadioButtonGroup\",\n category: COMPONENT_TYPES.input,\n layout: {},\n triggers: [Triggers.OnValueChange],\n props: {\n direction: createDirectionProp(),\n fieldName: createFieldNameProp({\n handlerPropName: \"onValueChange\",\n valuePropName: \"value\",\n defaultValue: \"radioButtonGroupValue\",\n }),\n },\n};\n"],"mappings":";;;;;;;AAAA;;AACO,MAAMA,SAAS,GAAG;EACrBC,IAAI,EAAE,oBADe;EAErBC,GAAG,EAAE,kBAFgB;EAGrBC,QAAQ,EAAEC,sBAAA,CAAgBC,KAHL;EAIrBC,MAAM,EAAE,EAJa;EAKrBC,QAAQ,EAAE,CAACC,eAAA,CAASC,aAAV,CALW;EAMrBC,KAAK,EAAE;IACHC,SAAS,EAAE,IAAAC,0BAAA,GADR;IAEHC,SAAS,EAAE,IAAAC,0BAAA,EAAoB;MAC3BC,eAAe,EAAE,eADU;MAE3BC,aAAa,EAAE,OAFY;MAG3BC,YAAY,EAAE;IAHa,CAApB;EAFR;AANc,CAAlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SEED_DATA","name","tag","category","COMPONENT_TYPES","input","layout","props","label","createTextProp","description","required","defaultValue","direction","createTextEnumProp","options","value","color","createColorProp","group","GROUPS","basic","unselectedColor"],"sources":["RadioButtonRow.
|
|
1
|
+
{"version":3,"names":["SEED_DATA","name","tag","category","COMPONENT_TYPES","input","layout","props","label","createTextProp","description","required","defaultValue","direction","createTextEnumProp","options","value","color","createColorProp","group","GROUPS","basic","unselectedColor"],"sources":["RadioButtonRow.ts"],"sourcesContent":["import {\n createTextProp,\n createTextEnumProp,\n COMPONENT_TYPES,\n createColorProp,\n GROUPS,\n} from \"@draftbit/types\";\n\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:\n \"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"],"mappings":";;;;;;;AAAA;;AAQO,MAAMA,SAAS,GAAG;EACvBC,IAAI,EAAE,kBADiB;EAEvBC,GAAG,EAAE,gBAFkB;EAGvBC,QAAQ,EAAEC,sBAAA,CAAgBC,KAHH;EAIvBC,MAAM,EAAE,EAJe;EAKvBC,KAAK,EAAE;IACLC,KAAK,EAAE,IAAAC,qBAAA,EAAe;MACpBD,KAAK,EAAE,OADa;MAEpBE,WAAW,EAAE,qCAFO;MAGpBC,QAAQ,EAAE,IAHU;MAIpBC,YAAY,EAAE;IAJM,CAAf,CADF;IAOLC,SAAS,EAAE,IAAAC,yBAAA,EAAmB;MAC5BN,KAAK,EAAE,WADqB;MAE5BE,WAAW,EACT,8DAH0B;MAI5BK,OAAO,EAAE,CAAC,KAAD,EAAQ,aAAR;IAJmB,CAAnB,CAPN;IAaLC,KAAK,EAAE,IAAAP,qBAAA,EAAe;MACpBD,KAAK,EAAE,OADa;MAEpBE,WAAW,EAAE,2BAFO;MAGpBE,YAAY,EAAE,IAHM;MAIpBD,QAAQ,EAAE;IAJU,CAAf,CAbF;IAmBLM,KAAK,EAAE,IAAAC,sBAAA,EAAgB;MACrBC,KAAK,EAAEC,aAAA,CAAOC,KADO;MAErBX,WAAW,EAAE,sBAFQ;MAGrBE,YAAY,EAAE;IAHO,CAAhB,CAnBF;IAwBLU,eAAe,EAAE,IAAAJ,sBAAA,EAAgB;MAC/BC,KAAK,EAAEC,aAAA,CAAOC,KADiB;MAE/Bb,KAAK,EAAE,kBAFwB;MAG/BE,WAAW,EAAE,iCAHkB;MAI/BE,YAAY,EAAE;IAJiB,CAAhB;EAxBZ;AALgB,CAAlB"}
|