react-native-paper-dates 0.9.1 → 0.10.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 (133) hide show
  1. package/README.md +1 -1
  2. package/lib/commonjs/Date/AnimatedCrossView.js +1 -4
  3. package/lib/commonjs/Date/AnimatedCrossView.js.map +1 -1
  4. package/lib/commonjs/Date/Calendar.js +1 -1
  5. package/lib/commonjs/Date/Calendar.js.map +1 -1
  6. package/lib/commonjs/Date/DatePickerInput.js +4 -2
  7. package/lib/commonjs/Date/DatePickerInput.js.map +1 -1
  8. package/lib/commonjs/Date/DatePickerInput.shared.js.map +1 -1
  9. package/lib/commonjs/Date/DatePickerInputWithoutModal.js +17 -12
  10. package/lib/commonjs/Date/DatePickerInputWithoutModal.js.map +1 -1
  11. package/lib/commonjs/Date/DatePickerModalContent.js +3 -3
  12. package/lib/commonjs/Date/DatePickerModalContent.js.map +1 -1
  13. package/lib/commonjs/Date/DatePickerModalContentHeader.js +5 -2
  14. package/lib/commonjs/Date/DatePickerModalContentHeader.js.map +1 -1
  15. package/lib/commonjs/Date/DatePickerModalHeader.js +13 -14
  16. package/lib/commonjs/Date/DatePickerModalHeader.js.map +1 -1
  17. package/lib/commonjs/Date/DatePickerModalHeaderBackground.js +7 -8
  18. package/lib/commonjs/Date/DatePickerModalHeaderBackground.js.map +1 -1
  19. package/lib/commonjs/Date/Day.js +5 -4
  20. package/lib/commonjs/Date/Day.js.map +1 -1
  21. package/lib/commonjs/Date/DayName.js +3 -1
  22. package/lib/commonjs/Date/DayName.js.map +1 -1
  23. package/lib/commonjs/Date/Month.js +3 -1
  24. package/lib/commonjs/Date/Month.js.map +1 -1
  25. package/lib/commonjs/Date/Swiper.js +1 -2
  26. package/lib/commonjs/Date/Swiper.js.map +1 -1
  27. package/lib/commonjs/Date/YearPicker.js +4 -2
  28. package/lib/commonjs/Date/YearPicker.js.map +1 -1
  29. package/lib/commonjs/TextInputMask.js +9 -4
  30. package/lib/commonjs/TextInputMask.js.map +1 -1
  31. package/lib/commonjs/Time/AmPmSwitcher.js +3 -2
  32. package/lib/commonjs/Time/AmPmSwitcher.js.map +1 -1
  33. package/lib/commonjs/Time/AnalogClock.js +1 -1
  34. package/lib/commonjs/Time/AnalogClock.js.map +1 -1
  35. package/lib/commonjs/Time/TimeInputs.js +7 -4
  36. package/lib/commonjs/Time/TimeInputs.js.map +1 -1
  37. package/lib/commonjs/Time/TimePicker.js +4 -1
  38. package/lib/commonjs/Time/TimePicker.js.map +1 -1
  39. package/lib/commonjs/Time/TimePickerModal.js +15 -4
  40. package/lib/commonjs/Time/TimePickerModal.js.map +1 -1
  41. package/lib/commonjs/Time/timeUtils.js +35 -3
  42. package/lib/commonjs/Time/timeUtils.js.map +1 -1
  43. package/lib/commonjs/translations/utils.js +2 -2
  44. package/lib/commonjs/translations/utils.js.map +1 -1
  45. package/lib/commonjs/utils.js.map +1 -1
  46. package/lib/module/Date/AnimatedCrossView.js +1 -3
  47. package/lib/module/Date/AnimatedCrossView.js.map +1 -1
  48. package/lib/module/Date/Calendar.js +1 -1
  49. package/lib/module/Date/Calendar.js.map +1 -1
  50. package/lib/module/Date/DatePickerInput.js +4 -2
  51. package/lib/module/Date/DatePickerInput.js.map +1 -1
  52. package/lib/module/Date/DatePickerInput.shared.js.map +1 -1
  53. package/lib/module/Date/DatePickerInputWithoutModal.js +17 -12
  54. package/lib/module/Date/DatePickerInputWithoutModal.js.map +1 -1
  55. package/lib/module/Date/DatePickerModalContent.js +3 -3
  56. package/lib/module/Date/DatePickerModalContent.js.map +1 -1
  57. package/lib/module/Date/DatePickerModalContentHeader.js +6 -3
  58. package/lib/module/Date/DatePickerModalContentHeader.js.map +1 -1
  59. package/lib/module/Date/DatePickerModalHeader.js +13 -15
  60. package/lib/module/Date/DatePickerModalHeader.js.map +1 -1
  61. package/lib/module/Date/DatePickerModalHeaderBackground.js +7 -9
  62. package/lib/module/Date/DatePickerModalHeaderBackground.js.map +1 -1
  63. package/lib/module/Date/Day.js +5 -4
  64. package/lib/module/Date/Day.js.map +1 -1
  65. package/lib/module/Date/DayName.js +3 -1
  66. package/lib/module/Date/DayName.js.map +1 -1
  67. package/lib/module/Date/Month.js +3 -1
  68. package/lib/module/Date/Month.js.map +1 -1
  69. package/lib/module/Date/Swiper.js +1 -2
  70. package/lib/module/Date/Swiper.js.map +1 -1
  71. package/lib/module/Date/YearPicker.js +4 -2
  72. package/lib/module/Date/YearPicker.js.map +1 -1
  73. package/lib/module/TextInputMask.js +9 -4
  74. package/lib/module/TextInputMask.js.map +1 -1
  75. package/lib/module/Time/AmPmSwitcher.js +3 -2
  76. package/lib/module/Time/AmPmSwitcher.js.map +1 -1
  77. package/lib/module/Time/AnalogClock.js +1 -1
  78. package/lib/module/Time/AnalogClock.js.map +1 -1
  79. package/lib/module/Time/TimeInputs.js +6 -4
  80. package/lib/module/Time/TimeInputs.js.map +1 -1
  81. package/lib/module/Time/TimePicker.js +4 -1
  82. package/lib/module/Time/TimePicker.js.map +1 -1
  83. package/lib/module/Time/TimePickerModal.js +15 -4
  84. package/lib/module/Time/TimePickerModal.js.map +1 -1
  85. package/lib/module/Time/timeUtils.js +35 -3
  86. package/lib/module/Time/timeUtils.js.map +1 -1
  87. package/lib/module/translations/utils.js +2 -2
  88. package/lib/module/translations/utils.js.map +1 -1
  89. package/lib/module/utils.js.map +1 -1
  90. package/lib/typescript/Date/AutoSizer.d.ts +1 -1
  91. package/lib/typescript/Date/Calendar.d.ts +10 -10
  92. package/lib/typescript/Date/DatePickerInput.d.ts +1 -1
  93. package/lib/typescript/Date/DatePickerInput.shared.d.ts +2 -1
  94. package/lib/typescript/Date/DatePickerInputWithoutModal.d.ts +10 -4
  95. package/lib/typescript/Date/DatePickerModalContent.d.ts +1 -1
  96. package/lib/typescript/Date/Day.d.ts +2 -2
  97. package/lib/typescript/Date/SwiperUtils.d.ts +2 -2
  98. package/lib/typescript/Date/dateUtils.d.ts +1 -1
  99. package/lib/typescript/TextInputMask.d.ts +9 -4
  100. package/lib/typescript/Time/TimePicker.d.ts +1 -1
  101. package/lib/typescript/Time/timeUtils.d.ts +7 -7
  102. package/lib/typescript/translations/utils.d.ts +1 -1
  103. package/lib/typescript/utils.d.ts +2 -0
  104. package/package.json +9 -8
  105. package/src/Date/AnimatedCrossView.tsx +0 -4
  106. package/src/Date/Calendar.tsx +2 -2
  107. package/src/Date/DatePickerInput.shared.tsx +1 -0
  108. package/src/Date/DatePickerInput.tsx +2 -1
  109. package/src/Date/DatePickerInputWithoutModal.tsx +37 -35
  110. package/src/Date/DatePickerModalContent.tsx +3 -3
  111. package/src/Date/DatePickerModalContentHeader.tsx +9 -4
  112. package/src/Date/DatePickerModalHeader.tsx +35 -37
  113. package/src/Date/DatePickerModalHeaderBackground.tsx +6 -7
  114. package/src/Date/Day.tsx +12 -4
  115. package/src/Date/DayName.tsx +7 -5
  116. package/src/Date/Month.tsx +12 -2
  117. package/src/Date/Swiper.tsx +0 -1
  118. package/src/Date/YearPicker.tsx +16 -4
  119. package/src/TextInputMask.tsx +8 -4
  120. package/src/Time/AmPmSwitcher.tsx +11 -3
  121. package/src/Time/AnalogClock.tsx +3 -1
  122. package/src/Time/TimeInputs.tsx +32 -4
  123. package/src/Time/TimePicker.tsx +4 -1
  124. package/src/Time/TimePickerModal.tsx +29 -3
  125. package/src/Time/timeUtils.ts +31 -4
  126. package/src/translations/utils.ts +2 -2
  127. package/src/utils.ts +8 -1
  128. package/lib/commonjs/Date/DateRangeInput.js +0 -86
  129. package/lib/commonjs/Date/DateRangeInput.js.map +0 -1
  130. package/lib/module/Date/DateRangeInput.js +0 -69
  131. package/lib/module/Date/DateRangeInput.js.map +0 -1
  132. package/lib/typescript/Date/DateRangeInput.d.ts +0 -4
  133. package/src/Date/DateRangeInput.tsx +0 -75
