react-native-paper-dates 0.12.0 → 0.14.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 (74) hide show
  1. package/lib/commonjs/Date/CalendarEdit.js +8 -4
  2. package/lib/commonjs/Date/CalendarEdit.js.map +1 -1
  3. package/lib/commonjs/Date/DatePickerInput.js +4 -2
  4. package/lib/commonjs/Date/DatePickerInput.js.map +1 -1
  5. package/lib/commonjs/Date/DatePickerInput.shared.js.map +1 -1
  6. package/lib/commonjs/Date/DatePickerInputWithoutModal.js +14 -1
  7. package/lib/commonjs/Date/DatePickerInputWithoutModal.js.map +1 -1
  8. package/lib/commonjs/Date/DatePickerModal.js +2 -0
  9. package/lib/commonjs/Date/DatePickerModal.js.map +1 -1
  10. package/lib/commonjs/Date/DatePickerModalContent.js +4 -2
  11. package/lib/commonjs/Date/DatePickerModalContent.js.map +1 -1
  12. package/lib/commonjs/Date/DatePickerModalContentHeader.js +6 -4
  13. package/lib/commonjs/Date/DatePickerModalContentHeader.js.map +1 -1
  14. package/lib/commonjs/Date/Swiper.js +6 -4
  15. package/lib/commonjs/Date/Swiper.js.map +1 -1
  16. package/lib/commonjs/Date/Swiper.native.js +2 -1
  17. package/lib/commonjs/Date/Swiper.native.js.map +1 -1
  18. package/lib/commonjs/Date/YearPicker.js +3 -0
  19. package/lib/commonjs/Date/YearPicker.js.map +1 -1
  20. package/lib/commonjs/TextInputMask.js +2 -0
  21. package/lib/commonjs/TextInputMask.js.map +1 -1
  22. package/lib/commonjs/index.js +9 -0
  23. package/lib/commonjs/index.js.map +1 -1
  24. package/lib/commonjs/translations/he.js +25 -0
  25. package/lib/commonjs/translations/he.js.map +1 -0
  26. package/lib/module/Date/CalendarEdit.js +8 -4
  27. package/lib/module/Date/CalendarEdit.js.map +1 -1
  28. package/lib/module/Date/DatePickerInput.js +4 -2
  29. package/lib/module/Date/DatePickerInput.js.map +1 -1
  30. package/lib/module/Date/DatePickerInput.shared.js.map +1 -1
  31. package/lib/module/Date/DatePickerInputWithoutModal.js +14 -1
  32. package/lib/module/Date/DatePickerInputWithoutModal.js.map +1 -1
  33. package/lib/module/Date/DatePickerModal.js +2 -0
  34. package/lib/module/Date/DatePickerModal.js.map +1 -1
  35. package/lib/module/Date/DatePickerModalContent.js +4 -2
  36. package/lib/module/Date/DatePickerModalContent.js.map +1 -1
  37. package/lib/module/Date/DatePickerModalContentHeader.js +6 -4
  38. package/lib/module/Date/DatePickerModalContentHeader.js.map +1 -1
  39. package/lib/module/Date/Swiper.js +6 -4
  40. package/lib/module/Date/Swiper.js.map +1 -1
  41. package/lib/module/Date/Swiper.native.js +2 -1
  42. package/lib/module/Date/Swiper.native.js.map +1 -1
  43. package/lib/module/Date/YearPicker.js +4 -1
  44. package/lib/module/Date/YearPicker.js.map +1 -1
  45. package/lib/module/TextInputMask.js +2 -0
  46. package/lib/module/TextInputMask.js.map +1 -1
  47. package/lib/module/index.js +1 -0
  48. package/lib/module/index.js.map +1 -1
  49. package/lib/module/translations/he.js +18 -0
  50. package/lib/module/translations/he.js.map +1 -0
  51. package/lib/typescript/Date/CalendarEdit.d.ts +2 -1
  52. package/lib/typescript/Date/DatePickerInput.d.ts +1 -1
  53. package/lib/typescript/Date/DatePickerInput.shared.d.ts +2 -1
  54. package/lib/typescript/Date/DatePickerInputWithoutModal.d.ts +8 -7
  55. package/lib/typescript/Date/DatePickerModal.d.ts +1 -0
  56. package/lib/typescript/Date/DatePickerModalContent.d.ts +1 -0
  57. package/lib/typescript/Date/DatePickerModalContentHeader.d.ts +2 -0
  58. package/lib/typescript/TextInputMask.d.ts +5 -6
  59. package/lib/typescript/index.d.ts +1 -0
  60. package/lib/typescript/translations/he.d.ts +3 -0
  61. package/package.json +26 -25
  62. package/src/Date/CalendarEdit.tsx +5 -0
  63. package/src/Date/DatePickerInput.shared.tsx +2 -1
  64. package/src/Date/DatePickerInput.tsx +2 -0
  65. package/src/Date/DatePickerInputWithoutModal.tsx +14 -0
  66. package/src/Date/DatePickerModal.tsx +3 -0
  67. package/src/Date/DatePickerModalContent.tsx +3 -0
  68. package/src/Date/DatePickerModalContentHeader.tsx +9 -3
  69. package/src/Date/Swiper.native.tsx +1 -0
  70. package/src/Date/Swiper.tsx +3 -1
  71. package/src/Date/YearPicker.tsx +4 -1
  72. package/src/TextInputMask.tsx +2 -0
  73. package/src/index.tsx +1 -0
  74. package/src/translations/he.ts +21 -0
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- declare const _default: React.ForwardRefExoticComponent<Pick<Pick<import("react-native").TextInputProps & React.RefAttributes<import("react-native").TextInput> & {
2
+ declare const _default: React.ForwardRefExoticComponent<Omit<import("react-native").TextInputProps & React.RefAttributes<import("react-native").TextInput> & {
3
3
  mode?: "flat" | "outlined" | undefined;
4
4
  left?: React.ReactNode;
5
5
  right?: React.ReactNode;
@@ -22,8 +22,9 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<import("react-
22
22
  render?: ((props: import("react-native-paper/lib/typescript/components/TextInput/types").RenderProps) => React.ReactNode) | undefined;
23
23
  value?: string | undefined;
24
24
  style?: import("react-native").StyleProp<import("react-native").TextStyle>;
25
- theme: import("react-native-paper/lib/typescript/types").InternalTheme;
25
+ theme?: import("react-native-paper/lib/typescript/types").ThemeProp | undefined;
26
26
  testID?: string | undefined;
27
+ contentStyle?: import("react-native").StyleProp<import("react-native").ViewStyle>;
27
28
  outlineStyle?: import("react-native").StyleProp<import("react-native").ViewStyle>;
28
29
  underlineStyle?: import("react-native").StyleProp<import("react-native").ViewStyle>;
29
30
  } & React.RefAttributes<{
@@ -32,10 +33,8 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<import("react-
32
33
  blur: () => void;
33
34
  isFocused: () => boolean;
34
35
  setNativeProps: (nativeProps: object) => void;
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;
37
- } & {
36
+ }> & {
38
37
  mask: string;
39
38
  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>>;
39
+ }, "ref"> & React.RefAttributes<unknown>>;
41
40
  export default _default;
@@ -13,6 +13,7 @@ export { default as en } from './translations/en';
13
13
  export { default as enGB } from './translations/enGB';
14
14
  export { default as es } from './translations/es';
15
15
  export { default as fr } from './translations/fr';
16
+ export { default as he } from './translations/he';
16
17
  export { default as it } from './translations/it';
17
18
  export { default as ko } from './translations/ko';
18
19
  export { default as nl } from './translations/nl';
@@ -0,0 +1,3 @@
1
+ import type { TranslationsType } from './utils';
2
+ declare const he: TranslationsType;
3
+ export default he;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-paper-dates",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "Performant Date Picker for React Native Paper",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -50,37 +50,37 @@
50
50
  "registry": "https://registry.npmjs.org/"
51
51
  },
52
52
  "devDependencies": {
53
- "@commitlint/config-conventional": "^17.0.3",
54
- "@react-native-community/eslint-config": "^3.1.0",
55
- "@release-it/conventional-changelog": "^5.1.0",
56
- "@testing-library/jest-native": "^5.3.3",
57
- "@testing-library/react-native": "^11.5.0",
53
+ "@commitlint/config-conventional": "^17.4.4",
54
+ "@react-native-community/eslint-config": "^3.2.0",
55
+ "@release-it/conventional-changelog": "^5.1.1",
56
+ "@testing-library/jest-native": "^5.4.2",
57
+ "@testing-library/react-native": "^11.5.2",
58
58
  "@types/color": "^3.0.3",
59
- "@types/jest": "^29.2.4",
60
- "@types/react": "^18.0.26",
61
- "@types/react-native": "^0.70.8",
62
- "@types/react-native-vector-icons": "^6.4.12",
63
- "babel-loader": "^8.2.5",
64
- "commitlint": "^17.0.3",
65
- "eslint": "^8.22.0",
66
- "eslint-config-prettier": "^8.5.0",
59
+ "@types/jest": "^29.4.0",
60
+ "@types/react": "^18.0.28",
61
+ "@types/react-native": "^0.70.11",
62
+ "@types/react-native-vector-icons": "^6.4.13",
63
+ "babel-loader": "^8.3.0",
64
+ "commitlint": "^17.4.4",
65
+ "eslint": "^8.35.0",
66
+ "eslint-config-prettier": "^8.6.0",
67
67
  "eslint-plugin-prettier": "^4.2.1",
68
- "expo-cli": "^6.0.8",
69
- "husky": "^8.0.1",
70
- "jest": "^29.0.0",
68
+ "expo-cli": "^6.3.2",
69
+ "husky": "^8.0.3",
70
+ "jest": "^29.4.3",
71
71
  "pod-install": "^0.1.38",
72
- "prettier": "^2.7.1",
72
+ "prettier": "^2.8.4",
73
73
  "react": "^18.2.0",
74
- "react-native": "^0.70.6",
74
+ "react-native": "^0.70.7",
75
75
  "react-native-builder-bob": "^0.18.3",
76
- "react-native-paper": "^5.0.2",
77
- "react-native-safe-area-context": "^4.4.1",
76
+ "react-native-paper": "^5.2.0",
77
+ "react-native-safe-area-context": "^4.5.0",
78
78
  "react-native-vector-icons": "^9.2.0",
79
- "release-it": "^15.4.0",
80
- "typescript": "^4.9.4",
79
+ "release-it": "^15.7.0",
80
+ "typescript": "^4.9.5",
81
81
  "react-test-renderer": "^18.2.0",
82
82
  "@types/react-test-renderer": "^18.0.0",
83
- "caniuse-lite": "^1.0.30001383"
83
+ "caniuse-lite": "^1.0.30001458"
84
84
  },
85
85
  "peerDependencies": {
86
86
  "react": "*",
@@ -141,7 +141,8 @@
141
141
  "lib/",
142
142
  "example/node_modules",
143
143
  "example/web-build",
144
- "docusaurus"
144
+ "docusaurus",
145
+ "coverage"
145
146
  ],
146
147
  "prettier": {
147
148
  "quoteProps": "consistent",
@@ -21,6 +21,7 @@ function CalendarEdit({
21
21
  onChange,
22
22
  validRange,
23
23
  locale,
24
+ inputEnabled,
24
25
  }: {
25
26
  mode: ModeType
26
27
  label?: string
@@ -31,6 +32,7 @@ function CalendarEdit({
31
32
  onChange: (s: LocalState) => any
32
33
  validRange: ValidRangeType | undefined
33
34
  locale: string
35
+ inputEnabled?: boolean
34
36
  }) {
35
37
  const dateInput = React.useRef<TextInputNative | null>(null)
36
38
  const startInput = React.useRef<TextInputNative | null>(null)
@@ -88,6 +90,7 @@ function CalendarEdit({
88
90
  locale={locale}
89
91
  withModal={false}
90
92
  autoComplete={'off'}
93
+ inputEnabled={inputEnabled}
91
94
  />
92
95
  ) : null}
93
96
  {mode === 'range' ? (
@@ -104,6 +107,7 @@ function CalendarEdit({
104
107
  locale={locale}
105
108
  withModal={false}
106
109
  autoComplete={'off'}
110
+ inputEnabled={inputEnabled}
107
111
  />
108
112
  <View style={styles.separator} />
109
113
  <DatePickerInputWithoutModal
@@ -117,6 +121,7 @@ function CalendarEdit({
117
121
  locale={locale}
118
122
  withModal={false}
119
123
  autoComplete="off"
124
+ inputEnabled={inputEnabled}
120
125
  />
121
126
  </View>
122
127
  ) : null}
@@ -20,7 +20,8 @@ export type DatePickerInputProps = {
20
20
  startYear?: number
21
21
  endYear?: number
22
22
  onChangeText?: (text: string | undefined) => void
23
+ inputEnabled?: boolean
23
24
  } & Omit<
24
25
  React.ComponentProps<typeof TextInput>,
25
- 'value' | 'onChange' | 'onChangeText'
26
+ 'value' | 'onChange' | 'onChangeText' | 'inputMode'
26
27
  >
@@ -54,6 +54,7 @@ function DatePickerInput(
54
54
  uppercase,
55
55
  startYear,
56
56
  endYear,
57
+ inputEnabled,
57
58
  }) =>
58
59
  withModal ? (
59
60
  <DatePickerModal
@@ -70,6 +71,7 @@ function DatePickerInput(
70
71
  uppercase={uppercase ?? true}
71
72
  startYear={startYear ?? 1800}
72
73
  endYear={endYear ?? 2200}
74
+ inputEnabled={inputEnabled}
73
75
  />
74
76
  ) : null
75
77
  }
@@ -27,6 +27,7 @@ function DatePickerInputWithoutModal(
27
27
  startYear,
28
28
  endYear,
29
29
  onChangeText,
30
+ inputEnabled,
30
31
  ...rest
31
32
  }: DatePickerInputProps & {
32
33
  modal?: (params: {
@@ -39,6 +40,7 @@ function DatePickerInputWithoutModal(
39
40
  uppercase: DatePickerInputProps['uppercase']
40
41
  startYear: DatePickerInputProps['startYear']
41
42
  endYear: DatePickerInputProps['endYear']
43
+ inputEnabled: DatePickerInputProps['inputEnabled']
42
44
  }) => any
43
45
  inputButtons?: any
44
46
  },
@@ -59,6 +61,16 @@ function DatePickerInputWithoutModal(
59
61
  onValidationError,
60
62
  })
61
63
 
64
+ let disabled
65
+
66
+ if (inputEnabled !== undefined) {
67
+ disabled = !inputEnabled
68
+ }
69
+
70
+ if (rest.disabled) {
71
+ disabled = rest.disabled
72
+ }
73
+
62
74
  return (
63
75
  <>
64
76
  <View style={styles.root}>
@@ -75,6 +87,7 @@ function DatePickerInputWithoutModal(
75
87
  value={formattedValue}
76
88
  keyboardType={rest.keyboardType ?? 'number-pad'}
77
89
  mask={inputFormat}
90
+ disabled={disabled}
78
91
  onChangeText={onDateInputChangeText}
79
92
  onChange={(e) => onChangeText && onChangeText(e.nativeEvent.text)}
80
93
  keyboardAppearance={theme.dark ? 'dark' : 'default'}
@@ -99,6 +112,7 @@ function DatePickerInputWithoutModal(
99
112
  uppercase,
100
113
  startYear,
101
114
  endYear,
115
+ inputEnabled,
102
116
  })}
103
117
  </>
104
118
  )
@@ -22,6 +22,7 @@ interface DatePickerModalProps {
22
22
  animationType?: 'slide' | 'fade' | 'none'
23
23
  disableStatusBar?: boolean
24
24
  disableStatusBarPadding?: boolean
25
+ inputEnabled?: boolean
25
26
  }
26
27
 
27
28
  export interface DatePickerModalSingleProps
@@ -49,6 +50,7 @@ export function DatePickerModal(
49
50
  animationType,
50
51
  disableStatusBar,
51
52
  disableStatusBarPadding,
53
+ inputEnabled,
52
54
  ...rest
53
55
  } = props
54
56
  const animationTypeCalculated =
@@ -112,6 +114,7 @@ export function DatePickerModal(
112
114
  )}
113
115
  <DatePickerModalContent
114
116
  {...rest}
117
+ inputEnabled={inputEnabled}
115
118
  disableSafeTop={disableStatusBar}
116
119
  />
117
120
  </View>
@@ -32,6 +32,7 @@ interface DatePickerModalContentBaseProps {
32
32
  disableSafeTop?: boolean
33
33
  saveLabelDisabled?: boolean
34
34
  uppercase?: boolean
35
+ inputEnabled?: boolean
35
36
  }
36
37
 
37
38
  export interface DatePickerModalContentRangeProps
@@ -164,6 +165,7 @@ export function DatePickerModalContent(
164
165
  locale={locale}
165
166
  editIcon={props?.editIcon}
166
167
  calendarIcon={props.calendarIcon}
168
+ allowEditing={props.allowEditing || true}
167
169
  />
168
170
  </DatePickerModalHeaderBackground>
169
171
  <AnimatedCrossView
@@ -195,6 +197,7 @@ export function DatePickerModalContent(
195
197
  onChange={onInnerChange}
196
198
  validRange={validRange}
197
199
  locale={locale}
200
+ inputEnabled={props.inputEnabled}
198
201
  />
199
202
  }
200
203
  />
@@ -19,6 +19,7 @@ export interface HeaderPickProps {
19
19
  editIcon?: string
20
20
  calendarIcon?: string
21
21
  closeIcon?: string
22
+ allowEditing?: boolean
22
23
  }
23
24
 
24
25
  export interface HeaderContentProps extends HeaderPickProps {
@@ -27,6 +28,7 @@ export interface HeaderContentProps extends HeaderPickProps {
27
28
  collapsed: boolean
28
29
  onToggle: () => any
29
30
  locale: string | undefined
31
+ inputDate?: boolean
30
32
  }
31
33
 
32
34
  function getLabel(
@@ -60,15 +62,19 @@ export default function DatePickerModalContentHeader(
60
62
  uppercase,
61
63
  editIcon,
62
64
  calendarIcon,
65
+ inputDate,
66
+ allowEditing,
63
67
  } = props
64
68
  const theme = useTheme()
65
69
  const label = getLabel(props.locale, props.mode, props.label)
66
70
 
67
71
  const color = useHeaderTextColor()
72
+
73
+ const isAllowEditing = allowEditing && mode !== 'multiple' && inputDate !== undefined
74
+
68
75
  const supportingTextColor = theme.isV3 ? theme.colors.onSurfaceVariant : color
69
- const allowEditing = mode !== 'multiple'
70
76
 
71
- let textFont = theme?.isV3
77
+ const textFont = theme?.isV3
72
78
  ? theme.fonts.labelMedium
73
79
  : (theme as any as MD2Theme).fonts.medium
74
80
 
@@ -97,7 +103,7 @@ export default function DatePickerModalContentHeader(
97
103
  </View>
98
104
  </View>
99
105
  <View style={styles.fill} />
100
- {allowEditing ? (
106
+ {isAllowEditing ? (
101
107
  <IconButton
102
108
  icon={
103
109
  collapsed
@@ -175,6 +175,7 @@ function SwiperInner({
175
175
  ? new Array(visibleIndexes.length).fill(undefined).map((_, vi) => (
176
176
  <View
177
177
  key={vi}
178
+ // eslint-disable-next-line react-native/no-inline-styles
178
179
  style={{
179
180
  top: isHorizontal
180
181
  ? 0
@@ -94,7 +94,6 @@ function VerticalScroller({
94
94
  const [visibleIndexes, setVisibleIndexes] = React.useState<number[]>(
95
95
  visibleArray(initialIndex)
96
96
  )
97
- // eslint-disable-next-line no-undef
98
97
  const parentRef = React.useRef<HTMLDivElement | null>(null)
99
98
 
100
99
  useIsomorphicLayoutEffect(() => {
@@ -132,6 +131,7 @@ function VerticalScroller({
132
131
  return (
133
132
  <div
134
133
  ref={parentRef}
134
+ // eslint-disable-next-line react-native/no-inline-styles
135
135
  style={{
136
136
  height,
137
137
  width,
@@ -140,6 +140,7 @@ function VerticalScroller({
140
140
  onScroll={onScroll}
141
141
  >
142
142
  <div
143
+ // eslint-disable-next-line react-native/no-inline-styles
143
144
  style={{
144
145
  height: estimatedHeight * totalMonths,
145
146
  position: 'relative',
@@ -148,6 +149,7 @@ function VerticalScroller({
148
149
  {[0, 1, 2, 3, 4].map((vi) => (
149
150
  <div
150
151
  key={vi}
152
+ // eslint-disable-next-line react-native/no-inline-styles
151
153
  style={{
152
154
  willChange: 'transform',
153
155
  transform: `translateY(${getVerticalMonthsOffset(
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react'
2
- import { FlatList, StyleSheet, View } from 'react-native'
2
+ import { FlatList, StyleSheet, View, ScrollView } from 'react-native'
3
3
  import { MD2Theme, Text, TouchableRipple, useTheme } from 'react-native-paper'
4
4
  import { range } from '../utils'
5
5
 
@@ -50,6 +50,9 @@ export default function YearPicker({
50
50
  ref={flatList}
51
51
  style={styles.list}
52
52
  data={years}
53
+ renderScrollComponent={(sProps) => {
54
+ return <ScrollView {...sProps} />
55
+ }}
53
56
  renderItem={({ item }) => (
54
57
  <Year
55
58
  year={item}
@@ -72,6 +72,7 @@ function TextInputWithMask(
72
72
  onChange,
73
73
  value,
74
74
  mask,
75
+ disabled,
75
76
  ...rest
76
77
  }: React.ComponentProps<typeof TextInput> & { mask: string; value: string },
77
78
  ref: any
@@ -100,6 +101,7 @@ function TextInputWithMask(
100
101
  <TextInput
101
102
  ref={ref}
102
103
  {...rest}
104
+ disabled={disabled}
103
105
  value={controlledValue}
104
106
  onChangeText={onInnerChange}
105
107
  onChange={(e) => {
package/src/index.tsx CHANGED
@@ -14,6 +14,7 @@ export { default as en } from './translations/en'
14
14
  export { default as enGB } from './translations/enGB'
15
15
  export { default as es } from './translations/es'
16
16
  export { default as fr } from './translations/fr'
17
+ export { default as he } from './translations/he'
17
18
  export { default as it } from './translations/it'
18
19
  export { default as ko } from './translations/ko'
19
20
  export { default as nl } from './translations/nl'
@@ -0,0 +1,21 @@
1
+ import type { TranslationsType } from './utils'
2
+
3
+ const he: TranslationsType = {
4
+ save: 'שמור',
5
+ selectSingle: 'בחר תאריך',
6
+ selectMultiple: 'בחר תאריכים',
7
+ selectRange: 'בחר טווח',
8
+ notAccordingToDateFormat: (inputFormat) =>
9
+ `פורמט של תאריך צריך להיות ${inputFormat}`,
10
+ mustBeHigherThan: (date) => `חייב להיות אחרי ${date}`,
11
+ mustBeLowerThan: (date) => `חייב להיות לפני ${date}`,
12
+ mustBeBetween: (startDate, endDate) =>
13
+ `חייב להיות בין ${startDate} - ${endDate}`,
14
+ dateIsDisabled: 'יום לא מורשה',
15
+ previous: 'הקודם',
16
+ next: 'הבא',
17
+ typeInDate: 'הקש תאריך',
18
+ pickDateFromCalendar: 'בחר תאריך מהלוח שנה',
19
+ close: 'סגור',
20
+ }
21
+ export default he