@draftbit/core 46.1.3 → 46.2.0

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.
Files changed (77) hide show
  1. package/lib/commonjs/components/Carousel.js +3 -1
  2. package/lib/commonjs/components/Carousel.js.map +1 -1
  3. package/lib/commonjs/components/Config.js +3 -3
  4. package/lib/commonjs/components/Config.js.map +1 -1
  5. package/lib/commonjs/components/DatePicker/DatePicker.js +3 -3
  6. package/lib/commonjs/components/DatePicker/DatePicker.js.map +1 -1
  7. package/lib/commonjs/components/Picker/Picker.js +4 -5
  8. package/lib/commonjs/components/Picker/Picker.js.map +1 -1
  9. package/lib/commonjs/components/Picker/PickerComponent.android.js +2 -2
  10. package/lib/commonjs/components/Picker/PickerComponent.android.js.map +1 -1
  11. package/lib/commonjs/components/Picker/PickerComponent.ios.js +2 -2
  12. package/lib/commonjs/components/Picker/PickerComponent.ios.js.map +1 -1
  13. package/lib/commonjs/components/Picker/PickerComponent.web.js +2 -2
  14. package/lib/commonjs/components/Picker/PickerComponent.web.js.map +1 -1
  15. package/lib/commonjs/components/RadioButton/RadioButton.js +1 -1
  16. package/lib/commonjs/components/RadioButton/RadioButton.js.map +1 -1
  17. package/lib/commonjs/components/RadioButton/RadioButtonRow.js +1 -1
  18. package/lib/commonjs/components/RadioButton/RadioButtonRow.js.map +1 -1
  19. package/lib/commonjs/components/StepIndicator.js +1 -1
  20. package/lib/commonjs/components/StepIndicator.js.map +1 -1
  21. package/lib/commonjs/components/Stepper.js +1 -1
  22. package/lib/commonjs/components/Stepper.js.map +1 -1
  23. package/lib/commonjs/mappings/ActionSheetItem.js.map +1 -1
  24. package/lib/commonjs/mappings/BlurView.js.map +1 -1
  25. package/lib/commonjs/utilities.js +1 -1
  26. package/lib/commonjs/utilities.js.map +1 -1
  27. package/lib/module/components/Carousel.js +3 -1
  28. package/lib/module/components/Carousel.js.map +1 -1
  29. package/lib/module/components/Config.js +3 -3
  30. package/lib/module/components/Config.js.map +1 -1
  31. package/lib/module/components/DatePicker/DatePicker.js +3 -3
  32. package/lib/module/components/DatePicker/DatePicker.js.map +1 -1
  33. package/lib/module/components/Picker/Picker.js +4 -5
  34. package/lib/module/components/Picker/Picker.js.map +1 -1
  35. package/lib/module/components/Picker/PickerComponent.android.js +2 -2
  36. package/lib/module/components/Picker/PickerComponent.android.js.map +1 -1
  37. package/lib/module/components/Picker/PickerComponent.ios.js +2 -2
  38. package/lib/module/components/Picker/PickerComponent.ios.js.map +1 -1
  39. package/lib/module/components/Picker/PickerComponent.web.js +2 -2
  40. package/lib/module/components/Picker/PickerComponent.web.js.map +1 -1
  41. package/lib/module/components/RadioButton/RadioButton.js +1 -1
  42. package/lib/module/components/RadioButton/RadioButton.js.map +1 -1
  43. package/lib/module/components/RadioButton/RadioButtonRow.js +1 -1
  44. package/lib/module/components/RadioButton/RadioButtonRow.js.map +1 -1
  45. package/lib/module/components/StepIndicator.js +1 -1
  46. package/lib/module/components/StepIndicator.js.map +1 -1
  47. package/lib/module/components/Stepper.js +1 -1
  48. package/lib/module/components/Stepper.js.map +1 -1
  49. package/lib/module/utilities.js +1 -1
  50. package/lib/module/utilities.js.map +1 -1
  51. package/package.json +3 -3
  52. package/src/components/ActionSheet/ActionSheet.js +1 -1
  53. package/src/components/Carousel.js +4 -2
  54. package/src/components/Checkbox/Checkbox.js +3 -3
  55. package/src/components/Checkbox/CheckboxGroupRow.js +2 -2
  56. package/src/components/Checkbox/CheckboxRow.js +3 -3
  57. package/src/components/CircularProgress.js +29 -26
  58. package/src/components/DatePicker/DatePicker.js +1 -1
  59. package/src/components/NumberInput.js +1 -1
  60. package/src/components/Picker/Picker.js +8 -8
  61. package/src/components/Picker/Picker.tsx +8 -6
  62. package/src/components/Picker/PickerComponent.android.js +2 -1
  63. package/src/components/Picker/PickerComponent.ios.js +2 -1
  64. package/src/components/Picker/PickerComponent.web.js +2 -1
  65. package/src/components/Portal/Portal.js +2 -2
  66. package/src/components/Portal/PortalConsumer.js +0 -1
  67. package/src/components/Portal/PortalHost.js +43 -41
  68. package/src/components/Portal/PortalManager.js +21 -18
  69. package/src/components/ProgressBar.js +9 -9
  70. package/src/components/RadioButton/RadioButton.js +3 -3
  71. package/src/components/RadioButton/RadioButtonGroup.js +1 -1
  72. package/src/components/RadioButton/RadioButtonRow.js +3 -3
  73. package/src/components/StepIndicator.js +225 -225
  74. package/src/components/Stepper.js +2 -2
  75. package/src/components/Text.js +0 -1
  76. package/src/components/TextField.js +62 -59
  77. package/src/constants.js +1 -1