@@ -13,6 +13,7 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<import("react-
13
13
  activeUnderlineColor?: string | undefined;
14
14
  outlineColor?: string | undefined;
15
15
  activeOutlineColor?: string | undefined;
16
+ textColor?: string | undefined;
16
17
  dense?: boolean | undefined;
17
18
  multiline?: boolean | undefined;
18
19
  numberOfLines?: number | undefined;
@@ -21,16 +22,20 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<import("react-
21
22
  render?: ((props: import("react-native-paper/lib/typescript/components/TextInput/types").RenderProps) => React.ReactNode) | undefined;
22
23
  value?: string | undefined;
23
24
  style?: import("react-native").StyleProp<import("react-native").TextStyle>;
24
- theme: ReactNativePaper.Theme;
25
+ theme: import("react-native-paper/lib/typescript/types").InternalTheme;
26
+ testID?: string | undefined;
27
+ outlineStyle?: import("react-native").StyleProp<import("react-native").ViewStyle>;
28
+ underlineStyle?: import("react-native").StyleProp<import("react-native").ViewStyle>;
25
29
  } & React.RefAttributes<{
26
30
  focus: () => void;
27
31
  clear: () => void;
28
32
  blur: () => void;
29
33
  isFocused: () => boolean;
30
34
  setNativeProps: (nativeProps: object) => void;
31
- }>, "label" | "style" | "children" | "pointerEvents" | "allowFontScaling" | "numberOfLines" | "onLayout" | "onPressIn" | "onPressOut" | "testID" | "nativeID" | "maxFontSizeMultiplier" | "selectionColor" | "textBreakStrategy" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "left" | "right" | "ref" | "key" | "hitSlop" | "removeClippedSubviews" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "value" | "mode" | "textAlign" | "render" | "textAlignVertical" | "disabled" | "onBlur" | "onFocus" | "multiline" | "error" | "placeholder" | "onContentSizeChange" | "onScroll" | "scrollEnabled" | "autoCapitalize" | "autoCorrect" | "autoFocus" | "blurOnSubmit" | "caretHidden" | "contextMenuHidden" | "defaultValue" | "editable" | "keyboardType" | "maxLength" | "onChange" | "onChangeText" | "onEndEditing" | "onSelectionChange" | "onSubmitEditing" | "onTextInput" | "onKeyPress" | "placeholderTextColor" | "returnKeyType" | "secureTextEntry" | "selectTextOnFocus" | "selection" | "inputAccessoryViewID" | "clearButtonMode" | "clearTextOnFocus" | "dataDetectorTypes" | "enablesReturnKeyAutomatically" | "keyboardAppearance" | "passwordRules" | "rejectResponderTermination" | "selectionState" | "spellCheck" | "textContentType" | "autoComplete" | "importantForAutofill" | "disableFullscreenUI" | "inlineImageLeft" | "inlineImagePadding" | "returnKeyLabel" | "underlineColorAndroid" | "showSoftInputOnFocus" | "underlineColor" | "activeUnderlineColor" | "outlineColor" | "activeOutlineColor" | "dense"> & {
32
- theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
35
+ }>, "label" | "style" | "children" | "pointerEvents" | "allowFontScaling" | "numberOfLines" | "onLayout" | "onPressIn" | "onPressOut" | "testID" | "nativeID" | "maxFontSizeMultiplier" | "disabled" | "selectionColor" | "textBreakStrategy" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLabelledBy" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "left" | "right" | "ref" | "key" | "hitSlop" | "removeClippedSubviews" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerUp" | "onPointerUpCapture" | "value" | "mode" | "error" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "onKeyPress" | "onScroll" | "defaultValue" | "spellCheck" | "autoCapitalize" | "autoCorrect" | "autoFocus" | "autoComplete" | "maxLength" | "textAlign" | "textAlignVertical" | "multiline" | "onContentSizeChange" | "scrollEnabled" | "textColor" | "dense" | "render" | "blurOnSubmit" | "caretHidden" | "contextMenuHidden" | "editable" | "keyboardType" | "onChangeText" | "onEndEditing" | "onSelectionChange" | "onSubmitEditing" | "onTextInput" | "placeholderTextColor" | "returnKeyType" | "secureTextEntry" | "selectTextOnFocus" | "selection" | "inputAccessoryViewID" | "clearButtonMode" | "clearTextOnFocus" | "dataDetectorTypes" | "enablesReturnKeyAutomatically" | "keyboardAppearance" | "passwordRules" | "rejectResponderTermination" | "selectionState" | "textContentType" | "cursorColor" | "importantForAutofill" | "disableFullscreenUI" | "inlineImageLeft" | "inlineImagePadding" | "returnKeyLabel" | "underlineColorAndroid" | "showSoftInputOnFocus" | "underlineColor" | "activeUnderlineColor" | "outlineColor" | "activeOutlineColor" | "outlineStyle" | "underlineStyle"> & {
36
+ theme?: import("@callstack/react-theme-provider").$DeepPartial<unknown> | undefined;
33
37
  } & {
34
38
  mask: string;
35
- }, "label" | "style" | "children" | "pointerEvents" | "allowFontScaling" | "numberOfLines" | "onLayout" | "onPressIn" | "onPressOut" | "testID" | "nativeID" | "maxFontSizeMultiplier" | "selectionColor" | "textBreakStrategy" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "left" | "right" | "key" | "hitSlop" | "removeClippedSubviews" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "value" | "mode" | "textAlign" | "render" | "textAlignVertical" | "disabled" | "onBlur" | "onFocus" | "multiline" | "error" | "placeholder" | "onContentSizeChange" | "onScroll" | "scrollEnabled" | "autoCapitalize" | "autoCorrect" | "autoFocus" | "blurOnSubmit" | "caretHidden" | "contextMenuHidden" | "defaultValue" | "editable" | "keyboardType" | "maxLength" | "onChange" | "onChangeText" | "onEndEditing" | "onSelectionChange" | "onSubmitEditing" | "onTextInput" | "onKeyPress" | "placeholderTextColor" | "returnKeyType" | "secureTextEntry" | "selectTextOnFocus" | "selection" | "inputAccessoryViewID" | "clearButtonMode" | "clearTextOnFocus" | "dataDetectorTypes" | "enablesReturnKeyAutomatically" | "keyboardAppearance" | "passwordRules" | "rejectResponderTermination" | "selectionState" | "spellCheck" | "textContentType" | "autoComplete" | "importantForAutofill" | "disableFullscreenUI" | "inlineImageLeft" | "inlineImagePadding" | "returnKeyLabel" | "underlineColorAndroid" | "showSoftInputOnFocus" | "underlineColor" | "activeUnderlineColor" | "outlineColor" | "activeOutlineColor" | "dense" | "mask" | "theme"> & React.RefAttributes<unknown>>;
39
+ value: string;
40
+ }, "label" | "style" | "children" | "pointerEvents" | "allowFontScaling" | "numberOfLines" | "onLayout" | "onPressIn" | "onPressOut" | "testID" | "nativeID" | "maxFontSizeMultiplier" | "disabled" | "selectionColor" | "textBreakStrategy" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLabelledBy" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "left" | "right" | "key" | "hitSlop" | "removeClippedSubviews" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerUp" | "onPointerUpCapture" | "value" | "mode" | "error" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "onKeyPress" | "onScroll" | "defaultValue" | "spellCheck" | "autoCapitalize" | "autoCorrect" | "autoFocus" | "autoComplete" | "maxLength" | "textAlign" | "textAlignVertical" | "multiline" | "onContentSizeChange" | "scrollEnabled" | "textColor" | "dense" | "render" | "blurOnSubmit" | "caretHidden" | "contextMenuHidden" | "editable" | "keyboardType" | "onChangeText" | "onEndEditing" | "onSelectionChange" | "onSubmitEditing" | "onTextInput" | "placeholderTextColor" | "returnKeyType" | "secureTextEntry" | "selectTextOnFocus" | "selection" | "inputAccessoryViewID" | "clearButtonMode" | "clearTextOnFocus" | "dataDetectorTypes" | "enablesReturnKeyAutomatically" | "keyboardAppearance" | "passwordRules" | "rejectResponderTermination" | "selectionState" | "textContentType" | "cursorColor" | "importantForAutofill" | "disableFullscreenUI" | "inlineImageLeft" | "inlineImagePadding" | "returnKeyLabel" | "underlineColorAndroid" | "showSoftInputOnFocus" | "underlineColor" | "activeUnderlineColor" | "outlineColor" | "activeOutlineColor" | "outlineStyle" | "underlineStyle" | "mask" | "theme"> & React.RefAttributes<unknown>>;
36
41
  export default _default;
