@draftbit/core 46.1.4 → 46.2.1-d40959.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/CardContainerShortImage.js +18 -5
- package/lib/commonjs/components/CardContainerShortImage.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/DeprecatedButton.js +20 -4
- package/lib/commonjs/components/DeprecatedButton.js.map +1 -1
- package/lib/commonjs/components/Justification.js +3 -0
- 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 +2 -2
- package/lib/commonjs/components/Picker/PickerComponent.android.js.map +1 -1
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +2 -2
- package/lib/commonjs/components/Picker/PickerComponent.ios.js.map +1 -1
- package/lib/commonjs/components/Picker/PickerComponent.web.js +2 -2
- package/lib/commonjs/components/Picker/PickerComponent.web.js.map +1 -1
- 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/ResizeMode.js +3 -0
- 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/constants.js +1 -1
- package/lib/commonjs/mappings/CustomCode.js.map +1 -1
- package/lib/commonjs/mappings/DatePicker.js +10 -0
- package/lib/commonjs/mappings/DatePicker.js.map +1 -1
- package/lib/commonjs/mappings/ImageBackground.js.map +1 -1
- package/lib/commonjs/mappings/MapMarker.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/SafeAreaView.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/styles/overlay.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/DatePicker/DatePicker.js +3 -3
- package/lib/module/components/DatePicker/DatePicker.js.map +1 -1
- package/lib/module/components/Justification.js +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 +2 -2
- package/lib/module/components/Picker/PickerComponent.android.js.map +1 -1
- package/lib/module/components/Picker/PickerComponent.ios.js +2 -2
- package/lib/module/components/Picker/PickerComponent.ios.js.map +1 -1
- package/lib/module/components/Picker/PickerComponent.web.js +2 -2
- package/lib/module/components/Picker/PickerComponent.web.js.map +1 -1
- 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/ResizeMode.js +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/mappings/DatePicker.js +10 -0
- package/lib/module/mappings/DatePicker.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/mappings/DatePicker.d.ts +10 -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 +2 -2
- package/src/Provider.js +9 -0
- package/src/components/Accordion/AccordionGroup.js +44 -0
- package/src/components/Accordion/AccordionItem.js +32 -0
- package/src/components/Accordion/index.js +2 -0
- package/src/components/ActionSheet/ActionSheet.js +45 -0
- package/src/components/ActionSheet/ActionSheetCancel.js +6 -0
- package/src/components/ActionSheet/ActionSheetItem.js +30 -0
- package/src/components/ActionSheet/index.js +3 -0
- package/src/components/AnimatedCircularProgress.js +43 -0
- package/src/components/AspectRatio.js +18 -0
- package/src/components/AvatarEdit.js +30 -0
- package/src/components/Banner.js +109 -0
- package/src/components/Button.js +112 -0
- package/src/components/Card.js +57 -0
- package/src/components/CardBlock.js +54 -0
- package/src/components/CardContainer.js +69 -0
- package/src/components/CardContainerRating.js +79 -0
- package/src/components/CardContainerShortImage.js +33 -0
- package/src/components/CardInline.js +36 -0
- package/src/components/Carousel.js +68 -0
- package/src/components/Checkbox/Checkbox.js +63 -0
- package/src/components/Checkbox/CheckboxGroup.js +21 -0
- package/src/components/Checkbox/CheckboxGroupRow.js +77 -0
- package/src/components/Checkbox/CheckboxRow.js +78 -0
- package/src/components/Checkbox/context.js +14 -0
- package/src/components/Checkbox/index.js +3 -0
- package/src/components/CircleImage.js +8 -0
- package/src/components/CircularProgress.js +81 -0
- package/src/components/Config.js +63 -0
- package/src/components/Container.js +43 -0
- package/src/components/DatePicker/DatePicker.js +368 -0
- package/src/components/DatePicker/DatePickerComponent.js +13 -0
- package/src/components/DatePicker/DatePickerComponent.web.js +30 -0
- package/src/components/DatePicker/DatePickerComponentType.js +1 -0
- package/src/components/DeprecatedButton.js +95 -0
- package/src/components/DeprecatedCardWrapper.js +18 -0
- package/src/components/DeprecatedFAB.js +115 -0
- package/src/components/Divider.js +13 -0
- package/src/components/Elevation.js +20 -0
- package/src/components/FAB.js +46 -0
- package/src/components/FieldSearchBarFull.js +53 -0
- package/src/components/FormRow.js +19 -0
- package/src/components/Header.js +44 -0
- package/src/components/HeaderLarge.js +7 -0
- package/src/components/HeaderMedium.js +7 -0
- package/src/components/HeaderOverline.js +7 -0
- package/src/components/IconButton.js +35 -0
- package/src/components/Image.js +47 -0
- package/src/components/Justification.js +1 -0
- package/src/components/Layout.js +50 -0
- package/src/components/NumberInput.js +49 -0
- package/src/components/Picker/Picker.js +267 -0
- package/src/components/Picker/Picker.tsx +8 -6
- package/src/components/Picker/PickerComponent.android.js +69 -0
- package/src/components/Picker/PickerComponent.ios.js +79 -0
- package/src/components/Picker/PickerComponent.web.js +70 -0
- package/src/components/Picker/PickerTypes.js +1 -0
- package/src/components/Portal/Portal.js +35 -0
- package/src/components/Portal/PortalConsumer.js +27 -0
- package/src/components/Portal/PortalHost.js +107 -0
- package/src/components/Portal/PortalManager.js +32 -0
- package/src/components/ProgressBar.js +118 -0
- package/src/components/ProgressCircle.js +13 -0
- package/src/components/ProgressIndicator.js +27 -0
- package/src/components/RadioButton/RadioButton.js +17 -0
- package/src/components/RadioButton/RadioButtonFieldGroup.js +17 -0
- package/src/components/RadioButton/RadioButtonGroup.js +43 -0
- package/src/components/RadioButton/RadioButtonRow.js +76 -0
- package/src/components/RadioButton/context.js +14 -0
- package/src/components/RadioButton/index.js +4 -0
- package/src/components/ResizeMode.js +1 -0
- package/src/components/Row.js +48 -0
- package/src/components/RowBodyIcon.js +8 -0
- package/src/components/RowHeadlineImageCaption.js +12 -0
- package/src/components/RowHeadlineImageIcon.js +14 -0
- package/src/components/ScreenContainer.js +34 -0
- package/src/components/Slider.js +63 -0
- package/src/components/StarRating.js +50 -0
- package/src/components/StepIndicator.js +346 -0
- package/src/components/Stepper.js +39 -0
- package/src/components/Surface.js +32 -0
- package/src/components/Swiper/Swiper.js +29 -0
- package/src/components/Swiper/SwiperItem.js +9 -0
- package/src/components/Swiper/index.js +2 -0
- package/src/components/Switch.js +56 -0
- package/src/components/Text.js +27 -0
- package/src/components/TextField.js +423 -0
- package/src/components/ToggleButton.js +39 -0
- package/src/components/Touchable.js +12 -0
- package/src/components/Touchable.web.js +2 -0
- package/src/components/Typography.js +36 -0
- package/src/components/useAuthState.js +31 -0
- package/src/constants.js +10 -0
- package/src/hooks.js +12 -0
- package/src/index.js +52 -0
- package/src/interfaces/Icon.js +8 -0
- package/src/mappings/Accordion.js +41 -0
- package/src/mappings/AccordionItem.js +16 -0
- package/src/mappings/ActionSheet.js +13 -0
- package/src/mappings/ActionSheetCancel.js +19 -0
- package/src/mappings/ActionSheetItem.js +23 -0
- package/src/mappings/ActivityIndicator.js +53 -0
- package/src/mappings/AudioPlayer.js +20 -0
- package/src/mappings/AvatarEdit.js +37 -0
- package/src/mappings/Banner.js +32 -0
- package/src/mappings/BlurView.js +41 -0
- package/src/mappings/Button.js +56 -0
- package/src/mappings/Card.js +52 -0
- package/src/mappings/CardBlock.js +122 -0
- package/src/mappings/CardContainer.js +102 -0
- package/src/mappings/CardContainerRating.js +124 -0
- package/src/mappings/CardContainerShortImage.js +118 -0
- package/src/mappings/CardInline.js +51 -0
- package/src/mappings/Carousel.js +18 -0
- package/src/mappings/Checkbox.js +45 -0
- package/src/mappings/CheckboxGroup.js +25 -0
- package/src/mappings/CheckboxRow.js +56 -0
- package/src/mappings/CircleImage.js +24 -0
- package/src/mappings/Container.js +29 -0
- package/src/mappings/CustomCode.js +8 -0
- package/src/mappings/DatePicker.js +157 -0
- package/src/mappings/DatePicker.ts +10 -0
- package/src/mappings/Divider.js +26 -0
- package/src/mappings/FAB.js +36 -0
- package/src/mappings/Fetch.js +12 -0
- package/src/mappings/FieldSearchBarFull.js +49 -0
- package/src/mappings/FlatList.js +19 -0
- package/src/mappings/HeaderLarge.js +28 -0
- package/src/mappings/HeaderMedium.js +54 -0
- package/src/mappings/HeaderOverline.js +54 -0
- package/src/mappings/Icon.js +25 -0
- package/src/mappings/IconButton.js +30 -0
- package/src/mappings/Image.js +15 -0
- package/src/mappings/ImageBackground.js +28 -0
- package/src/mappings/KeyboardAvoidingView.js +40 -0
- package/src/mappings/KeyboardAwareScrollView.js +49 -0
- package/src/mappings/Layout.js +195 -0
- package/src/mappings/LinearGradient.js +77 -0
- package/src/mappings/MapCallout.js +21 -0
- package/src/mappings/MapMarker.js +47 -0
- package/src/mappings/MapView.js +138 -0
- package/src/mappings/Modal.js +41 -0
- package/src/mappings/NumberInput.js +248 -0
- package/src/mappings/NumberInput.ts +267 -0
- package/src/mappings/Picker.js +139 -0
- package/src/mappings/ProgressBar.js +100 -0
- package/src/mappings/ProgressCircle.js +108 -0
- package/src/mappings/ProgressIndicator.js +180 -0
- package/src/mappings/RadioButton.js +50 -0
- package/src/mappings/RadioButtonGroup.js +16 -0
- package/src/mappings/RadioButtonRow.js +37 -0
- package/src/mappings/RowBodyIcon.js +75 -0
- package/src/mappings/RowHeadlineImageCaption.js +167 -0
- package/src/mappings/RowHeadlineImageIcon.js +99 -0
- package/src/mappings/SafeAreaView.js +33 -0
- package/src/mappings/ScrollView.js +30 -0
- package/src/mappings/Slider.js +59 -0
- package/src/mappings/StarRating.js +42 -0
- package/src/mappings/Stepper.js +28 -0
- package/src/mappings/Surface.js +13 -0
- package/src/mappings/Swiper.js +60 -0
- package/src/mappings/SwiperItem.js +8 -0
- package/src/mappings/Switch.js +75 -0
- package/src/mappings/Text.js +239 -0
- package/src/mappings/Text.ts +34 -27
- package/src/mappings/TextArea.js +259 -0
- package/src/mappings/TextArea.ts +216 -3
- package/src/mappings/TextField.js +375 -0
- package/src/mappings/TextField.ts +227 -3
- package/src/mappings/TextInput.js +385 -0
- package/src/mappings/TextInput.ts +214 -34
- package/src/mappings/ToggleButton.js +45 -0
- package/src/mappings/Touchable.js +12 -0
- package/src/mappings/Video.js +74 -0
- package/src/mappings/View.js +206 -0
- package/src/mappings/WebView.js +18 -0
- package/src/styles/DarkTheme.js +26 -0
- package/src/styles/DefaultTheme.js +111 -0
- package/src/styles/fonts.js +62 -0
- package/src/styles/overlay.js +60 -0
- package/src/styles/shadow.js +51 -0
- package/src/theming.js +3 -0
- package/src/utilities.js +102 -0
|
@@ -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,UAAlB,EAA8B;QAC5BC,0BAA0B,GAAG;UAC3BC,eAAe,EAAE,KAAK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B;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\",\n};\n"],"mappings":";;AAAA;AACA,OAAOA,KAAP,IAAgBC,SAAhB,QAAi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B,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,MAAMC,OAAkB,GAAG,QAYrB;EAAA,IAZsB;IAC1BC,GAAG,GAAG,CA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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"}
|
|
@@ -21,6 +21,16 @@ const SEED_DATA_PROPS = {
|
|
|
21
21
|
options: ["date", "time", "datetime"],
|
|
22
22
|
group: GROUPS.basic
|
|
23
23
|
},
|
|
24
|
+
format: {
|
|
25
|
+
label: "Format",
|
|
26
|
+
description: "Create an output format for the date.",
|
|
27
|
+
editable: true,
|
|
28
|
+
required: false,
|
|
29
|
+
formType: FORM_TYPES.string,
|
|
30
|
+
propType: PROP_TYPES.STRING,
|
|
31
|
+
defaultValue: null,
|
|
32
|
+
group: GROUPS.basic
|
|
33
|
+
},
|
|
24
34
|
assistiveText: {
|
|
25
35
|
label: "Assistive text",
|
|
26
36
|
description: "Helper text to display below the picker",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["COMPONENT_TYPES","FORM_TYPES","PROP_TYPES","FIELD_NAME","GROUPS","Triggers","SEED_DATA_PROPS","label","description","formType","string","propType","STRING","defaultValue","editable","required","group","data","mode","flatArray","options","basic","assistiveText","disabled","boolean","BOOLEAN","leftIconName","icon","leftIconMode","rightIconName","fieldName","handlerPropName","valuePropName","SEED_DATA","name","tag","category","input","layout","triggers","OnDateChange","props","type"],"sources":["DatePicker.ts"],"sourcesContent":["import {\n COMPONENT_TYPES,\n FORM_TYPES,\n PROP_TYPES,\n FIELD_NAME,\n GROUPS,\n Triggers,\n} from \"@draftbit/types\";\n\nconst SEED_DATA_PROPS = {\n label: {\n label: \"Label\",\n description: \"The label to be displayed on the picker\",\n formType: FORM_TYPES.string,\n propType: PROP_TYPES.STRING,\n defaultValue: \"Date\",\n editable: true,\n required: true,\n group: GROUPS.data,\n },\n mode: {\n label: \"Mode\",\n description: \"Choose between date, time and datetime\",\n defaultValue: \"date\",\n editable: true,\n required: true,\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n options: [\"date\", \"time\", \"datetime\"],\n group: GROUPS.basic,\n },\n assistiveText: {\n label: \"Assistive text\",\n description: \"Helper text to display below the picker\",\n formType: FORM_TYPES.string,\n propType: PROP_TYPES.STRING,\n defaultValue: null,\n editable: true,\n required: false,\n group: GROUPS.basic,\n },\n // locale: {\n // label: \"Locale\",\n // description: \"Locale for the datepicker. Must be a valid Locale\",\n // formType: FORM_TYPES.string,\n // propType: PROP_TYPES.STRING,\n // defaultValue: null,\n // editable: true,\n // required: false,\n // group: GROUPS.basic,\n // },\n // minuteInterval: {\n // label: \"Minute Interval\",\n // description: \"The interval at which minutes can be selected\",\n // formType: FORM_TYPES.flatArray,\n // propType: PROP_TYPES.NUMBER,\n // options: [1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30],\n // defaultValue: null,\n // editable: true,\n // required: false,\n // group: GROUPS.basic,\n // },\n // timeZoneOffsetInMinutes: {\n // label: \"Time zone offset\",\n // description:\n // \"By default, the datepicker uses the device's timezone. This will allow you to offset it\",\n // formType: FORM_TYPES.number,\n // propType: PROP_TYPES.NUMBER,\n // defaultValue: null,\n // editable: true,\n // required: false,\n // group: GROUPS.basic,\n // },\n disabled: {\n label: \"Disabled\",\n description:\n \"Whether the picker should be disabled. Will prevent selection and show a greyed out state.\",\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n defaultValue: false,\n editable: true,\n required: false,\n group: GROUPS.basic,\n },\n // error: {\n // label: \"Error\",\n // description: \"Whether the picker should display the error state\",\n // formType: FORM_TYPES.boolean,\n // propType: PROP_TYPES.BOOLEAN,\n // defaultValue: false,\n // editable: true,\n // required: false,\n // group: GROUPS.data,\n // },\n leftIconName: {\n label: \"Left icon name\",\n description: \"The icon to display on the left\",\n formType: FORM_TYPES.icon,\n propType: PROP_TYPES.STRING,\n defaultValue: null,\n editable: true,\n required: false,\n group: GROUPS.basic,\n },\n leftIconMode: {\n label: \"Left icon mode\",\n description:\n \"The mode of the icon to display on the left. 'inset' or 'outset'.\",\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n defaultValue: \"inset\",\n options: [\"inset\", \"outset\"],\n editable: true,\n required: true,\n group: GROUPS.basic,\n },\n rightIconName: {\n label: \"Right icon name\",\n description: \"The icon to display on the right\",\n formType: FORM_TYPES.icon,\n propType: PROP_TYPES.STRING,\n defaultValue: null,\n editable: true,\n required: false,\n group: GROUPS.basic,\n },\n fieldName: {\n ...FIELD_NAME,\n handlerPropName: \"onDateChange\",\n valuePropName: \"date\",\n defaultValue: \"date\",\n },\n};\n\nexport const SEED_DATA = [\n {\n name: \"Date Picker\",\n tag: \"DatePicker\",\n description: \"A component used to select a date from a visual calendar\",\n category: COMPONENT_TYPES.input,\n layout: null,\n triggers: [Triggers.OnDateChange],\n props: {\n ...SEED_DATA_PROPS,\n type: {\n label: \"Appearance\",\n description: \"Type of Datepicker\",\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n defaultValue: \"solid\",\n options: [\"solid\", \"underline\"],\n editable: true,\n required: true,\n group: GROUPS.basic,\n },\n },\n },\n];\n"],"mappings":"AAAA,SACEA,eADF,EAEEC,UAFF,EAGEC,UAHF,EAIEC,UAJF,EAKEC,MALF,EAMEC,QANF,QAOO,iBAPP;AASA,MAAMC,eAAe,GAAG;EACtBC,KAAK,EAAE;IACLA,KAAK,EAAE,OADF;IAELC,WAAW,EAAE,yCAFR;IAGLC,QAAQ,EAAER,UAAU,CAACS,MAHhB;IAILC,QAAQ,EAAET,UAAU,CAACU,MAJhB;IAKLC,YAAY,EAAE,MALT;IAMLC,QAAQ,EAAE,IANL;IAOLC,QAAQ,EAAE,IAPL;IAQLC,KAAK,EAAEZ,MAAM,CAACa;EART,CADe;EAWtBC,IAAI,EAAE;IACJX,KAAK,EAAE,MADH;IAEJC,WAAW,EAAE,wCAFT;IAGJK,YAAY,EAAE,MAHV;IAIJC,QAAQ,EAAE,IAJN;IAKJC,QAAQ,EAAE,IALN;IAMJN,QAAQ,EAAER,UAAU,CAACkB,SANjB;IAOJR,QAAQ,EAAET,UAAU,CAACU,MAPjB;IAQJQ,OAAO,EAAE,CAAC,MAAD,EAAS,MAAT,EAAiB,UAAjB,CARL;IASJJ,KAAK,EAAEZ,MAAM,CAACiB;EATV,CAXgB;EAsBtBC,aAAa,EAAE;
|
|
1
|
+
{"version":3,"names":["COMPONENT_TYPES","FORM_TYPES","PROP_TYPES","FIELD_NAME","GROUPS","Triggers","SEED_DATA_PROPS","label","description","formType","string","propType","STRING","defaultValue","editable","required","group","data","mode","flatArray","options","basic","format","assistiveText","disabled","boolean","BOOLEAN","leftIconName","icon","leftIconMode","rightIconName","fieldName","handlerPropName","valuePropName","SEED_DATA","name","tag","category","input","layout","triggers","OnDateChange","props","type"],"sources":["DatePicker.ts"],"sourcesContent":["import {\n COMPONENT_TYPES,\n FORM_TYPES,\n PROP_TYPES,\n FIELD_NAME,\n GROUPS,\n Triggers,\n} from \"@draftbit/types\";\n\nconst SEED_DATA_PROPS = {\n label: {\n label: \"Label\",\n description: \"The label to be displayed on the picker\",\n formType: FORM_TYPES.string,\n propType: PROP_TYPES.STRING,\n defaultValue: \"Date\",\n editable: true,\n required: true,\n group: GROUPS.data,\n },\n mode: {\n label: \"Mode\",\n description: \"Choose between date, time and datetime\",\n defaultValue: \"date\",\n editable: true,\n required: true,\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n options: [\"date\", \"time\", \"datetime\"],\n group: GROUPS.basic,\n },\n format: {\n label: \"Format\",\n description: \"Create an output format for the date.\",\n editable: true,\n required: false,\n formType: FORM_TYPES.string,\n propType: PROP_TYPES.STRING,\n defaultValue: null,\n group: GROUPS.basic,\n },\n assistiveText: {\n label: \"Assistive text\",\n description: \"Helper text to display below the picker\",\n formType: FORM_TYPES.string,\n propType: PROP_TYPES.STRING,\n defaultValue: null,\n editable: true,\n required: false,\n group: GROUPS.basic,\n },\n // locale: {\n // label: \"Locale\",\n // description: \"Locale for the datepicker. Must be a valid Locale\",\n // formType: FORM_TYPES.string,\n // propType: PROP_TYPES.STRING,\n // defaultValue: null,\n // editable: true,\n // required: false,\n // group: GROUPS.basic,\n // },\n // minuteInterval: {\n // label: \"Minute Interval\",\n // description: \"The interval at which minutes can be selected\",\n // formType: FORM_TYPES.flatArray,\n // propType: PROP_TYPES.NUMBER,\n // options: [1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30],\n // defaultValue: null,\n // editable: true,\n // required: false,\n // group: GROUPS.basic,\n // },\n // timeZoneOffsetInMinutes: {\n // label: \"Time zone offset\",\n // description:\n // \"By default, the datepicker uses the device's timezone. This will allow you to offset it\",\n // formType: FORM_TYPES.number,\n // propType: PROP_TYPES.NUMBER,\n // defaultValue: null,\n // editable: true,\n // required: false,\n // group: GROUPS.basic,\n // },\n disabled: {\n label: \"Disabled\",\n description:\n \"Whether the picker should be disabled. Will prevent selection and show a greyed out state.\",\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n defaultValue: false,\n editable: true,\n required: false,\n group: GROUPS.basic,\n },\n // error: {\n // label: \"Error\",\n // description: \"Whether the picker should display the error state\",\n // formType: FORM_TYPES.boolean,\n // propType: PROP_TYPES.BOOLEAN,\n // defaultValue: false,\n // editable: true,\n // required: false,\n // group: GROUPS.data,\n // },\n leftIconName: {\n label: \"Left icon name\",\n description: \"The icon to display on the left\",\n formType: FORM_TYPES.icon,\n propType: PROP_TYPES.STRING,\n defaultValue: null,\n editable: true,\n required: false,\n group: GROUPS.basic,\n },\n leftIconMode: {\n label: \"Left icon mode\",\n description:\n \"The mode of the icon to display on the left. 'inset' or 'outset'.\",\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n defaultValue: \"inset\",\n options: [\"inset\", \"outset\"],\n editable: true,\n required: true,\n group: GROUPS.basic,\n },\n rightIconName: {\n label: \"Right icon name\",\n description: \"The icon to display on the right\",\n formType: FORM_TYPES.icon,\n propType: PROP_TYPES.STRING,\n defaultValue: null,\n editable: true,\n required: false,\n group: GROUPS.basic,\n },\n fieldName: {\n ...FIELD_NAME,\n handlerPropName: \"onDateChange\",\n valuePropName: \"date\",\n defaultValue: \"date\",\n },\n};\n\nexport const SEED_DATA = [\n {\n name: \"Date Picker\",\n tag: \"DatePicker\",\n description: \"A component used to select a date from a visual calendar\",\n category: COMPONENT_TYPES.input,\n layout: null,\n triggers: [Triggers.OnDateChange],\n props: {\n ...SEED_DATA_PROPS,\n type: {\n label: \"Appearance\",\n description: \"Type of Datepicker\",\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n defaultValue: \"solid\",\n options: [\"solid\", \"underline\"],\n editable: true,\n required: true,\n group: GROUPS.basic,\n },\n },\n },\n];\n"],"mappings":"AAAA,SACEA,eADF,EAEEC,UAFF,EAGEC,UAHF,EAIEC,UAJF,EAKEC,MALF,EAMEC,QANF,QAOO,iBAPP;A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;IAQbC,KAAK,EAAEZ,MAAM,CAACiB;EARD,CArHO;EA+HtBU,SAAS,EAAE,EACT,GAAG5B,UADM;IAET6B,eAAe,EAAE,cAFR;IAGTC,aAAa,EAAE,MAHN;IAITpB,YAAY,EAAE;EAJL;AA/HW,CAAxB;AAuIA,OAAO,MAAMqB,SAAS,GAAG,CACvB;EACEC,IAAI,EAAE,aADR;EAEEC,GAAG,EAAE,YAFP;EAGE5B,WAAW,EAAE,0DAHf;EAIE6B,QAAQ,EAAErC,eAAe,CAACsC,KAJ5B;EAKEC,MAAM,EAAE,IALV;EAMEC,QAAQ,EAAE,CAACnC,QAAQ,CAACoC,YAAV,CANZ;EAOEC,KAAK,EAAE,EACL,GAAGpC,eADE;IAELqC,IAAI,EAAE;MACJpC,KAAK,EAAE,YADH;MAEJC,WAAW,EAAE,oBAFT;MAGJC,QAAQ,EAAER,UAAU,CAACkB,SAHjB;MAIJR,QAAQ,EAAET,UAAU,CAACU,MAJjB;MAKJC,YAAY,EAAE,OALV;MAMJO,OAAO,EAAE,CAAC,OAAD,EAAU,WAAV,CANL;MAOJN,QAAQ,EAAE,IAPN;MAQJC,QAAQ,EAAE,IARN;MASJC,KAAK,EAAEZ,MAAM,CAACiB;IATV;EAFD;AAPT,CADuB,CAAlB"}
|
|
@@ -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,WAAW,EACT,uGAJc;IAKhBC,QAAQ,EAAE,IALM;IAMhBC,QAAQ,EAAE,KANM;IAOhBC,YAAY,EAAE,IAPE;IAQhBC,QAAQ,EAAEb,UAAU,CAACc,OARL;IAShBC,QAAQ,EAAEd,UAAU,CAACe;EATL,CADO;EAYzBC,SAAS,EAAE;IACTX,KAAK,EAAER,MAAM,CAACoB,KADL;IAETV,KAAK,EAAE,YAFE;IAGTC,WAAW,EAAE,yDAHJ;IAITC,QAAQ,EAAE,IAJD;IAKTC,QAAQ,EAAE,KALD;IAMTC,YAAY,EAAE,IANL;IAOTC,QAAQ,EAAEb,UAAU,CAACc,OAPZ;IAQTC,QAAQ,EAAEd,UAAU,CAACe;EARZ,CAZc;EAsBzBG,WAAW,EAAE;IACXb,KAAK,EAAER,MAAM,CAACS,QADH;IAEXC,KAAK,EAAE,YAFI;IAGXC,WAAW,EACT,yFAJS;IAKXC,QAAQ,EAAE,IALC;IAMXC,QAAQ,EAAE,KANC;IAOXC,YAAY,EAAE,IAPH;IAQXC,QAAQ,EAAEb,UAAU,CAACc,OARV;IASXC,QAAQ,EAAEd,UAAU,CAACe;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