@@ -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,KAAKC,KAAL,CAAWC,YAAX,CAAwBC,wBADd;UAE3BC,QAAQ,EAAE,UAFiB;UAG3BC,IAAI,EACF,CAAC,KAAKJ,KAAL,CAAWK,KAAX,GAAmB,KAAKL,KAAL,CAAWC,YAAX,CAAwBK,oBAA5C,IAAoE,CAJ3C;UAK3BC,GAAG,EAAE,KAAKP,KAAL,CAAWQ,MAAX,IAAqB,IAAIZ,SAAzB,CALsB;UAM3Ba,MAAM,EAAE,KAAKT,KAAL,CAAWQ,MAAX,IAAqB,IAAIZ,SAAzB,CANmB;UAO3BS,KAAK,EACH,KAAKL,KAAL,CAAWC,YAAX,CAAwBS,8BAAxB,KAA2D,CAA3D,GACI,KAAKV,KAAL,CAAWC,YAAX,CAAwBK,oBAD5B,GAEI,KAAKN,KAAL,CAAWC,YAAX,CAAwBS;QAVH,CAA7B;MAYD,CAbD,MA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,CADoB;EAI/B+B,sBAAsB,EAAE;IACtBF,aAAa,EAAE,KADO;IAEtByB,UAAU,EAAE,QAFU;IAGtBiD,cAAc,EAAE,cAHM;IAItBvG,eAAe,EAAE;EAJK,CAJO;EAU/BmD,mBAAmB,EAAE;IACnBoD,cAAc,EAAE;EADG,CAVU;EAa/BxB,IAAI,EAAE;IACJzB,UAAU,EAAE,QADR;IAEJiD,cAAc,EAAE,QAFZ;IAGJC,MAAM,EAAE;EAHJ,CAbyB;EAkB/B5E,aAAa,EAAE;IACboE,IAAI,EAAE,CADO;IAEbnE,aAAa,EAAE,KAFF;IAGbyB,UAAU,EAAE,QAHC;IAIbiD,cAAc,EAAE;EAJH,CAlBgB;EAwB/BzD,SAAS,EAAE;IACTC,QAAQ,EAAE,EADD;IAET0D,SAAS,EAAE,QAFF;IAGTC,UAAU,EAAE;EAHH,CAxBoB;EA6B/B/D,aAAa,EAAE;IACbqD,IAAI,EAAE,CADO;IAEb1C,UAAU,EAAE,QAFC;IAGbiD,cAAc,EAAE;EAHH;AA7BgB,CAAlB,CAAf;AAoCA7G,aAAa,CAACiH,YAAd,GAA6B;EAC3BxF,eAAe,EAAE,CADU;EAE3BtB,SAAS,EAAE,CAFgB;EAG3BK,YAAY,EAAE,EAHa;EAI3BJ,SAAS,EAAE;AAJgB,CAA7B"}
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,KAAKC,KAAL,CAAWC,YAAX,CAAwBC,wBADd;UAE3BC,QAAQ,E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,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 ?? 0);
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,YAAY,IA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MAHhB;MAIEC,gBAAgB,EAAE;IAJpB,CAFK,EAQLrB,SARK;EADT,GAYGJ,KAZH,CAXF,eA0BE,oBAAC,UAAD;IACE,IAAI,EAAEW,IADR;IAEE,IAAI,EAAC,mBAFP;IAGE,OAAO,EAAE,MAAMI,iBAAiB,CAAC,MAAD,CAHlC;IAIE,IAAI,EAAEV,QAJR;IAKE,KAAK,EAAEC,SALT;IAME,QAAQ,EAAEN,KAAK,KAAKD,GANtB;IAOE,KAAK,EAAE;MAAEoB,OAAO,EAAEnB,KAAK,KAAKD,GAAV,GAAgB,GAAhB,GAAsB;IAAjC;EAPT,EA1BF,CADF;AAsCD,CA5ED;;AA8EA,eAAeL,SAAS,CAACE,OAAD,CAAxB"}
1
+ {"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;IAQ1B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AKH,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"}
@@ -78,7 +78,7 @@ export function getValueForRadioButton(value) {
78
78
  } else if (isNumber(value)) {
79
79
  return String(value);
80
80
  } else {
81
- throw new Error(`Invalid value: ${value}`);
81
+ throw new Error("Invalid value: ".concat(value));
82
82
  }
83
83
  }
