react-native-paper-dates 0.12.0 → 0.15.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.
- package/lib/commonjs/Date/CalendarEdit.js +8 -4
- package/lib/commonjs/Date/CalendarEdit.js.map +1 -1
- package/lib/commonjs/Date/DatePickerInput.js +4 -2
- package/lib/commonjs/Date/DatePickerInput.js.map +1 -1
- package/lib/commonjs/Date/DatePickerInput.shared.js.map +1 -1
- package/lib/commonjs/Date/DatePickerInputWithoutModal.js +14 -1
- package/lib/commonjs/Date/DatePickerInputWithoutModal.js.map +1 -1
- package/lib/commonjs/Date/DatePickerModal.js +2 -0
- package/lib/commonjs/Date/DatePickerModal.js.map +1 -1
- package/lib/commonjs/Date/DatePickerModalContent.js +4 -2
- package/lib/commonjs/Date/DatePickerModalContent.js.map +1 -1
- package/lib/commonjs/Date/DatePickerModalContentHeader.js +5 -4
- package/lib/commonjs/Date/DatePickerModalContentHeader.js.map +1 -1
- package/lib/commonjs/Date/Swiper.js +6 -4
- package/lib/commonjs/Date/Swiper.js.map +1 -1
- package/lib/commonjs/Date/Swiper.native.js +2 -1
- package/lib/commonjs/Date/Swiper.native.js.map +1 -1
- package/lib/commonjs/Date/YearPicker.js +3 -0
- package/lib/commonjs/Date/YearPicker.js.map +1 -1
- package/lib/commonjs/TextInputMask.js +2 -0
- package/lib/commonjs/TextInputMask.js.map +1 -1
- package/lib/commonjs/index.js +9 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/translations/he.js +25 -0
- package/lib/commonjs/translations/he.js.map +1 -0
- package/lib/module/Date/CalendarEdit.js +8 -4
- package/lib/module/Date/CalendarEdit.js.map +1 -1
- package/lib/module/Date/DatePickerInput.js +4 -2
- package/lib/module/Date/DatePickerInput.js.map +1 -1
- package/lib/module/Date/DatePickerInput.shared.js.map +1 -1
- package/lib/module/Date/DatePickerInputWithoutModal.js +14 -1
- package/lib/module/Date/DatePickerInputWithoutModal.js.map +1 -1
- package/lib/module/Date/DatePickerModal.js +2 -0
- package/lib/module/Date/DatePickerModal.js.map +1 -1
- package/lib/module/Date/DatePickerModalContent.js +4 -2
- package/lib/module/Date/DatePickerModalContent.js.map +1 -1
- package/lib/module/Date/DatePickerModalContentHeader.js +5 -4
- package/lib/module/Date/DatePickerModalContentHeader.js.map +1 -1
- package/lib/module/Date/Swiper.js +6 -4
- package/lib/module/Date/Swiper.js.map +1 -1
- package/lib/module/Date/Swiper.native.js +2 -1
- package/lib/module/Date/Swiper.native.js.map +1 -1
- package/lib/module/Date/YearPicker.js +4 -1
- package/lib/module/Date/YearPicker.js.map +1 -1
- package/lib/module/TextInputMask.js +2 -0
- package/lib/module/TextInputMask.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/translations/he.js +18 -0
- package/lib/module/translations/he.js.map +1 -0
- package/lib/typescript/Date/CalendarEdit.d.ts +2 -1
- package/lib/typescript/Date/DatePickerInput.d.ts +1 -1
- package/lib/typescript/Date/DatePickerInput.shared.d.ts +2 -1
- package/lib/typescript/Date/DatePickerInputWithoutModal.d.ts +8 -7
- package/lib/typescript/Date/DatePickerModal.d.ts +1 -0
- package/lib/typescript/Date/DatePickerModalContent.d.ts +1 -0
- package/lib/typescript/Date/DatePickerModalContentHeader.d.ts +1 -0
- package/lib/typescript/TextInputMask.d.ts +5 -6
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/translations/he.d.ts +3 -0
- package/package.json +26 -25
- package/src/Date/CalendarEdit.tsx +5 -0
- package/src/Date/DatePickerInput.shared.tsx +2 -1
- package/src/Date/DatePickerInput.tsx +2 -0
- package/src/Date/DatePickerInputWithoutModal.tsx +14 -0
- package/src/Date/DatePickerModal.tsx +3 -0
- package/src/Date/DatePickerModalContent.tsx +3 -0
- package/src/Date/DatePickerModalContentHeader.tsx +7 -3
- package/src/Date/Swiper.native.tsx +1 -0
- package/src/Date/Swiper.tsx +3 -1
- package/src/Date/YearPicker.tsx +4 -1
- package/src/TextInputMask.tsx +2 -0
- package/src/index.tsx +1 -0
- package/src/translations/he.ts +21 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
declare const _default: React.ForwardRefExoticComponent<
|
|
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
|
|
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
|
-
}
|
|
36
|
-
theme?: import("@callstack/react-theme-provider").$DeepPartial<unknown> | undefined;
|
|
37
|
-
} & {
|
|
36
|
+
}> & {
|
|
38
37
|
mask: string;
|
|
39
38
|
value: string;
|
|
40
|
-
}, "
|
|
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';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-paper-dates",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.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.
|
|
54
|
-
"@react-native-community/eslint-config": "^3.
|
|
55
|
-
"@release-it/conventional-changelog": "^5.1.
|
|
56
|
-
"@testing-library/jest-native": "^5.
|
|
57
|
-
"@testing-library/react-native": "^11.5.
|
|
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.
|
|
60
|
-
"@types/react": "^18.0.
|
|
61
|
-
"@types/react-native": "^0.70.
|
|
62
|
-
"@types/react-native-vector-icons": "^6.4.
|
|
63
|
-
"babel-loader": "^8.
|
|
64
|
-
"commitlint": "^17.
|
|
65
|
-
"eslint": "^8.
|
|
66
|
-
"eslint-config-prettier": "^8.
|
|
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.
|
|
69
|
-
"husky": "^8.0.
|
|
70
|
-
"jest": "^29.
|
|
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.
|
|
72
|
+
"prettier": "^2.8.4",
|
|
73
73
|
"react": "^18.2.0",
|
|
74
|
-
"react-native": "^0.70.
|
|
74
|
+
"react-native": "^0.70.7",
|
|
75
75
|
"react-native-builder-bob": "^0.18.3",
|
|
76
|
-
"react-native-paper": "^5.0
|
|
77
|
-
"react-native-safe-area-context": "^4.
|
|
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.
|
|
80
|
-
"typescript": "^4.9.
|
|
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.
|
|
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 {
|
|
@@ -60,15 +61,18 @@ export default function DatePickerModalContentHeader(
|
|
|
60
61
|
uppercase,
|
|
61
62
|
editIcon,
|
|
62
63
|
calendarIcon,
|
|
64
|
+
allowEditing,
|
|
63
65
|
} = props
|
|
64
66
|
const theme = useTheme()
|
|
65
67
|
const label = getLabel(props.locale, props.mode, props.label)
|
|
66
68
|
|
|
67
69
|
const color = useHeaderTextColor()
|
|
70
|
+
|
|
71
|
+
const isEditingEnabled = allowEditing && mode !== 'multiple'
|
|
72
|
+
|
|
68
73
|
const supportingTextColor = theme.isV3 ? theme.colors.onSurfaceVariant : color
|
|
69
|
-
const allowEditing = mode !== 'multiple'
|
|
70
74
|
|
|
71
|
-
|
|
75
|
+
const textFont = theme?.isV3
|
|
72
76
|
? theme.fonts.labelMedium
|
|
73
77
|
: (theme as any as MD2Theme).fonts.medium
|
|
74
78
|
|
|
@@ -97,7 +101,7 @@ export default function DatePickerModalContentHeader(
|
|
|
97
101
|
</View>
|
|
98
102
|
</View>
|
|
99
103
|
<View style={styles.fill} />
|
|
100
|
-
{
|
|
104
|
+
{isEditingEnabled ? (
|
|
101
105
|
<IconButton
|
|
102
106
|
icon={
|
|
103
107
|
collapsed
|
package/src/Date/Swiper.tsx
CHANGED
|
@@ -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(
|
package/src/Date/YearPicker.tsx
CHANGED
|
@@ -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}
|
package/src/TextInputMask.tsx
CHANGED
|
@@ -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
|