@@ -4,7 +4,7 @@ export declare const DisplayModeContext: React.Context<{
4
4
  mode: 'AM' | 'PM' | undefined;
5
5
  setMode: React.Dispatch<React.SetStateAction<'AM' | 'PM' | undefined>>;
6
6
  }>;
7
- declare type onChangeFunc = ({ hours, minutes, focused, }: {
7
+ type onChangeFunc = ({ hours, minutes, focused, }: {
8
8
  hours: number;
9
9
  minutes: number;
10
10
  focused?: undefined | PossibleClockTypes;
@@ -1,23 +1,23 @@
1
1
  export declare const circleSize = 215;
2
- export declare type PossibleHourTypes = 'am' | 'pm';
3
- export declare type HourTypeMap = {
2
+ export type PossibleHourTypes = 'am' | 'pm';
3
+ export type HourTypeMap = {
4
4
  [hourType in PossibleHourTypes]: PossibleHourTypes;
5
5
  };
6
6
  export declare const hourTypes: HourTypeMap;
7
7
  export declare function getHourType(hours: number): PossibleHourTypes | undefined;
8
- export declare type PossibleInputTypes = 'keyboard' | 'picker';
9
- export declare type InputTypeMap = {
8
+ export type PossibleInputTypes = 'keyboard' | 'picker';
9
+ export type InputTypeMap = {
10
10
  [inputType in PossibleInputTypes]: PossibleInputTypes;
11
11
  };
12
12
  export declare const inputTypes: InputTypeMap;
13
13
  export declare const reverseInputTypes: InputTypeMap;
14
- declare type InputIconMap = {
14
+ type InputIconMap = {
15
15
  [inputType in PossibleInputTypes]: string;
16
16
  };
17
17
  export declare const inputTypeIcons: InputIconMap;
18
18
  export declare const getTimeInputTypeIcon: (inputType: PossibleInputTypes, inputIconMap?: InputIconMap) => string;
19
- export declare type PossibleClockTypes = 'hours' | 'minutes';
20
- export declare type ClockTypeMap = {
19
+ export type PossibleClockTypes = 'hours' | 'minutes';
20
+ export type ClockTypeMap = {
21
21
  [clockType in PossibleClockTypes]: PossibleClockTypes;
22
22
  };
23
23
  export declare const clockTypes: ClockTypeMap;
@@ -1,4 +1,4 @@
1
- export declare type TranslationsType = {
1
+ export type TranslationsType = {
2
2
  selectSingle: string;
3
3
  selectMultiple: string;
4
4
  selectRange: string;
@@ -1,5 +1,7 @@
1
1
  import * as React from 'react';
2
+ import { DefaultTheme, MD3DarkTheme } from 'react-native-paper';
2
3
  import Color from 'color';
4
+ export type PaperTheme = typeof MD3DarkTheme | typeof DefaultTheme;
3
5
  export declare function useLatest<T>(value: T): React.MutableRefObject<T>;
4
6
  export declare function useHeaderBackgroundColor(): string;
5
7
  export declare function useHeaderColorIsLight(): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-paper-dates",
3
- "version": "0.9.1",
3
+ "version": "0.10.0",
4
4
  "description": "Performant Date Picker for React Native Paper",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -51,25 +51,26 @@
51
51
  "@react-native-community/eslint-config": "^3.1.0",
52
52
  "@release-it/conventional-changelog": "^5.1.0",
53
53
  "@types/color": "^3.0.3",
54
- "@types/jest": "^28.1.8",
55
- "@types/react": "^18.0.17",
56
- "@types/react-native": "^0.69.5",
54
+ "@types/jest": "^29.2.4",
55
+ "@types/react": "^18.0.26",
56
+ "@types/react-native": "^0.70.8",
57
57
  "babel-loader": "^8.2.5",
58
58
  "commitlint": "^17.0.3",
59
59
  "eslint": "^8.22.0",
60
60
  "eslint-config-prettier": "^8.5.0",
61
61
  "eslint-plugin-prettier": "^4.2.1",
62
- "expo-cli": "^6.0.5",
62
+ "expo-cli": "^6.0.8",
63
63
  "husky": "^8.0.1",
64
64
  "jest": "^29.0.0",
65
65
  "pod-install": "^0.1.38",
66
66
  "prettier": "^2.7.1",
67
67
  "react": "^18.2.0",
68
- "react-native": "^0.69.5",
68
+ "react-native": "^0.70.6",
69
69
  "react-native-builder-bob": "^0.18.3",
70
- "react-native-paper": "^4.12.4",
70
+ "react-native-paper": "^5.0.2",
71
+ "react-native-safe-area-context": "^4.4.1",
71
72
  "release-it": "^15.4.0",
72
- "typescript": "^4.7.4"
73
+ "typescript": "^4.9.4"
73
74
  },
74
75
  "peerDependencies": {
75
76
  "react": "*",
@@ -3,14 +3,12 @@ import { Animated, StyleSheet, View } from 'react-native'
3
3
  import { useTheme } from 'react-native-paper'
4
4
 
5
5
  export default function AnimatedCrossView({
6
- // visible,
7
6
  collapsed,
8
7
  calendar,
9
8
  calendarEdit,
10
9
  }: {
11
10
  calendar: any
12
11
  calendarEdit: any
13
- // visible: boolean
14
12
  collapsed: boolean
15
13
  }) {
16
14
  const theme = useTheme()
@@ -18,13 +16,11 @@ export default function AnimatedCrossView({
18
16
  new Animated.Value(collapsed ? 1 : 0)
19
17
  )
20
18
  React.useEffect(() => {
21
- // if (visible) {
22
19
  Animated.timing(calendarOpacity.current, {
23
20
  toValue: collapsed ? 1 : 0,
24
21
  duration: 250,
25
22
  useNativeDriver: true,
26
23
  }).start()
27
- // }
28
24
  }, [collapsed])
29
25
 
30
26
  return (
@@ -34,7 +34,7 @@ export type BaseCalendarProps = {
34
34
  startYear?: number
35
35
  endYear?: number
36
36
 
37
- // here they are optional but in final implemenation they are required
37
+ // here they are optional but in final implementation they are required
38
38
  date?: CalendarDate
39
39
  dates?: CalendarDates
40
40
  startDate?: CalendarDate
@@ -101,7 +101,7 @@ function Calendar(
101
101
 
102
102
  const selectColor = useMemo<string>(() => {
103
103
  if (theme.dark) {
104
- return darkenBy(Color(theme.colors.primary), 0.9).hex()
104
+ return darkenBy(Color(theme.colors.primary), 0.1).hex()
105
105
  }
106
106
  return lightenBy(Color(theme.colors.primary), 0.9).hex()
107
107
  }, [theme])
@@ -11,6 +11,7 @@ export type DatePickerInputProps = {
11
11
  withModal?: boolean
12
12
  withDateFormatInLabel?: boolean
13
13
  calendarIcon?: string
14
+ saveLabel?: string
14
15
  } & Omit<
15
16
  React.ComponentProps<typeof TextInput>,
16
17
  'value' | 'onChange' | 'onChangeText'
@@ -42,7 +42,7 @@ function DatePickerInput(
42
42
  />
43
43
  ) : null
44
44
  }
45
- modal={({ value, locale, inputMode, validRange }) =>
45
+ modal={({ value, locale, inputMode, validRange, saveLabel }) =>
46
46
  withModal ? (
47
47
  <DatePickerModal
48
48
  date={value}
@@ -53,6 +53,7 @@ function DatePickerInput(
53
53
  locale={locale}
54
54
  dateMode={inputMode}
55
55
  validRange={validRange}
56
+ saveLabel={saveLabel}
56
57
  />
57
58
  ) : null
58
59
  }
@@ -18,6 +18,7 @@ function DatePickerInputWithoutModal(
18
18
  withDateFormatInLabel = true,
19
19
  modal,
20
20
  inputButtons,
21
+ saveLabel,
21
22
  ...rest
22
23
  }: DatePickerInputProps & {
23
24
  modal?: (params: {
@@ -25,6 +26,7 @@ function DatePickerInputWithoutModal(
25
26
  locale: DatePickerInputProps['locale']
26
27
  inputMode: DatePickerInputProps['inputMode']
27
28
  validRange: DatePickerInputProps['validRange']
29
+ saveLabel: DatePickerInputProps['saveLabel']
28
30
  }) => any
29
31
  inputButtons?: any
30
32
  },
@@ -42,38 +44,34 @@ function DatePickerInputWithoutModal(
42
44
  return (
43
45
  <>
44
46
  <View style={styles.root}>
45
- <TextInputWithMask
46
- {...rest}
47
- ref={ref}
48
- label={getLabel({
49
- // TODO: support label components?
50
- label: label as any,
51
- inputFormat,
52
- withDateFormatInLabel,
53
- })}
54
- value={formattedValue}
55
- keyboardType={'number-pad'}
56
- placeholder={inputFormat}
57
- mask={inputFormat}
58
- onChangeText={onChangeText}
59
- keyboardAppearance={theme.dark ? 'dark' : 'default'}
60
- error={!!error}
61
- style={[styles.input, style]}
62
- />
63
- {inputButtons}
64
- {!!error ? (
65
- <View style={styles.helperText}>
66
- <HelperText
67
- style={styles.helperText}
68
- type="error"
69
- visible={!!error}
70
- >
71
- {error}
72
- </HelperText>
73
- </View>
47
+ <View style={styles.inputContainer}>
48
+ <TextInputWithMask
49
+ {...rest}
50
+ ref={ref}
51
+ label={getLabel({
52
+ // TODO: support label components?
53
+ label: label as any,
54
+ inputFormat,
55
+ withDateFormatInLabel,
56
+ })}
57
+ value={formattedValue}
58
+ keyboardType={'number-pad'}
59
+ placeholder={inputFormat}
60
+ mask={inputFormat}
61
+ onChangeText={onChangeText}
62
+ keyboardAppearance={theme.dark ? 'dark' : 'default'}
63
+ error={!!error}
64
+ style={[styles.input, style]}
65
+ />
66
+ {inputButtons}
67
+ </View>
68
+ {error ? (
69
+ <HelperText style={styles.helperText} type="error" visible={!!error}>
70
+ {error}
71
+ </HelperText>
74
72
  ) : null}
75
73
  </View>
76
- {modal?.({ value, locale, inputMode, validRange })}
74
+ {modal?.({ value, locale, inputMode, validRange, saveLabel })}
77
75
  </>
78
76
  )
79
77
  }
@@ -95,16 +93,20 @@ function getLabel({
95
93
 
96
94
  const styles = StyleSheet.create({
97
95
  root: {
98
- minWidth: 150,
99
96
  flexGrow: 1,
100
- justifyContent: 'center',
97
+ backgroundColor: 'pink',
101
98
  },
102
- helperTextContainer: {
99
+ inputContainer: {
100
+ flexGrow: 1,
103
101
  flexDirection: 'row',
102
+ alignItems: 'center',
103
+ justifyContent: 'flex-start',
104
+ },
105
+ input: {
106
+ flexGrow: 1,
104
107
  },
105
108
  helperText: {
106
- flex: 1,
109
+ // flex: 1,
107
110
  },
108
- input: {},
109
111
  })
110
112
  export default React.forwardRef(DatePickerInputWithoutModal)
@@ -145,8 +145,8 @@ export function DatePickerModalContent(
145
145
  onSave={onInnerConfirm}
146
146
  onDismiss={onDismiss}
147
147
  saveLabel={props.saveLabel}
148
- saveLabelDisabled={props.saveLabelDisabled ?? false}
149
- uppercase={props.uppercase ?? true}
148
+ saveLabelDisabled={props.saveLabelDisabled || false}
149
+ uppercase={props.uppercase || true}
150
150
  disableSafeTop={disableSafeTop}
151
151
  closeIcon={props.closeIcon}
152
152
  />
@@ -161,7 +161,7 @@ export function DatePickerModalContent(
161
161
  moreLabel={props.moreLabel}
162
162
  startLabel={props.startLabel}
163
163
  endLabel={props.endLabel}
164
- uppercase={props.uppercase ?? true}
164
+ uppercase={props.uppercase || true}
165
165
  locale={locale}
166
166
  editIcon={props.editIcon}
167
167
  calendarIcon={props.calendarIcon}
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react'
2
2
  import { View, StyleSheet } from 'react-native'
3
- import { IconButton, Text } from 'react-native-paper'
3
+ import { IconButton, MD2Theme, Text, useTheme } from 'react-native-paper'
4
4
  import type { ModeType } from './Calendar'
5
5
  import type { LocalState } from './DatePickerModalContent'
6
6
  import { useHeaderTextColor } from '../utils'
@@ -61,15 +61,20 @@ export default function DatePickerModalContentHeader(
61
61
  editIcon = 'pencil',
62
62
  calendarIcon = 'calendar',
63
63
  } = props
64
-
64
+ const theme = useTheme()
65
65
  const label = getLabel(props.locale, props.mode, props.label)
66
66
 
67
67
  const color = useHeaderTextColor()
68
68
  const allowEditing = mode !== 'multiple'
69
+
70
+ let textFont = theme?.isV3
71
+ ? theme.fonts.bodyLarge
72
+ : (theme as any as MD2Theme).fonts.medium
73
+
69
74
  return (
70
75
  <View style={[styles.header]}>
71
76
  <View>
72
- <Text style={[styles.label, { color }]}>
77
+ <Text style={[styles.label, { color, ...textFont }]}>
73
78
  {uppercase ? label.toUpperCase() : label}
74
79
  </Text>
75
80
  <View style={styles.headerContentContainer}>
@@ -97,7 +102,7 @@ export default function DatePickerModalContentHeader(
97
102
  ? getTranslation(props.locale, 'typeInDate')
98
103
  : getTranslation(props.locale, 'pickDateFromCalendar')
99
104
  }
100
- color={color}
105
+ iconColor={color}
101
106
  onPress={onToggle}
102
107
  />
103
108
  ) : null}
@@ -1,9 +1,10 @@
1
1
  import * as React from 'react'
2
- import { Animated, StyleSheet, SafeAreaView } from 'react-native'
2
+ import { Animated, StyleSheet } from 'react-native'
3
3
  import { Appbar, Button } from 'react-native-paper'
4
4
 
5
5
  import { useHeaderTextColor } from '../utils'
6
6
  import { getTranslation } from '../translations/utils'
7
+ import { useSafeAreaInsets } from 'react-native-safe-area-context'
7
8
 
8
9
  export interface DatePickerModalHeaderProps {
9
10
  disableSafeTop?: boolean
@@ -22,37 +23,40 @@ export default function DatePickerModalHeader(
22
23
  const { disableSafeTop, locale, closeIcon = 'close' } = props
23
24
  const saveLabel = props.saveLabel || getTranslation(locale, 'save')
24
25
  const color = useHeaderTextColor()
26
+ const insets = useSafeAreaInsets()
27
+
25
28
  return (
26
- <>
27
- <Animated.View style={styles.animated}>
28
- <SafeAreaView
29
- style={[
30
- styles.safeContent,
31
- disableSafeTop && styles.safeContentNoTop,
32
- ]}
29
+ <Animated.View
30
+ style={[
31
+ styles.animated,
32
+ {
33
+ paddingTop: disableSafeTop ? 0 : insets.top,
34
+ paddingLeft: insets.left,
35
+ paddingRight: insets.right,
36
+ },
37
+ ]}
38
+ >
39
+ <Appbar style={styles.appbarHeader}>
40
+ <Appbar.Action
41
+ icon={closeIcon}
42
+ accessibilityLabel={getTranslation(locale, 'close')}
43
+ onPress={props.onDismiss}
44
+ color={color}
45
+ testID="react-native-paper-dates-close"
46
+ />
47
+ <Appbar.Content title={''} />
48
+ <Button
49
+ color={color}
50
+ textColor={color}
51
+ onPress={props.onSave}
52
+ disabled={props.saveLabelDisabled || false}
53
+ uppercase={props.uppercase || true}
54
+ testID="react-native-paper-dates-save"
33
55
  >
34
- <Appbar style={styles.appbarHeader}>
35
- <Appbar.Action
36
- icon={closeIcon}
37
- accessibilityLabel={getTranslation(locale, 'close')}
38
- onPress={props.onDismiss}
39
- color={color}
40
- testID="react-native-paper-dates-close"
41
- />
42
- <Appbar.Content title={''} />
43
- <Button
44
- color={color}
45
- onPress={props.onSave}
46
- disabled={props.saveLabelDisabled ?? false}
47
- uppercase={props.uppercase ?? true}
48
- testID="react-native-paper-dates-save"
49
- >
50
- {saveLabel}
51
- </Button>
52
- </Appbar>
53
- </SafeAreaView>
54
- </Animated.View>
55
- </>
56
+ {saveLabel}
57
+ </Button>
58
+ </Appbar>
59
+ </Animated.View>
56
60
  )
57
61
  }
58
62
 
@@ -61,15 +65,9 @@ const styles = StyleSheet.create({
61
65
  flex: 1,
62
66
  },
63
67
  animated: {
64
- paddingBottom: 0,
65
68
  elevation: 4,
66
69
  },
67
- safeContent: {
68
- paddingBottom: 0,
69
- },
70
- safeContentNoTop: {
71
- paddingTop: 0,
72
- },
70
+
73
71
  header: {
74
72
  height: 75,
75
73
  alignItems: 'center',
@@ -1,6 +1,7 @@
1
- import { Animated, SafeAreaView, StyleSheet } from 'react-native'
1
+ import { Animated, StyleSheet } from 'react-native'
2
2
  import * as React from 'react'
3
3
  import { useHeaderBackgroundColor } from '../utils'
4
+ import { useSafeAreaInsets } from 'react-native-safe-area-context'
4
5
 
5
6
  export default function DatePickerModalHeaderBackground({
6
7
  children,
@@ -8,27 +9,25 @@ export default function DatePickerModalHeaderBackground({
8
9
  children: any
9
10
  }) {
10
11
  const backgroundColor = useHeaderBackgroundColor()
11
-
12
+ const insets = useSafeAreaInsets()
12
13
  return (
13
14
  <Animated.View
14
15
  style={[
15
16
  styles.animated,
16
17
  {
17
18
  backgroundColor,
19
+ paddingLeft: insets.left,
20
+ paddingRight: insets.right,
18
21
  },
19
22
  ]}
20
23
  >
21
- <SafeAreaView style={styles.safeContent}>{children}</SafeAreaView>
24
+ {children}
22
25
  </Animated.View>
23
26
  )
24
27
  }
25
28
 
26
29
  const styles = StyleSheet.create({
27
30
  animated: {
28
- paddingBottom: 0,
29
31
  elevation: 4,
30
32
  },
31
- safeContent: {
32
- paddingBottom: 0,
33
- },
34
33
  })
package/src/Date/Day.tsx CHANGED
@@ -1,16 +1,18 @@
1
1
  import * as React from 'react'
2
- import { DarkTheme, Text, TouchableRipple } from 'react-native-paper'
2
+ import { MD2Theme, Text, TouchableRipple } from 'react-native-paper'
3
3
  import { StyleSheet, View } from 'react-native'
4
4
  import DayRange from './DayRange'
5
5
  import { daySize } from './dateUtils'
6
6
 
7
+ import type { PaperTheme } from '../utils'
8
+
7
9
  function EmptyDayPure() {
8
10
  return <View style={styles.empty} />
9
11
  }
10
12
  export const EmptyDay = React.memo(EmptyDayPure)
11
13
 
12
14
  function Day(props: {
13
- theme: typeof DarkTheme
15
+ theme: PaperTheme
14
16
  textColorOnPrimary: string
15
17
  day: number
16
18
  month: number
@@ -41,7 +43,6 @@ function Day(props: {
41
43
  textColorOnPrimary,
42
44
  theme,
43
45
  } = props
44
- // console.log(month, { day })
45
46
  const onPress = React.useCallback(() => {
46
47
  onPressDate(new Date(year, month, day))
47
48
  }, [onPressDate, year, month, day])
@@ -55,6 +56,10 @@ function Day(props: {
55
56
  const textColor =
56
57
  selected || (inRange && theme.dark) ? textColorOnPrimary : undefined
57
58
 
59
+ let textFont = theme?.isV3
60
+ ? theme.fonts.bodyMedium
61
+ : (theme as any as MD2Theme).fonts.medium
62
+
58
63
  return (
59
64
  <View style={[styles.root, disabled && styles.disabled]}>
60
65
  <DayRange
@@ -83,7 +88,10 @@ function Day(props: {
83
88
  ]}
84
89
  >
85
90
  <Text
86
- style={textColor ? { color: textColor } : undefined}
91
+ style={[
92
+ textColor ? { color: textColor } : undefined,
93
+ { ...textFont },
94
+ ]}
87
95
  selectable={false}
88
96
  >
89
97
  {day}
@@ -1,15 +1,17 @@
1
1
  import * as React from 'react'
2
2
  import { StyleSheet, View } from 'react-native'
3
- import { Text, useTheme } from 'react-native-paper'
3
+ import { MD2Theme, Text, useTheme } from 'react-native-paper'
4
4
 
5
5
  function DayName({ label }: { label: string }) {
6
6
  const theme = useTheme()
7
+
8
+ let textFont = theme?.isV3
9
+ ? theme.fonts.bodyMedium
10
+ : (theme as any as MD2Theme).fonts.medium
11
+
7
12
  return (
8
13
  <View style={styles.dayName}>
9
- <Text
10
- style={[styles.dayNameLabel, theme.fonts.medium]}
11
- selectable={false}
12
- >
14
+ <Text style={[styles.dayNameLabel, { ...textFont }]} selectable={false}>
13
15
  {label}
14
16
  </Text>
15
17
  </View>
@@ -1,6 +1,12 @@
1
1
  import * as React from 'react'
2
2
  import { StyleSheet, View } from 'react-native'
3
- import { IconButton, Text, useTheme, TouchableRipple } from 'react-native-paper'
3
+ import {
4
+ IconButton,
5
+ Text,
6
+ useTheme,
7
+ TouchableRipple,
8
+ MD2Theme,
9
+ } from 'react-native-paper'
4
10
  import Day, { EmptyDay } from './Day'
5
11
 
6
12
  import {
@@ -244,6 +250,10 @@ function Month(props: MonthSingleProps | MonthRangeProps | MonthMultiProps) {
244
250
  date,
245
251
  ])
246
252
 
253
+ let textFont = theme?.isV3
254
+ ? theme.fonts.bodyMedium
255
+ : (theme as any as MD2Theme).fonts.medium
256
+
247
257
  return (
248
258
  <View style={[styles.month, { height: getMonthHeight(scrollMode, index) }]}>
249
259
  <View
@@ -278,7 +288,7 @@ function Month(props: MonthSingleProps | MonthRangeProps | MonthMultiProps) {
278
288
  ]}
279
289
  >
280
290
  <Text
281
- style={[styles.monthLabel, theme.fonts.medium]}
291
+ style={[styles.monthLabel, { ...textFont }]}
282
292
  selectable={false}
283
293
  >
284
294
  {monthName} {year}