84
84
  //# sourceMappingURL=utilities.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["StyleSheet","isString","isNumber","pick","pickBy","identity","extractStyles","style","color","fontFamily","fontWeight","fontSize","lineHeight","letterSpacing","textTransform","textAlign","textDecorationLine","textDecorationColor","textDecorationStyle","viewStyles","flatten","textStyles","borderStyleNames","marginStyleNames","extractBorderAndMarginStyles","additionalBorderStyles","additionalMarginStyles","flatStyle","borderStyles","marginStyles","applyStyles","baseStyles","stylesToApply","flattenedStyles","key","value","Object","entries","getValueForRadioButton","String","Error"],"sources":["utilities.ts"],"sourcesContent":["import { StyleSheet, StyleProp, TextStyle } from \"react-native\";\nimport { isString, isNumber, pick, pickBy, identity } from \"lodash\";\n\nexport function extractStyles(style: StyleProp<any>) {\n const {\n color,\n fontFamily,\n fontWeight,\n fontSize,\n lineHeight,\n letterSpacing,\n textTransform,\n textAlign,\n textDecorationLine,\n textDecorationColor,\n textDecorationStyle,\n ...viewStyles\n } = StyleSheet.flatten(style || {});\n\n const textStyles: TextStyle = {\n color,\n fontFamily,\n fontWeight,\n fontSize,\n lineHeight,\n letterSpacing,\n textTransform,\n textAlign,\n textDecorationLine,\n textDecorationColor,\n textDecorationStyle,\n };\n\n return { viewStyles, textStyles };\n}\n\nexport const borderStyleNames = [\n \"borderRadius\",\n \"borderBottomColor\",\n \"borderBottomEndRadius\",\n \"borderBottomLeftRadius\",\n \"borderBottomRightRadius\",\n \"borderBottomStartRadius\",\n \"borderBottomWidth\",\n \"borderColor\",\n \"borderEndColor\",\n \"borderLeftColor\",\n \"borderLeftWidth\",\n \"borderRadius\",\n \"borderRightColor\",\n \"borderRightWidth\",\n \"borderStartColor\",\n \"borderStyle\",\n \"borderTopColor\",\n \"borderTopEndRadius\",\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderTopStartRadius\",\n \"borderTopWidth\",\n \"borderWidth\",\n];\n\nexport const marginStyleNames = [\n \"margin\",\n \"marginBottom\",\n \"marginEnd\",\n \"marginHorizontal\",\n \"marginLeft\",\n \"marginRight\",\n \"marginStart\",\n \"marginTop\",\n \"marginVertical\",\n];\n\nexport function extractBorderAndMarginStyles(\n style: StyleProp<any>,\n additionalBorderStyles?: string[],\n additionalMarginStyles?: string[]\n) {\n const flatStyle = StyleSheet.flatten(style || {});\n\n const borderStyles = pickBy(\n pick(flatStyle, [\n ...borderStyleNames,\n ...(additionalBorderStyles ? additionalBorderStyles : []),\n ]),\n identity\n );\n\n const marginStyles = pickBy(\n pick(flatStyle, [\n ...marginStyleNames,\n ...(additionalMarginStyles ? additionalMarginStyles : []),\n ]),\n identity\n );\n\n return { borderStyles, marginStyles };\n}\n\n/**\n * Merges a style object on top of another style object. In React Native,\n * keys with undefined values in a style object will still override styles\n * that appear earlier in a sequence. This avoids that problem.\n *\n * This lets us avoid the `...(something ? { something } : {})` pattern.\n * There doesn't seem to be a better way to do this. These all seem to not\n * work (i.e. they all result in `{ color: undefined }`:\n * `const mergedStyles = [{ color: \"red\" }, { color: undefined }]`\n * `const mergedStyles = StyleSheet.compose({ color: \"red\" }, { color: undefined })`\n * `const mergedStyles = StyleSheet.flatten([{ color: \"red\" }, { color: undefined }])`\n */\nexport function applyStyles(\n baseStyles: Array<StyleProp<any>>,\n stylesToApply: StyleProp<any> | undefined\n) {\n if (!stylesToApply) {\n return;\n }\n\n const flattenedStyles = StyleSheet.flatten(baseStyles);\n\n for (const [key, value] of Object.entries(stylesToApply)) {\n if (value != null) {\n flattenedStyles[key] = value;\n }\n }\n\n return flattenedStyles;\n}\n\nexport function getValueForRadioButton(value: string | number) {\n if (isString(value)) {\n return value;\n } else if (isNumber(value)) {\n return String(value);\n } else {\n throw new Error(`Invalid value: ${value}`);\n }\n}\n"],"mappings":"AAAA,SAASA,UAAT,QAAiD,cAAjD;AACA,SAASC,QAAT,EAAmBC,QAAnB,EAA6BC,IAA7B,EAAmCC,MAAnC,EAA2CC,QAA3C,QAA2D,QAA3D;AAEA,OAAO,SAASC,aAAT,CAAuBC,KAAvB,EAA8C;EACnD,MAAM;IACJC,KADI;IAEJC,UAFI;IAGJC,UAHI;IAIJC,QAJI;IAKJC,UALI;IAMJC,aANI;IAOJC,aAPI;IAQJC,SARI;IASJC,kBATI;IAUJC,mBAVI;IAWJC,mBAXI;IAYJ,GAAGC;EAZC,IAaFnB,UAAU,CAACoB,OAAX,CAAmBb,KAAK,IAAI,EAA5B,CAbJ;EAeA,MAAMc,UAAqB,GAAG;IAC5Bb,KAD4B;IAE5BC,UAF4B;IAG5BC,UAH4B;IAI5BC,QAJ4B;IAK5BC,UAL4B;IAM5BC,aAN4B;IAO5BC,aAP4B;IAQ5BC,SAR4B;IAS5BC,kBAT4B;IAU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P;AACD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,WAAT,CACLC,UADK,EAELC,aAFK,EAGL;EACA,IAAI,CAACA,aAAL,EAAoB;IAClB;EACD;;EAED,MAAMC,eAAe,GAAGjC,UAAU,CAACoB,OAAX,CAAmBW,UAAnB,CAAxB;;EAEA,KAAK,MAAM,CAACG,GAAD,EAAMC,KAAN,CAAX,IAA2BC,MAAM,CAACC,OAAP,CAAeL,aAAf,CAA3B,EAA0D;IACxD,IAAIG,KAAK,IAAI,IAAb,EAAmB;MACjBF,eAAe,CAACC,GAAD,CAAf,GAAuBC,KAAvB;IACD;EACF;;EAED,OAAOF,eAAP;AACD;AAED,OAAO,SAASK,sBAAT,CAAgCH,KAAhC,EAAwD;EAC7D,IAAIlC,QAAQ,CAACkC,KAAD,CAAZ,EAAqB;IACnB,OAAOA,KAAP;EACD,CAFD,MAEO,IAAIjC,QAAQ,CAACiC,KAAD,CAAZ,EAAqB;IAC1B,OAAOI,MAAM,CAACJ,KAAD,CAAb;EACD,CAFM,MAEA;IACL,MAAM,IAAIK,KAAJ,CAAW,kBAAiBL,KAAM,EAAlC,CAAN;EACD;AACF"}
1
+ {"version":3,"names":["StyleSheet","isString","isNumber","pick","pickBy","identity","extractStyles","style","color","fontFamily","fontWeight","fontSize","lineHeight","letterSpacing","textTransform","textAlign","textDecorationLine","textDecorationColor","textDecorationStyle","viewStyles","flatten","textStyles","borderStyleNames","marginStyleNames","extractBorderAndMarginStyles","additionalBorderStyles","additionalMarginStyles","flatStyle","borderStyles","marginStyles","applyStyles","baseStyles","stylesToApply","flattenedStyles","key","value","Object","entries","getValueForRadioButton","String","Error"],"sources":["utilities.ts"],"sourcesContent":["import { StyleSheet, StyleProp, TextStyle } from \"react-native\";\nimport { isString, isNumber, pick, pickBy, identity } from \"lodash\";\n\nexport function extractStyles(style: StyleProp<any>) {\n const {\n color,\n fontFamily,\n fontWeight,\n fontSize,\n lineHeight,\n letterSpacing,\n textTransform,\n textAlign,\n textDecorationLine,\n textDecorationColor,\n textDecorationStyle,\n ...viewStyles\n } = StyleSheet.flatten(style || {});\n\n const textStyles: TextStyle = {\n color,\n fontFamily,\n fontWeight,\n fontSize,\n lineHeight,\n letterSpacing,\n textTransform,\n textAlign,\n textDecorationLine,\n textDecorationColor,\n textDecorationStyle,\n };\n\n return { viewStyles, textStyles };\n}\n\nexport const borderStyleNames = [\n \"borderRadius\",\n \"borderBottomColor\",\n \"borderBottomEndRadius\",\n \"borderBottomLeftRadius\",\n \"borderBottomRightRadius\",\n \"borderBottomStartRadius\",\n \"borderBottomWidth\",\n \"borderColor\",\n \"borderEndColor\",\n \"borderLeftColor\",\n \"borderLeftWidth\",\n \"borderRadius\",\n \"borderRightColor\",\n \"borderRightWidth\",\n \"borderStartColor\",\n \"borderStyle\",\n \"borderTopColor\",\n \"borderTopEndRadius\",\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderTopStartRadius\",\n \"borderTopWidth\",\n \"borderWidth\",\n];\n\nexport const marginStyleNames = [\n \"margin\",\n \"marginBottom\",\n \"marginEnd\",\n \"marginHorizontal\",\n \"marginLeft\",\n \"marginRight\",\n \"marginStart\",\n \"marginTop\",\n \"marginVertical\",\n];\n\nexport function extractBorderAndMarginStyles(\n style: StyleProp<any>,\n additionalBorderStyles?: string[],\n additionalMarginStyles?: string[]\n) {\n const flatStyle = StyleSheet.flatten(style || {});\n\n const borderStyles = pickBy(\n pick(flatStyle, [\n ...borderStyleNames,\n ...(additionalBorderStyles ? additionalBorderStyles : []),\n ]),\n identity\n );\n\n const marginStyles = pickBy(\n pick(flatStyle, [\n ...marginStyleNames,\n ...(additionalMarginStyles ? additionalMarginStyles : []),\n ]),\n identity\n );\n\n return { borderStyles, marginStyles };\n}\n\n/**\n * Merges a style object on top of another style object. In React Native,\n * keys with undefined values in a style object will still override styles\n * that appear earlier in a sequence. This avoids that problem.\n *\n * This lets us avoid the `...(something ? { something } : {})` pattern.\n * There doesn't seem to be a better way to do this. These all seem to not\n * work (i.e. they all result in `{ color: undefined }`:\n * `const mergedStyles = [{ color: \"red\" }, { color: undefined }]`\n * `const mergedStyles = StyleSheet.compose({ color: \"red\" }, { color: undefined })`\n * `const mergedStyles = StyleSheet.flatten([{ color: \"red\" }, { color: undefined }])`\n */\nexport function applyStyles(\n baseStyles: Array<StyleProp<any>>,\n stylesToApply: StyleProp<any> | undefined\n) {\n if (!stylesToApply) {\n return;\n }\n\n const flattenedStyles = StyleSheet.flatten(baseStyles);\n\n for (const [key, value] of Object.entries(stylesToApply)) {\n if (value != null) {\n flattenedStyles[key] = value;\n }\n }\n\n return flattenedStyles;\n}\n\nexport function getValueForRadioButton(value: string | number) {\n if (isString(value)) {\n return value;\n } else if (isNumber(value)) {\n return String(value);\n } else {\n throw new Error(`Invalid value: ${value}`);\n }\n}\n"],"mappings":"AAAA,SAASA,UAAT,QAAiD,cAAjD;AACA,SAASC,QAAT,EAAmBC,QAAnB,EAA6BC,IAA7B,EAAmCC,MAAnC,EAA2CC,QAA3C,QAA2D,QAA3D;AAEA,OAAO,SAASC,aAAT,CAAuBC,KAAvB,EAA8C;EACnD,MAAM;IACJC,KADI;IAEJC,UAFI;IAGJC,UAHI;IAIJC,QAJI;IAKJC,UALI;IAMJC,aANI;IAOJC,aAPI;IAQJC,SARI;IASJC,kBATI;IAUJC,mBAVI;IAWJC,mBAXI;IAYJ,GAAGC;EAZC,IAaFnB,UAAU,CAACoB,OAAX,CAAmBb,KAAK,IAAI,EAA5B,CAbJ;EAeA,MAAMc,UAAqB,GAAG;IAC5Bb,KAD4B;IAE5BC,UAF4B;IAG5BC,UAH4B;IAI5BC,QAJ4B;IAK5BC,UAL4B;IAM5BC,aAN4B;IAO5BC,aAP4B;IAQ5BC,SAR4B;IAS5BC,kBAT4B;IAU5BC,mBAV4B;IAW5BC;EAX4B,CAA9B;EAcA,OAAO;IAAEC,UAAF;IAAcE;EAAd,CAAP;AACD;AAED,OAA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,UADK,EAELC,aAFK,EAGL;EACA,IAAI,CAACA,aAAL,EAAoB;IAClB;EACD;;EAED,MAAMC,eAAe,GAAGjC,UAAU,CAACoB,OAAX,CAAmBW,UAAnB,CAAxB;;EAEA,KAAK,MAAM,CAACG,GAAD,EAAMC,KAAN,CAAX,IAA2BC,MAAM,CAACC,OAAP,CAAeL,aAAf,CAA3B,EAA0D;IACxD,IAAIG,KAAK,IAAI,IAAb,EAAmB;MACjBF,eAAe,CAACC,GAAD,CAAf,GAAuBC,KAAvB;IACD;EACF;;EAED,OAAOF,eAAP;AACD;AAED,OAAO,SAASK,sBAAT,CAAgCH,KAAhC,EAAwD;EAC7D,IAAIlC,QAAQ,CAACkC,KAAD,CAAZ,EAAqB;IACnB,OAAOA,KAAP;EACD,CAFD,MAEO,IAAIjC,QAAQ,CAACiC,KAAD,CAAZ,EAAqB;IAC1B,OAAOI,MAAM,CAACJ,KAAD,CAAb;EACD,CAFM,MAEA;IACL,MAAM,IAAIK,KAAJ,0BAA4BL,KAA5B,EAAN;EACD;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.1.3",
3
+ "version": "46.2.0",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -41,7 +41,7 @@
41
41
  "dependencies": {
42
42
  "@date-io/date-fns": "^1.3.13",
43
43
  "@draftbit/react-theme-provider": "^2.1.1",
44
- "@draftbit/types": "^46.1.1",
44
+ "@draftbit/types": "^46.1.4",
45
45
  "@material-ui/core": "^4.11.0",
46
46
  "@material-ui/pickers": "^3.2.10",
47
47
  "@react-native-community/slider": "4.2.3",
@@ -79,5 +79,5 @@
79
79
  ]
80
80
  ]
81
81
  },
82
- "gitHead": "50d88e23c89fdd426db0b3948b0a36643c18ccb8"
82
+ "gitHead": "6928bf4d50679f6627255134daab0fb074881036"
83
83
  }
@@ -8,7 +8,7 @@ const ActionSheet = ({ visible = false, onClose, children }) => {
8
8
  React.createElement(Touchable, { style: styles.wrapper, onPress: onClose },
9
9
  React.createElement(View, { style: styles.overlay }),
10
10
  React.createElement(View, { style: styles.groupWrapper },
11
- React.createElement(View, { style: styles.group }, React.Children.toArray(children).filter((child) => child?.type !== ActionSheetCancel)),
11
+ React.createElement(View, { style: styles.group }, React.Children.toArray(children).filter((child) => (child === null || child === void 0 ? void 0 : child.type) !== ActionSheetCancel)),
12
12
  React.createElement(View, { style: styles.group }, React.Children.toArray(children).filter((child) => child.type === ActionSheetCancel)))))) : (React.createElement(React.Fragment, null));
13
13
  };
14
14
  const styles = StyleSheet.create({
@@ -15,9 +15,10 @@ function Pager({ color, index, length, }) {
15
15
  })));
16
16
  }
17
17
  function Carousel({ data, children, dotColor = "strong", style, ...rest }) {
18
+ var _a;
18
19
  const [index, setIndex] = React.useState(0);
19
20
  const length = React.Children.count(children);
20
- const itemsLength = (data?.length ?? 0) + length;
21
+ const itemsLength = ((_a = data === null || data === void 0 ? void 0 : data.length) !== null && _a !== void 0 ? _a : 0) + length;
21
22
  const slides = Array.isArray(data) ? data : [];
22
23
  const { width, height } = StyleSheet.flatten(style || {});
23
24
  const slideWidth = width || screenWidth;
@@ -35,7 +36,8 @@ function Carousel({ data, children, dotColor = "strong", style, ...rest }) {
35
36
  })
36
37
  : null,
37
38
  React.Children.map(children, (child) => {
38
- const s = child?.props?.style || {};
39
+ var _a;
40
+ const s = ((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.style) || {};
39
41
  return (React.createElement(View, { style: { width: slideWidth } }, React.cloneElement(child, {
40
42
  style: { ...s, width: slideWidth },
41
43
  })));
@@ -25,12 +25,12 @@ const Checkbox = ({ Icon, status, disabled = false, onPress, onCheck, onUncheck,
25
25
  const handlePress = () => {
26
26
  const newValue = !internalValue;
27
27
  setInternalValue(newValue);
28
- onPress?.(newValue);
28
+ onPress === null || onPress === void 0 ? void 0 : onPress(newValue);
29
29
  if (newValue) {
30
- onCheck?.();
30
+ onCheck === null || onCheck === void 0 ? void 0 : onCheck();
31
31
  }
32
32
  if (!newValue) {
33
- onUncheck?.();
33
+ onUncheck === null || onUncheck === void 0 ? void 0 : onUncheck();
34
34
  }
35
35
  };
36
36
  return (React.createElement(Touchable, { ...rest, onPress: handlePress, disabled: disabled, accessibilityState: { disabled }, accessibilityRole: "button", accessibilityLiveRegion: "polite", style: [styles.container, style, { width: size, height: size }] },
@@ -36,8 +36,8 @@ const CheckboxGroupRow = ({ Icon, label = "Label", status, value, onPress, label
36
36
  const isChecked = status || values.includes(value);
37
37
  const handlePress = () => {
38
38
  if (!disabled) {
39
- onPress?.(!isChecked);
40
- onValueChange?.(value, !isChecked);
39
+ onPress === null || onPress === void 0 ? void 0 : onPress(!isChecked);
40
+ onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(value, !isChecked);
41
41
  }
42
42
  };
43
43
  const { textStyles, viewStyles } = extractStyles(style);
@@ -37,12 +37,12 @@ const CheckboxRow = ({ label = "Label", labelStyle, labelContainerStyle, checkbo
37
37
  const handlePress = () => {
38
38
  const newValue = !internalValue;
39
39
  setInternalValue(newValue);
40
- onPress?.(newValue);
40
+ onPress === null || onPress === void 0 ? void 0 : onPress(newValue);
41
41
  if (newValue) {
42
- onCheck?.();
42
+ onCheck === null || onCheck === void 0 ? void 0 : onCheck();
43
43
  }
44
44
  if (!newValue) {
45
- onUncheck?.();
45
+ onUncheck === null || onUncheck === void 0 ? void 0 : onUncheck();
46
46
  }
47
47
  };
48
48
  const { textStyles, viewStyles } = extractStyles(style);
@@ -2,33 +2,36 @@ import React from "react";
2
2
  import { View } from "react-native";
3
3
  import { Svg, Path, G } from "react-native-svg";
4
4
  class CircularProgress extends React.Component {
5
- polarToCartesian = (centerX, centerY, radius, angleInDegrees) => {
6
- var angleInRadians = ((angleInDegrees - 90) * Math.PI) / 180.0;
7
- return {
8
- x: centerX + radius * Math.cos(angleInRadians),
9
- y: centerY + radius * Math.sin(angleInRadians),
5
+ constructor() {
6
+ super(...arguments);
7
+ this.polarToCartesian = (centerX, centerY, radius, angleInDegrees) => {
8
+ var angleInRadians = ((angleInDegrees - 90) * Math.PI) / 180.0;
9
+ return {
10
+ x: centerX + radius * Math.cos(angleInRadians),
11
+ y: centerY + radius * Math.sin(angleInRadians),
12
+ };
10
13
  };
11
- };
12
- circlePath = (x, y, radius, startAngle, endAngle) => {
13
- var start = this.polarToCartesian(x, y, radius, endAngle * 0.9999);
14
- var end = this.polarToCartesian(x, y, radius, startAngle);
15
- var largeArcFlag = endAngle - startAngle <= 180 ? "0" : "1";
16
- var d = [
17
- "M",
18
- start.x,
19
- start.y,
20
- "A",
21
- radius,
22
- radius,
23
- 0,
24
- largeArcFlag,
25
- 0,
26
- end.x,
27
- end.y,
28
- ];
29
- return d.join(" ");
30
- };
31
- clampFill = (fill) => Math.min(100, Math.max(0, fill));
14
+ this.circlePath = (x, y, radius, startAngle, endAngle) => {
15
+ var start = this.polarToCartesian(x, y, radius, endAngle * 0.9999);
16
+ var end = this.polarToCartesian(x, y, radius, startAngle);
17
+ var largeArcFlag = endAngle - startAngle <= 180 ? "0" : "1";
18
+ var d = [
19
+ "M",
20
+ start.x,
21
+ start.y,
22
+ "A",
23
+ radius,
24
+ radius,
25
+ 0,
26
+ largeArcFlag,
27
+ 0,
28
+ end.x,
29
+ end.y,
30
+ ];
31
+ return d.join(" ");
32
+ };
33
+ this.clampFill = (fill) => Math.min(100, Math.max(0, fill));
34
+ }
32
35
  render() {
33
36
  const { size, width, backgroundWidth, tintColor = "black", tintTransparency = true, backgroundColor, style, rotation = 90, lineCap = "butt", arcSweepAngle = 360, fill, children, childrenContainerStyle, padding = 0, renderCap, dashedBackground = { width: 0, gap: 0 }, dashedTint = { width: 0, gap: 0 }, } = this.props;
34
37
  const maxWidthCircle = backgroundWidth
@@ -40,7 +40,7 @@ const DatePicker = ({ Icon, style, theme: { colors, typography, roundness, disab
40
40
  if (!value) {
41
41
  return new Date();
42
42
  }
43
- return typeof value?.getMonth === "function" ? value : new Date();
43
+ return typeof (value === null || value === void 0 ? void 0 : value.getMonth) === "function" ? value : new Date();
44
44
  };
45
45
  const formatDate = () => {
46
46
  if (!value)
@@ -34,7 +34,7 @@ const NumberInput = ({ onChangeText, value, defaultValue, ...props }) => {
34
34
  const newStringNumberValue = formatValueToStringNumber(newValue);
35
35
  const number = parseFloat(newStringNumberValue);
36
36
  setCurrentStringNumberValue(newStringNumberValue);
37
- onChangeText?.(number);
37
+ onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(number);
38
38
  };
39
39
  // run handleChangeText with value prop only when value prop changes (and first render to reset currentStringNumberValue)
40
40
  useEffect(() => {
@@ -36,6 +36,7 @@ const unstyledColor = "rgba(165, 173, 183, 1)";
36
36
  const disabledColor = "rgb(240, 240, 240)";
37
37
  const errorColor = "rgba(255, 69, 100, 1)";
38
38
  const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style, placeholder, value, disabled = false, theme, assistiveText, label, iconColor = unstyledColor, iconSize = 24, leftIconMode = "inset", leftIconName, placeholderTextColor = unstyledColor, rightIconName, type = "solid", }) => {
39
+ var _a, _b;
39
40
  const androidPickerRef = React.useRef(undefined);
40
41
  const [internalValue, setInternalValue] = React.useState(value || defaultValue);
41
42
  const [pickerVisible, setPickerVisible] = React.useState(false);
@@ -53,8 +54,9 @@ const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style,
53
54
  }
54
55
  }, [defaultValue]);
55
56
  React.useEffect(() => {
57
+ var _a;
56
58
  if (pickerVisible && androidPickerRef.current) {
57
- androidPickerRef?.current?.focus();
59
+ (_a = androidPickerRef === null || androidPickerRef === void 0 ? void 0 : androidPickerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
58
60
  }
59
61
  }, [pickerVisible, androidPickerRef]);
60
62
  const normalizedOptions = normalizeOptions(options);
@@ -113,10 +115,8 @@ const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style,
113
115
  ...additionalBorderStyles,
114
116
  ...additionalMarginStyles,
115
117
  ]);
116
- const optionExists = internalValue
117
- ? pickerOptions.find((option) => option.value === internalValue)
118
- : { label: null };
119
- const selectedLabel = optionExists && optionExists.label ? optionExists.label : placeholder;
118
+ const selectedLabel = internalValue &&
119
+ ((_b = (_a = pickerOptions.find((option) => option.value === internalValue)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : internalValue);
120
120
  const labelText = label ? (React.createElement(Text, { style: {
121
121
  textAlign: textStyles.textAlign,
122
122
  color: unstyledColor,
@@ -132,7 +132,7 @@ const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style,
132
132
  marginRight: -10,
133
133
  marginLeft: 8,
134
134
  } })) : null;
135
- const textAlign = textStyles?.textAlign;
135
+ const textAlign = textStyles === null || textStyles === void 0 ? void 0 : textStyles.textAlign;
136
136
  const calculateLeftPadding = () => {
137
137
  if (leftIconOutset) {
138
138
  if (textAlign === "center") {
@@ -159,7 +159,7 @@ const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style,
159
159
  };
160
160
  const handleValueChange = (newValue, itemIndex) => {
161
161
  if (!placeholder || itemIndex > 0) {
162
- onValueChange?.(newValue, itemIndex);
162
+ onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(newValue, itemIndex);
163
163
  }
164
164
  setInternalValue(newValue);
165
165
  };
@@ -179,7 +179,7 @@ const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style,
179
179
  ] },
180
180
  React.createElement(View, { style: styles.primaryTextContainer },
181
181
  labelText,
182
- React.createElement(Text, { style: primaryTextStyle }, String(selectedLabel))),
182
+ React.createElement(Text, { style: primaryTextStyle }, String(selectedLabel !== null && selectedLabel !== void 0 ? selectedLabel : placeholder))),
183
183
  rightIcon)),
184
184
  assistiveTextLabel),
185
185
  isIos && pickerVisible ? (React.createElement(Portal, null,
@@ -212,12 +212,12 @@ const Picker: React.FC<PickerProps> = ({
212
212
  ...additionalMarginStyles,
213
213
  ]);
214
214
 
215
- const optionExists = internalValue
216
- ? pickerOptions.find((option) => option.value === internalValue)
217
- : { label: null };
218
-
219
215
  const selectedLabel =
220
- optionExists && optionExists.label ? optionExists.label : placeholder;
216
+ internalValue &&
217
+ ((pickerOptions as unknown as PickerOption[]).find(
218
+ (option) => option.value === internalValue
219
+ )?.label ??
220
+ internalValue);
221
221
 
222
222
  const labelText = label ? (
223
223
  <Text
@@ -333,7 +333,9 @@ const Picker: React.FC<PickerProps> = ({
333
333
  <View style={styles.primaryTextContainer}>
334
334
  {labelText}
335
335
 
336
- <Text style={primaryTextStyle}>{String(selectedLabel)}</Text>
336
+ <Text style={primaryTextStyle}>
337
+ {String(selectedLabel ?? placeholder)}
338
+ </Text>
337
339
  </View>
338
340
 
339
341
  {rightIcon}
@@ -7,6 +7,7 @@ import { extractStyles } from "../../utilities";
7
7
  import TextField from "../TextField";
8
8
  import Touchable from "../Touchable";
9
9
  const Picker = ({ style, options, placeholder, selectedValue, disabled = false, onValueChange: onValueChangeOverride = () => { }, ...props }) => {
10
+ var _a, _b;
10
11
  const { viewStyles: { borderRadius, // eslint-disable-line @typescript-eslint/no-unused-vars
11
12
  borderWidth, // eslint-disable-line @typescript-eslint/no-unused-vars
12
13
  borderTopWidth, // eslint-disable-line @typescript-eslint/no-unused-vars
@@ -41,7 +42,7 @@ const Picker = ({ style, options, placeholder, selectedValue, disabled = false,
41
42
  "marginLeft",
42
43
  ]);
43
44
  const selectedLabel = selectedValue &&
44
- (options.find((o) => o.value === selectedValue)?.label ?? selectedValue);
45
+ ((_b = (_a = options.find((o) => o.value === selectedValue)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : selectedValue);
45
46
  return (React.createElement(Touchable, { disabled: disabled, onPress: toggleFocus, style: [styles.container, viewStyles] },
46
47
  React.createElement(View, null,
47
48
  React.createElement(NativePicker, { enabled: !disabled, selectedValue: selectedValue, onValueChange: onValueChange, style: {
@@ -10,6 +10,7 @@ import TextField from "../TextField";
10
10
  import Touchable from "../Touchable";
11
11
  import { extractStyles } from "../../utilities";
12
12
  const Picker = ({ Icon, style, options, placeholder, selectedValue, disabled = false, onValueChange = () => { }, theme: { colors }, ...props }) => {
13
+ var _a, _b;
13
14
  const { viewStyles: { borderRadius, // eslint-disable-line @typescript-eslint/no-unused-vars
14
15
  borderWidth, // eslint-disable-line @typescript-eslint/no-unused-vars
15
16
  borderTopWidth, // eslint-disable-line @typescript-eslint/no-unused-vars
@@ -40,7 +41,7 @@ const Picker = ({ Icon, style, options, placeholder, selectedValue, disabled = f
40
41
  "marginLeft",
41
42
  ]);
42
43
  const selectedLabel = selectedValue &&
43
- (options.find((o) => o.value === selectedValue)?.label ?? selectedValue);
44
+ ((_b = (_a = options.find((o) => o.value === selectedValue)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : selectedValue);
44
45
  return (React.createElement(View, { style: [styles.container, viewStyles] },
45
46
  React.createElement(Touchable, { disabled: disabled, onPress: toggleVisibility },
46
47
  React.createElement(TextField, { ...props, value: String(selectedLabel), placeholder: placeholder,
@@ -7,6 +7,7 @@ import { extractStyles } from "../../utilities";
7
7
  import TextField from "../TextField";
8
8
  import Touchable from "../Touchable";
9
9
  const Picker = ({ style, options, placeholder, selectedValue, disabled = false, onValueChange: onValueChangeOverride = () => { }, ...props }) => {
10
+ var _a, _b;
10
11
  const { viewStyles: { borderRadius, // eslint-disable-line @typescript-eslint/no-unused-vars
11
12
  borderWidth, // eslint-disable-line @typescript-eslint/no-unused-vars
12
13
  borderTopWidth, // eslint-disable-line @typescript-eslint/no-unused-vars
@@ -41,7 +42,7 @@ const Picker = ({ style, options, placeholder, selectedValue, disabled = false,
41
42
  "marginLeft",
42
43
  ]);
43
44
  const selectedLabel = selectedValue &&
44
- (options.find((o) => o.value === selectedValue)?.label ?? selectedValue);
45
+ ((_b = (_a = options.find((o) => o.value === selectedValue)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : selectedValue);
45
46
  return (React.createElement(Touchable, { disabled: disabled, onPress: toggleFocus, style: [styles.container, viewStyles] },
46
47
  React.createElement(View, null,
47
48
  React.createElement(NativePicker, { enabled: !disabled, selectedValue: selectedValue, onValueChange: onValueChange, style: {
@@ -24,12 +24,12 @@ import { ThemeProvider, withTheme } from "../../theming";
24
24
  * ```
25
25
  */
26
26
  class Portal extends React.Component {
27
- // @component ./PortalHost.tsx
28
- static Host = PortalHost;
29
27
  render() {
30
28
  const { children, theme } = this.props;
31
29
  return (React.createElement(PortalContext.Consumer, null, (manager) => (React.createElement(PortalConsumer, { manager: manager },
32
30
  React.createElement(ThemeProvider, { theme: theme }, children)))));
33
31
  }
34
32
  }
33
+ // @component ./PortalHost.tsx
34
+ Portal.Host = PortalHost;
35
35
  export default withTheme(Portal);
@@ -14,7 +14,6 @@ export default class PortalConsumer extends React.Component {
14
14
  this.checkManager();
15
15
  this.props.manager.unmount(this.key);
16
16
  }
17
- key;
18
17
  checkManager() {
19
18
  if (!this.props.manager) {
20
19
  throw new Error("Looks like you forgot to wrap your root component with `Provider` component from `react-native-paper`.\n\n" +