@hero-design/rn 8.103.3 → 8.103.5
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/.turbo/turbo-build.log +3 -3
- package/CHANGELOG.md +17 -0
- package/es/index.js +45 -23
- package/lib/index.js +45 -23
- package/package.json +3 -3
- package/src/components/DatePicker/DatePicker.tsx +38 -0
- package/src/components/DatePicker/DatePickerAndroid.tsx +6 -3
- package/src/components/DatePicker/DatePickerCalendar.tsx +6 -3
- package/src/components/DatePicker/DatePickerIOS.tsx +6 -3
- package/src/components/DatePicker/Dialog/IOSDialog.tsx +6 -1
- package/src/components/DatePicker/Dialog.tsx +15 -0
- package/src/components/DatePicker/index.internal.tsx +10 -0
- package/src/components/DatePicker/index.tsx +6 -29
- package/src/components/DatePicker/types.ts +6 -0
- package/src/components/PinInput/__tests__/__snapshots__/index.spec.tsx.snap +5 -5
- package/src/components/PinInput/index.tsx +1 -1
- package/src/components/TextInput/index.tsx +29 -4
- package/src/components/TimePicker/TimePicker.tsx +15 -0
- package/src/components/TimePicker/TimePickerAndroid.tsx +6 -3
- package/src/components/TimePicker/TimePickerIOS.tsx +6 -3
- package/src/components/TimePicker/index.internal.tsx +9 -0
- package/src/components/TimePicker/index.tsx +4 -13
- package/src/components/TimePicker/types.ts +6 -0
- package/src/index.internal.ts +9 -2
- package/src/types.internal.ts +8 -1
- package/src/types.ts +4 -0
- package/stats/8.103.3/rn-stats.html +0 -2
- package/stats/8.103.4/rn-stats.html +4842 -0
- package/stats/8.103.5/rn-stats.html +4844 -0
- package/types/components/Calendar/CalendarRowItem.d.ts +1 -1
- package/types/components/DatePicker/DatePicker.d.ts +4 -0
- package/types/components/DatePicker/DatePickerAndroid.d.ts +3 -3
- package/types/components/DatePicker/DatePickerCalendar.d.ts +2 -2
- package/types/components/DatePicker/DatePickerIOS.d.ts +3 -3
- package/types/components/DatePicker/Dialog.d.ts +4 -0
- package/types/components/DatePicker/index.d.ts +4 -5
- package/types/components/DatePicker/index.internal.d.ts +7 -0
- package/types/components/DatePicker/types.d.ts +4 -0
- package/types/components/TextInput/index.d.ts +14 -3
- package/types/components/TimePicker/TimePicker.d.ts +4 -0
- package/types/components/TimePicker/TimePickerAndroid.d.ts +2 -2
- package/types/components/TimePicker/TimePickerIOS.d.ts +2 -2
- package/types/components/TimePicker/index.d.ts +3 -3
- package/types/components/TimePicker/index.internal.d.ts +5 -0
- package/types/components/TimePicker/types.d.ts +4 -0
- package/types/index.internal.d.ts +4 -2
- package/types/types.d.ts +3 -1
- package/types/types.internal.d.ts +3 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(node:
|
|
1
|
+
(node:3289) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
|
|
2
2
|
(Use `node --trace-warnings ...` to show where the warning was created)
|
|
3
3
|
[36m
|
|
4
4
|
[1msrc/index.ts[22m → [1mlib/index.js, es/index.js[22m...[39m
|
|
@@ -15,9 +15,9 @@ node_modules/d3-selection/src/selection/index.js -> node_modules/d3-selection/sr
|
|
|
15
15
|
[7m [0m [91m ~~~~~~~~~~~~~~~~~~~[0m
|
|
16
16
|
[39m
|
|
17
17
|
[1m[33m(!) [plugin node-resolve] preferring built-in module 'events' over local alternative at '/home/runner/work/hero-design/hero-design/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning.or passing a function to 'preferBuiltins' to provide more fine-grained control over which built-in modules to prefer.[39m[22m
|
|
18
|
-
[32mcreated [1mlib/index.js, es/index.js[22m in [1m1m
|
|
18
|
+
[32mcreated [1mlib/index.js, es/index.js[22m in [1m1m 15.3s[22m[39m
|
|
19
19
|
[36m
|
|
20
20
|
[1m/home/runner/work/hero-design/hero-design/packages/rn/src/locales/en_AU.ts, /home/runner/work/hero-design/hero-design/packages/rn/src/locales/en_CA.ts, /home/runner/work/hero-design/hero-design/packages/rn/src/locales/index.ts, /home/runner/work/hero-design/hero-design/packages/rn/src/locales/types.ts[22m → [1m., .[22m...[39m
|
|
21
21
|
[1m[33m(!) Generated empty chunks[39m[22m
|
|
22
22
|
"locales/types" and "locales/types"
|
|
23
|
-
[32mcreated [1m., .[22m in [
|
|
23
|
+
[32mcreated [1m., .[22m in [1m20.9s[22m[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @hero-design/rn
|
|
2
2
|
|
|
3
|
+
## 8.103.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#4068](https://github.com/Thinkei/hero-design/pull/4068) [`3fd150ed0925245f0c9df0956681f19becac09c7`](https://github.com/Thinkei/hero-design/commit/3fd150ed0925245f0c9df0956681f19becac09c7) Thanks [@ttkien](https://github.com/ttkien)! - [RichTextEditor] apply new TextInput
|
|
8
|
+
[TextInput] update typings
|
|
9
|
+
|
|
10
|
+
- [#4074](https://github.com/Thinkei/hero-design/pull/4074) [`3b1be909daf4d17abe49f37672ecde1ad048ae05`](https://github.com/Thinkei/hero-design/commit/3b1be909daf4d17abe49f37672ecde1ad048ae05) Thanks [@cuongnguyeneh](https://github.com/cuongnguyeneh)! - [PinInput] fix: android lagging issue by replacing keyboardType by inputMode prop
|
|
11
|
+
|
|
12
|
+
## 8.103.4
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#4069](https://github.com/Thinkei/hero-design/pull/4069) [`2e911c0297496b281a54bad63c5e60ee75bc8d81`](https://github.com/Thinkei/hero-design/commit/2e911c0297496b281a54bad63c5e60ee75bc8d81) Thanks [@ttkien](https://github.com/ttkien)! - [DatePicker] Fix issue month-year picker is gone in react-native 76
|
|
17
|
+
|
|
18
|
+
- [#4062](https://github.com/Thinkei/hero-design/pull/4062) [`805b3e4f0222ed1e62c0feb2d3de4c42afe2012b`](https://github.com/Thinkei/hero-design/commit/805b3e4f0222ed1e62c0feb2d3de4c42afe2012b) Thanks [@ttkien](https://github.com/ttkien)! - [TimePicker][datepicker] apply new TextInput
|
|
19
|
+
|
|
3
20
|
## 8.103.3
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/es/index.js
CHANGED
|
@@ -19987,7 +19987,7 @@ var renderInput$1 = function renderInput(_ref3) {
|
|
|
19987
19987
|
renderInputValue = _ref3.renderInputValue,
|
|
19988
19988
|
ref = _ref3.ref,
|
|
19989
19989
|
theme = _ref3.theme;
|
|
19990
|
-
return renderInputValue ? renderInputValue(nativeInputProps) : /*#__PURE__*/React__default.createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
|
|
19990
|
+
return renderInputValue ? renderInputValue(nativeInputProps, ref) : /*#__PURE__*/React__default.createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
|
|
19991
19991
|
themeVariant: variant,
|
|
19992
19992
|
multiline: variant === 'textarea' || nativeInputProps.multiline,
|
|
19993
19993
|
ref: ref,
|
|
@@ -20429,7 +20429,8 @@ var DatePickerAndroid = function DatePickerAndroid(_ref) {
|
|
|
20429
20429
|
_ref$variant = _ref.variant,
|
|
20430
20430
|
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
20431
20431
|
renderSelectedValue = _ref.renderSelectedValue,
|
|
20432
|
-
locale = _ref.locale
|
|
20432
|
+
locale = _ref.locale,
|
|
20433
|
+
TextInputComponent = _ref.TextInputComponent;
|
|
20433
20434
|
var _useState = useState(false),
|
|
20434
20435
|
_useState2 = _slicedToArray(_useState, 2),
|
|
20435
20436
|
open = _useState2[0],
|
|
@@ -20447,6 +20448,7 @@ var DatePickerAndroid = function DatePickerAndroid(_ref) {
|
|
|
20447
20448
|
onChange: onChange,
|
|
20448
20449
|
value: value
|
|
20449
20450
|
});
|
|
20451
|
+
var InputComponent = TextInputComponent || TextInput;
|
|
20450
20452
|
return /*#__PURE__*/React__default.createElement(TouchableOpacity, {
|
|
20451
20453
|
onPress: function onPress() {
|
|
20452
20454
|
return setOpen(true);
|
|
@@ -20455,7 +20457,7 @@ var DatePickerAndroid = function DatePickerAndroid(_ref) {
|
|
|
20455
20457
|
}, /*#__PURE__*/React__default.createElement(View, {
|
|
20456
20458
|
pointerEvents: "none",
|
|
20457
20459
|
testID: "datePickerInputAndroid"
|
|
20458
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
20460
|
+
}, /*#__PURE__*/React__default.createElement(InputComponent, {
|
|
20459
20461
|
label: label,
|
|
20460
20462
|
value: displayValue,
|
|
20461
20463
|
suffix: "calendar-dates-outlined",
|
|
@@ -20550,7 +20552,8 @@ var DatePickerCalendar = function DatePickerCalendar(_ref2) {
|
|
|
20550
20552
|
_ref2$supportedOrient = _ref2.supportedOrientations,
|
|
20551
20553
|
supportedOrientations = _ref2$supportedOrient === void 0 ? ['portrait'] : _ref2$supportedOrient,
|
|
20552
20554
|
renderSelectedValue = _ref2.renderSelectedValue,
|
|
20553
|
-
locale = _ref2.locale
|
|
20555
|
+
locale = _ref2.locale,
|
|
20556
|
+
TextInputComponent = _ref2.TextInputComponent;
|
|
20554
20557
|
var _useState5 = useState(false),
|
|
20555
20558
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
20556
20559
|
open = _useState6[0],
|
|
@@ -20576,6 +20579,7 @@ var DatePickerCalendar = function DatePickerCalendar(_ref2) {
|
|
|
20576
20579
|
onChange: onChange,
|
|
20577
20580
|
value: value
|
|
20578
20581
|
});
|
|
20582
|
+
var InputComponent = TextInputComponent || TextInput;
|
|
20579
20583
|
return /*#__PURE__*/React__default.createElement(TouchableOpacity, {
|
|
20580
20584
|
onPress: function onPress() {
|
|
20581
20585
|
return setOpen(true);
|
|
@@ -20584,7 +20588,7 @@ var DatePickerCalendar = function DatePickerCalendar(_ref2) {
|
|
|
20584
20588
|
}, /*#__PURE__*/React__default.createElement(View, {
|
|
20585
20589
|
pointerEvents: "none",
|
|
20586
20590
|
testID: "datePickerCalendar"
|
|
20587
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
20591
|
+
}, /*#__PURE__*/React__default.createElement(InputComponent, {
|
|
20588
20592
|
label: label,
|
|
20589
20593
|
value: displayValue,
|
|
20590
20594
|
suffix: "calendar-dates-outlined",
|
|
@@ -20681,13 +20685,14 @@ var IOSDatePickerDialog = function IOSDatePickerDialog(_ref) {
|
|
|
20681
20685
|
minimumDate: minDate,
|
|
20682
20686
|
textColor: theme.colors.onDefaultGlobalSurface,
|
|
20683
20687
|
maximumDate: maxDate,
|
|
20688
|
+
style: {
|
|
20689
|
+
height: '100%',
|
|
20690
|
+
width: '100%'
|
|
20691
|
+
},
|
|
20684
20692
|
onChange: function onChange(date) {
|
|
20685
20693
|
if (date) {
|
|
20686
20694
|
setSelectingDate(date);
|
|
20687
20695
|
}
|
|
20688
|
-
},
|
|
20689
|
-
style: {
|
|
20690
|
-
flex: 1
|
|
20691
20696
|
}
|
|
20692
20697
|
}) : null, variant === 'default' ? /*#__PURE__*/React__default.createElement(DateTimePicker, {
|
|
20693
20698
|
locale: locale,
|
|
@@ -20730,7 +20735,8 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
|
|
|
20730
20735
|
_ref$variant = _ref.variant,
|
|
20731
20736
|
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
20732
20737
|
locale = _ref.locale,
|
|
20733
|
-
renderSelectedValue = _ref.renderSelectedValue
|
|
20738
|
+
renderSelectedValue = _ref.renderSelectedValue,
|
|
20739
|
+
TextInputComponent = _ref.TextInputComponent;
|
|
20734
20740
|
var _useState = useState(false),
|
|
20735
20741
|
_useState2 = _slicedToArray(_useState, 2),
|
|
20736
20742
|
open = _useState2[0],
|
|
@@ -20750,6 +20756,7 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
|
|
|
20750
20756
|
onChange: onChange,
|
|
20751
20757
|
value: value
|
|
20752
20758
|
});
|
|
20759
|
+
var InputComponent = TextInputComponent || TextInput;
|
|
20753
20760
|
return /*#__PURE__*/React__default.createElement(TouchableOpacity, {
|
|
20754
20761
|
onPress: function onPress() {
|
|
20755
20762
|
return setOpen(true);
|
|
@@ -20758,7 +20765,7 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
|
|
|
20758
20765
|
}, /*#__PURE__*/React__default.createElement(View, {
|
|
20759
20766
|
pointerEvents: "none",
|
|
20760
20767
|
testID: "datePickerInputIOS"
|
|
20761
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
20768
|
+
}, /*#__PURE__*/React__default.createElement(InputComponent, {
|
|
20762
20769
|
label: label,
|
|
20763
20770
|
value: displayValue,
|
|
20764
20771
|
suffix: "calendar-dates-outlined",
|
|
@@ -20792,31 +20799,40 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
|
|
|
20792
20799
|
}));
|
|
20793
20800
|
};
|
|
20794
20801
|
|
|
20795
|
-
var _excluded$s = ["variant"];
|
|
20802
|
+
var _excluded$s = ["variant", "TextInputComponent"];
|
|
20796
20803
|
var DatePicker = function DatePicker(_ref) {
|
|
20797
20804
|
var _ref$variant = _ref.variant,
|
|
20798
20805
|
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
20806
|
+
_ref$TextInputCompone = _ref.TextInputComponent,
|
|
20807
|
+
TextInputComponent = _ref$TextInputCompone === void 0 ? TextInput : _ref$TextInputCompone,
|
|
20799
20808
|
props = _objectWithoutProperties(_ref, _excluded$s);
|
|
20800
20809
|
if (variant === 'calendar') {
|
|
20801
|
-
return /*#__PURE__*/React__default.createElement(DatePickerCalendar, props
|
|
20810
|
+
return /*#__PURE__*/React__default.createElement(DatePickerCalendar, _extends$1({}, props, {
|
|
20811
|
+
TextInputComponent: TextInputComponent
|
|
20812
|
+
}));
|
|
20802
20813
|
}
|
|
20803
20814
|
if (Platform.OS === 'ios') {
|
|
20804
20815
|
return /*#__PURE__*/React__default.createElement(DatePickerIOS, _extends$1({}, props, {
|
|
20805
|
-
variant: variant
|
|
20816
|
+
variant: variant,
|
|
20817
|
+
TextInputComponent: TextInputComponent
|
|
20806
20818
|
}));
|
|
20807
20819
|
}
|
|
20808
20820
|
return /*#__PURE__*/React__default.createElement(DatePickerAndroid, _extends$1({}, props, {
|
|
20809
|
-
variant: variant
|
|
20821
|
+
variant: variant,
|
|
20822
|
+
TextInputComponent: TextInputComponent
|
|
20810
20823
|
}));
|
|
20811
20824
|
};
|
|
20812
|
-
|
|
20813
|
-
|
|
20825
|
+
|
|
20826
|
+
var Dialog = function Dialog(_ref) {
|
|
20827
|
+
var props = _extends$1({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
20814
20828
|
if (Platform.OS === 'ios') {
|
|
20815
20829
|
return /*#__PURE__*/React__default.createElement(IOSDatePickerDialog, props);
|
|
20816
20830
|
}
|
|
20817
20831
|
return /*#__PURE__*/React__default.createElement(AndroidDatePickerDialog, props);
|
|
20818
20832
|
};
|
|
20819
|
-
|
|
20833
|
+
|
|
20834
|
+
var PublicDatePicker = DatePicker;
|
|
20835
|
+
var index$8 = Object.assign(PublicDatePicker, {
|
|
20820
20836
|
Dialog: Dialog
|
|
20821
20837
|
});
|
|
20822
20838
|
|
|
@@ -23958,7 +23974,7 @@ var PinInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
23958
23974
|
onFocus: focus,
|
|
23959
23975
|
onBlur: blur,
|
|
23960
23976
|
pointerEvents: "none",
|
|
23961
|
-
|
|
23977
|
+
inputMode: "numeric",
|
|
23962
23978
|
testID: "pin-hidden-input",
|
|
23963
23979
|
textContentType: textContentType,
|
|
23964
23980
|
autoComplete: autoComplete,
|
|
@@ -26661,7 +26677,8 @@ var TimePickerAndroid = function TimePickerAndroid(_ref) {
|
|
|
26661
26677
|
style = _ref.style,
|
|
26662
26678
|
testID = _ref.testID,
|
|
26663
26679
|
_ref$showSuffix = _ref.showSuffix,
|
|
26664
|
-
showSuffix = _ref$showSuffix === void 0 ? true : _ref$showSuffix
|
|
26680
|
+
showSuffix = _ref$showSuffix === void 0 ? true : _ref$showSuffix,
|
|
26681
|
+
TextInputComponent = _ref.TextInputComponent;
|
|
26665
26682
|
var _useState = useState(false),
|
|
26666
26683
|
_useState2 = _slicedToArray(_useState, 2),
|
|
26667
26684
|
open = _useState2[0],
|
|
@@ -26669,6 +26686,7 @@ var TimePickerAndroid = function TimePickerAndroid(_ref) {
|
|
|
26669
26686
|
var is12Hour = displayFormat.includes('hh');
|
|
26670
26687
|
var displayValue = value ? formatTime(displayFormat, value) : '';
|
|
26671
26688
|
var pickerInitValue = value || new Date();
|
|
26689
|
+
var InputComponent = TextInputComponent || TextInput;
|
|
26672
26690
|
return /*#__PURE__*/React__default.createElement(TouchableOpacity, {
|
|
26673
26691
|
onPress: function onPress() {
|
|
26674
26692
|
return setOpen(true);
|
|
@@ -26677,7 +26695,7 @@ var TimePickerAndroid = function TimePickerAndroid(_ref) {
|
|
|
26677
26695
|
}, /*#__PURE__*/React__default.createElement(View, {
|
|
26678
26696
|
pointerEvents: "none",
|
|
26679
26697
|
testID: "timePickerInputAndroid"
|
|
26680
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
26698
|
+
}, /*#__PURE__*/React__default.createElement(InputComponent, {
|
|
26681
26699
|
label: label,
|
|
26682
26700
|
value: displayValue,
|
|
26683
26701
|
suffix: showSuffix ? 'clock-3' : undefined,
|
|
@@ -26729,7 +26747,8 @@ var TimePickerIOS = function TimePickerIOS(_ref) {
|
|
|
26729
26747
|
_ref$showSuffix = _ref.showSuffix,
|
|
26730
26748
|
showSuffix = _ref$showSuffix === void 0 ? true : _ref$showSuffix,
|
|
26731
26749
|
_ref$supportedOrienta = _ref.supportedOrientations,
|
|
26732
|
-
supportedOrientations = _ref$supportedOrienta === void 0 ? ['portrait'] : _ref$supportedOrienta
|
|
26750
|
+
supportedOrientations = _ref$supportedOrienta === void 0 ? ['portrait'] : _ref$supportedOrienta,
|
|
26751
|
+
TextInputComponent = _ref.TextInputComponent;
|
|
26733
26752
|
var _useState = useState(value || new Date()),
|
|
26734
26753
|
_useState2 = _slicedToArray(_useState, 2),
|
|
26735
26754
|
selectingDate = _useState2[0],
|
|
@@ -26741,6 +26760,7 @@ var TimePickerIOS = function TimePickerIOS(_ref) {
|
|
|
26741
26760
|
var is12Hour = displayFormat.includes('hh');
|
|
26742
26761
|
var displayValue = value ? formatTime(displayFormat, value) : '';
|
|
26743
26762
|
var theme = useTheme();
|
|
26763
|
+
var InputComponent = TextInputComponent || TextInput;
|
|
26744
26764
|
useEffect(function () {
|
|
26745
26765
|
setSelectingDate(value || new Date());
|
|
26746
26766
|
}, [value]);
|
|
@@ -26752,7 +26772,7 @@ var TimePickerIOS = function TimePickerIOS(_ref) {
|
|
|
26752
26772
|
}, /*#__PURE__*/React__default.createElement(View, {
|
|
26753
26773
|
pointerEvents: "none",
|
|
26754
26774
|
testID: "timePickerInputIOS"
|
|
26755
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
26775
|
+
}, /*#__PURE__*/React__default.createElement(InputComponent, {
|
|
26756
26776
|
label: label,
|
|
26757
26777
|
value: displayValue,
|
|
26758
26778
|
suffix: showSuffix ? 'clock-3' : undefined,
|
|
@@ -26808,6 +26828,8 @@ var TimePicker = function TimePicker(props) {
|
|
|
26808
26828
|
return /*#__PURE__*/React__default.createElement(TimePickerAndroid, props);
|
|
26809
26829
|
};
|
|
26810
26830
|
|
|
26831
|
+
var PublicTimePicker = TimePicker;
|
|
26832
|
+
|
|
26811
26833
|
var ToolbarWrapper = index$b(View)(function (_ref) {
|
|
26812
26834
|
var theme = _ref.theme;
|
|
26813
26835
|
return {
|
|
@@ -46771,4 +46793,4 @@ var FloatingIsland = function FloatingIsland(_ref2) {
|
|
|
46771
46793
|
}));
|
|
46772
46794
|
};
|
|
46773
46795
|
|
|
46774
|
-
export { Accordion, Alert, AppCue, Attachment, index$a as Avatar, Badge$1 as Badge, BottomNavigation, BottomSheet$1 as BottomSheet, Box, CompoundButton as Button, Calendar$1 as Calendar, Card$1 as Card, index$9 as Carousel, Chart, Checkbox, Chip, Collapse, ContentNavigator, index$8 as DatePicker, Divider, index$7 as Drawer, Empty, ErrorComponent as Error, FAB, FlatListWithFAB, FloatingIsland, HeroDesignProvider, Icon, Image, List$1 as List, LocaleProvider, index$6 as MapPin, PageControl, PinInput, Portal$1 as Portal, Progress, CompoundRadio as Radio, Rate, RefreshControl, index as RichTextEditor, ScrollViewWithFAB, Search, SectionHeading, SectionListWithFAB, index$4 as Select, Skeleton, Slider, Spinner, Success, index$5 as Swipeable, index$3 as Switch, index$2 as Tabs, Tag, TextInput, ThemeProvider, ThemeSwitcher, TimePicker, Toast, index$1 as Toolbar, Typography, eBensSystemPalette, ehJobsSystemPalette, ehWorkDarkSystemPalette, ehWorkSystemPalette, getTheme, jobsSystemPalette, scale, index$b as styled, swagDarkSystemPalette, swagLightJobsSystemPalette, swagSystemPalette$1 as swagLightSystemPalette, swagSystemPalette$2 as swagSystemPalette, defaultTheme as theme, useAvatarColors, useTheme, walletSystemPalette, withTheme, workSystemPalette };
|
|
46796
|
+
export { Accordion, Alert, AppCue, Attachment, index$a as Avatar, Badge$1 as Badge, BottomNavigation, BottomSheet$1 as BottomSheet, Box, CompoundButton as Button, Calendar$1 as Calendar, Card$1 as Card, index$9 as Carousel, Chart, Checkbox, Chip, Collapse, ContentNavigator, index$8 as DatePicker, Divider, index$7 as Drawer, Empty, ErrorComponent as Error, FAB, FlatListWithFAB, FloatingIsland, HeroDesignProvider, Icon, Image, List$1 as List, LocaleProvider, index$6 as MapPin, PageControl, PinInput, Portal$1 as Portal, Progress, CompoundRadio as Radio, Rate, RefreshControl, index as RichTextEditor, ScrollViewWithFAB, Search, SectionHeading, SectionListWithFAB, index$4 as Select, Skeleton, Slider, Spinner, Success, index$5 as Swipeable, index$3 as Switch, index$2 as Tabs, Tag, TextInput, ThemeProvider, ThemeSwitcher, PublicTimePicker as TimePicker, Toast, index$1 as Toolbar, Typography, eBensSystemPalette, ehJobsSystemPalette, ehWorkDarkSystemPalette, ehWorkSystemPalette, getTheme, jobsSystemPalette, scale, index$b as styled, swagDarkSystemPalette, swagLightJobsSystemPalette, swagSystemPalette$1 as swagLightSystemPalette, swagSystemPalette$2 as swagSystemPalette, defaultTheme as theme, useAvatarColors, useTheme, walletSystemPalette, withTheme, workSystemPalette };
|
package/lib/index.js
CHANGED
|
@@ -20016,7 +20016,7 @@ var renderInput$1 = function renderInput(_ref3) {
|
|
|
20016
20016
|
renderInputValue = _ref3.renderInputValue,
|
|
20017
20017
|
ref = _ref3.ref,
|
|
20018
20018
|
theme = _ref3.theme;
|
|
20019
|
-
return renderInputValue ? renderInputValue(nativeInputProps) : /*#__PURE__*/React__namespace.default.createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
|
|
20019
|
+
return renderInputValue ? renderInputValue(nativeInputProps, ref) : /*#__PURE__*/React__namespace.default.createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
|
|
20020
20020
|
themeVariant: variant,
|
|
20021
20021
|
multiline: variant === 'textarea' || nativeInputProps.multiline,
|
|
20022
20022
|
ref: ref,
|
|
@@ -20458,7 +20458,8 @@ var DatePickerAndroid = function DatePickerAndroid(_ref) {
|
|
|
20458
20458
|
_ref$variant = _ref.variant,
|
|
20459
20459
|
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
20460
20460
|
renderSelectedValue = _ref.renderSelectedValue,
|
|
20461
|
-
locale = _ref.locale
|
|
20461
|
+
locale = _ref.locale,
|
|
20462
|
+
TextInputComponent = _ref.TextInputComponent;
|
|
20462
20463
|
var _useState = React.useState(false),
|
|
20463
20464
|
_useState2 = _slicedToArray(_useState, 2),
|
|
20464
20465
|
open = _useState2[0],
|
|
@@ -20476,6 +20477,7 @@ var DatePickerAndroid = function DatePickerAndroid(_ref) {
|
|
|
20476
20477
|
onChange: onChange,
|
|
20477
20478
|
value: value
|
|
20478
20479
|
});
|
|
20480
|
+
var InputComponent = TextInputComponent || TextInput;
|
|
20479
20481
|
return /*#__PURE__*/React__namespace.default.createElement(reactNative.TouchableOpacity, {
|
|
20480
20482
|
onPress: function onPress() {
|
|
20481
20483
|
return setOpen(true);
|
|
@@ -20484,7 +20486,7 @@ var DatePickerAndroid = function DatePickerAndroid(_ref) {
|
|
|
20484
20486
|
}, /*#__PURE__*/React__namespace.default.createElement(reactNative.View, {
|
|
20485
20487
|
pointerEvents: "none",
|
|
20486
20488
|
testID: "datePickerInputAndroid"
|
|
20487
|
-
}, /*#__PURE__*/React__namespace.default.createElement(
|
|
20489
|
+
}, /*#__PURE__*/React__namespace.default.createElement(InputComponent, {
|
|
20488
20490
|
label: label,
|
|
20489
20491
|
value: displayValue,
|
|
20490
20492
|
suffix: "calendar-dates-outlined",
|
|
@@ -20579,7 +20581,8 @@ var DatePickerCalendar = function DatePickerCalendar(_ref2) {
|
|
|
20579
20581
|
_ref2$supportedOrient = _ref2.supportedOrientations,
|
|
20580
20582
|
supportedOrientations = _ref2$supportedOrient === void 0 ? ['portrait'] : _ref2$supportedOrient,
|
|
20581
20583
|
renderSelectedValue = _ref2.renderSelectedValue,
|
|
20582
|
-
locale = _ref2.locale
|
|
20584
|
+
locale = _ref2.locale,
|
|
20585
|
+
TextInputComponent = _ref2.TextInputComponent;
|
|
20583
20586
|
var _useState5 = React.useState(false),
|
|
20584
20587
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
20585
20588
|
open = _useState6[0],
|
|
@@ -20605,6 +20608,7 @@ var DatePickerCalendar = function DatePickerCalendar(_ref2) {
|
|
|
20605
20608
|
onChange: onChange,
|
|
20606
20609
|
value: value
|
|
20607
20610
|
});
|
|
20611
|
+
var InputComponent = TextInputComponent || TextInput;
|
|
20608
20612
|
return /*#__PURE__*/React__namespace.default.createElement(reactNative.TouchableOpacity, {
|
|
20609
20613
|
onPress: function onPress() {
|
|
20610
20614
|
return setOpen(true);
|
|
@@ -20613,7 +20617,7 @@ var DatePickerCalendar = function DatePickerCalendar(_ref2) {
|
|
|
20613
20617
|
}, /*#__PURE__*/React__namespace.default.createElement(reactNative.View, {
|
|
20614
20618
|
pointerEvents: "none",
|
|
20615
20619
|
testID: "datePickerCalendar"
|
|
20616
|
-
}, /*#__PURE__*/React__namespace.default.createElement(
|
|
20620
|
+
}, /*#__PURE__*/React__namespace.default.createElement(InputComponent, {
|
|
20617
20621
|
label: label,
|
|
20618
20622
|
value: displayValue,
|
|
20619
20623
|
suffix: "calendar-dates-outlined",
|
|
@@ -20710,13 +20714,14 @@ var IOSDatePickerDialog = function IOSDatePickerDialog(_ref) {
|
|
|
20710
20714
|
minimumDate: minDate,
|
|
20711
20715
|
textColor: theme.colors.onDefaultGlobalSurface,
|
|
20712
20716
|
maximumDate: maxDate,
|
|
20717
|
+
style: {
|
|
20718
|
+
height: '100%',
|
|
20719
|
+
width: '100%'
|
|
20720
|
+
},
|
|
20713
20721
|
onChange: function onChange(date) {
|
|
20714
20722
|
if (date) {
|
|
20715
20723
|
setSelectingDate(date);
|
|
20716
20724
|
}
|
|
20717
|
-
},
|
|
20718
|
-
style: {
|
|
20719
|
-
flex: 1
|
|
20720
20725
|
}
|
|
20721
20726
|
}) : null, variant === 'default' ? /*#__PURE__*/React__namespace.default.createElement(DateTimePicker__default.default, {
|
|
20722
20727
|
locale: locale,
|
|
@@ -20759,7 +20764,8 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
|
|
|
20759
20764
|
_ref$variant = _ref.variant,
|
|
20760
20765
|
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
20761
20766
|
locale = _ref.locale,
|
|
20762
|
-
renderSelectedValue = _ref.renderSelectedValue
|
|
20767
|
+
renderSelectedValue = _ref.renderSelectedValue,
|
|
20768
|
+
TextInputComponent = _ref.TextInputComponent;
|
|
20763
20769
|
var _useState = React.useState(false),
|
|
20764
20770
|
_useState2 = _slicedToArray(_useState, 2),
|
|
20765
20771
|
open = _useState2[0],
|
|
@@ -20779,6 +20785,7 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
|
|
|
20779
20785
|
onChange: onChange,
|
|
20780
20786
|
value: value
|
|
20781
20787
|
});
|
|
20788
|
+
var InputComponent = TextInputComponent || TextInput;
|
|
20782
20789
|
return /*#__PURE__*/React__namespace.default.createElement(reactNative.TouchableOpacity, {
|
|
20783
20790
|
onPress: function onPress() {
|
|
20784
20791
|
return setOpen(true);
|
|
@@ -20787,7 +20794,7 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
|
|
|
20787
20794
|
}, /*#__PURE__*/React__namespace.default.createElement(reactNative.View, {
|
|
20788
20795
|
pointerEvents: "none",
|
|
20789
20796
|
testID: "datePickerInputIOS"
|
|
20790
|
-
}, /*#__PURE__*/React__namespace.default.createElement(
|
|
20797
|
+
}, /*#__PURE__*/React__namespace.default.createElement(InputComponent, {
|
|
20791
20798
|
label: label,
|
|
20792
20799
|
value: displayValue,
|
|
20793
20800
|
suffix: "calendar-dates-outlined",
|
|
@@ -20821,31 +20828,40 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
|
|
|
20821
20828
|
}));
|
|
20822
20829
|
};
|
|
20823
20830
|
|
|
20824
|
-
var _excluded$s = ["variant"];
|
|
20831
|
+
var _excluded$s = ["variant", "TextInputComponent"];
|
|
20825
20832
|
var DatePicker = function DatePicker(_ref) {
|
|
20826
20833
|
var _ref$variant = _ref.variant,
|
|
20827
20834
|
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
20835
|
+
_ref$TextInputCompone = _ref.TextInputComponent,
|
|
20836
|
+
TextInputComponent = _ref$TextInputCompone === void 0 ? TextInput : _ref$TextInputCompone,
|
|
20828
20837
|
props = _objectWithoutProperties(_ref, _excluded$s);
|
|
20829
20838
|
if (variant === 'calendar') {
|
|
20830
|
-
return /*#__PURE__*/React__namespace.default.createElement(DatePickerCalendar, props
|
|
20839
|
+
return /*#__PURE__*/React__namespace.default.createElement(DatePickerCalendar, _extends$1({}, props, {
|
|
20840
|
+
TextInputComponent: TextInputComponent
|
|
20841
|
+
}));
|
|
20831
20842
|
}
|
|
20832
20843
|
if (reactNative.Platform.OS === 'ios') {
|
|
20833
20844
|
return /*#__PURE__*/React__namespace.default.createElement(DatePickerIOS, _extends$1({}, props, {
|
|
20834
|
-
variant: variant
|
|
20845
|
+
variant: variant,
|
|
20846
|
+
TextInputComponent: TextInputComponent
|
|
20835
20847
|
}));
|
|
20836
20848
|
}
|
|
20837
20849
|
return /*#__PURE__*/React__namespace.default.createElement(DatePickerAndroid, _extends$1({}, props, {
|
|
20838
|
-
variant: variant
|
|
20850
|
+
variant: variant,
|
|
20851
|
+
TextInputComponent: TextInputComponent
|
|
20839
20852
|
}));
|
|
20840
20853
|
};
|
|
20841
|
-
|
|
20842
|
-
|
|
20854
|
+
|
|
20855
|
+
var Dialog = function Dialog(_ref) {
|
|
20856
|
+
var props = _extends$1({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
20843
20857
|
if (reactNative.Platform.OS === 'ios') {
|
|
20844
20858
|
return /*#__PURE__*/React__namespace.default.createElement(IOSDatePickerDialog, props);
|
|
20845
20859
|
}
|
|
20846
20860
|
return /*#__PURE__*/React__namespace.default.createElement(AndroidDatePickerDialog, props);
|
|
20847
20861
|
};
|
|
20848
|
-
|
|
20862
|
+
|
|
20863
|
+
var PublicDatePicker = DatePicker;
|
|
20864
|
+
var index$8 = Object.assign(PublicDatePicker, {
|
|
20849
20865
|
Dialog: Dialog
|
|
20850
20866
|
});
|
|
20851
20867
|
|
|
@@ -23987,7 +24003,7 @@ var PinInput = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
|
23987
24003
|
onFocus: focus,
|
|
23988
24004
|
onBlur: blur,
|
|
23989
24005
|
pointerEvents: "none",
|
|
23990
|
-
|
|
24006
|
+
inputMode: "numeric",
|
|
23991
24007
|
testID: "pin-hidden-input",
|
|
23992
24008
|
textContentType: textContentType,
|
|
23993
24009
|
autoComplete: autoComplete,
|
|
@@ -26690,7 +26706,8 @@ var TimePickerAndroid = function TimePickerAndroid(_ref) {
|
|
|
26690
26706
|
style = _ref.style,
|
|
26691
26707
|
testID = _ref.testID,
|
|
26692
26708
|
_ref$showSuffix = _ref.showSuffix,
|
|
26693
|
-
showSuffix = _ref$showSuffix === void 0 ? true : _ref$showSuffix
|
|
26709
|
+
showSuffix = _ref$showSuffix === void 0 ? true : _ref$showSuffix,
|
|
26710
|
+
TextInputComponent = _ref.TextInputComponent;
|
|
26694
26711
|
var _useState = React.useState(false),
|
|
26695
26712
|
_useState2 = _slicedToArray(_useState, 2),
|
|
26696
26713
|
open = _useState2[0],
|
|
@@ -26698,6 +26715,7 @@ var TimePickerAndroid = function TimePickerAndroid(_ref) {
|
|
|
26698
26715
|
var is12Hour = displayFormat.includes('hh');
|
|
26699
26716
|
var displayValue = value ? formatTime(displayFormat, value) : '';
|
|
26700
26717
|
var pickerInitValue = value || new Date();
|
|
26718
|
+
var InputComponent = TextInputComponent || TextInput;
|
|
26701
26719
|
return /*#__PURE__*/React__namespace.default.createElement(reactNative.TouchableOpacity, {
|
|
26702
26720
|
onPress: function onPress() {
|
|
26703
26721
|
return setOpen(true);
|
|
@@ -26706,7 +26724,7 @@ var TimePickerAndroid = function TimePickerAndroid(_ref) {
|
|
|
26706
26724
|
}, /*#__PURE__*/React__namespace.default.createElement(reactNative.View, {
|
|
26707
26725
|
pointerEvents: "none",
|
|
26708
26726
|
testID: "timePickerInputAndroid"
|
|
26709
|
-
}, /*#__PURE__*/React__namespace.default.createElement(
|
|
26727
|
+
}, /*#__PURE__*/React__namespace.default.createElement(InputComponent, {
|
|
26710
26728
|
label: label,
|
|
26711
26729
|
value: displayValue,
|
|
26712
26730
|
suffix: showSuffix ? 'clock-3' : undefined,
|
|
@@ -26758,7 +26776,8 @@ var TimePickerIOS = function TimePickerIOS(_ref) {
|
|
|
26758
26776
|
_ref$showSuffix = _ref.showSuffix,
|
|
26759
26777
|
showSuffix = _ref$showSuffix === void 0 ? true : _ref$showSuffix,
|
|
26760
26778
|
_ref$supportedOrienta = _ref.supportedOrientations,
|
|
26761
|
-
supportedOrientations = _ref$supportedOrienta === void 0 ? ['portrait'] : _ref$supportedOrienta
|
|
26779
|
+
supportedOrientations = _ref$supportedOrienta === void 0 ? ['portrait'] : _ref$supportedOrienta,
|
|
26780
|
+
TextInputComponent = _ref.TextInputComponent;
|
|
26762
26781
|
var _useState = React.useState(value || new Date()),
|
|
26763
26782
|
_useState2 = _slicedToArray(_useState, 2),
|
|
26764
26783
|
selectingDate = _useState2[0],
|
|
@@ -26770,6 +26789,7 @@ var TimePickerIOS = function TimePickerIOS(_ref) {
|
|
|
26770
26789
|
var is12Hour = displayFormat.includes('hh');
|
|
26771
26790
|
var displayValue = value ? formatTime(displayFormat, value) : '';
|
|
26772
26791
|
var theme = useTheme();
|
|
26792
|
+
var InputComponent = TextInputComponent || TextInput;
|
|
26773
26793
|
React.useEffect(function () {
|
|
26774
26794
|
setSelectingDate(value || new Date());
|
|
26775
26795
|
}, [value]);
|
|
@@ -26781,7 +26801,7 @@ var TimePickerIOS = function TimePickerIOS(_ref) {
|
|
|
26781
26801
|
}, /*#__PURE__*/React__namespace.default.createElement(reactNative.View, {
|
|
26782
26802
|
pointerEvents: "none",
|
|
26783
26803
|
testID: "timePickerInputIOS"
|
|
26784
|
-
}, /*#__PURE__*/React__namespace.default.createElement(
|
|
26804
|
+
}, /*#__PURE__*/React__namespace.default.createElement(InputComponent, {
|
|
26785
26805
|
label: label,
|
|
26786
26806
|
value: displayValue,
|
|
26787
26807
|
suffix: showSuffix ? 'clock-3' : undefined,
|
|
@@ -26837,6 +26857,8 @@ var TimePicker = function TimePicker(props) {
|
|
|
26837
26857
|
return /*#__PURE__*/React__namespace.default.createElement(TimePickerAndroid, props);
|
|
26838
26858
|
};
|
|
26839
26859
|
|
|
26860
|
+
var PublicTimePicker = TimePicker;
|
|
26861
|
+
|
|
26840
26862
|
var ToolbarWrapper = index$b(reactNative.View)(function (_ref) {
|
|
26841
26863
|
var theme = _ref.theme;
|
|
26842
26864
|
return {
|
|
@@ -46856,7 +46878,7 @@ exports.Tag = Tag;
|
|
|
46856
46878
|
exports.TextInput = TextInput;
|
|
46857
46879
|
exports.ThemeProvider = ThemeProvider;
|
|
46858
46880
|
exports.ThemeSwitcher = ThemeSwitcher;
|
|
46859
|
-
exports.TimePicker =
|
|
46881
|
+
exports.TimePicker = PublicTimePicker;
|
|
46860
46882
|
exports.Toast = Toast;
|
|
46861
46883
|
exports.Toolbar = index$1;
|
|
46862
46884
|
exports.Typography = Typography;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hero-design/rn",
|
|
3
|
-
"version": "8.103.
|
|
3
|
+
"version": "8.103.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -92,10 +92,10 @@
|
|
|
92
92
|
"eslint-config-hd": "8.42.5",
|
|
93
93
|
"eslint-config-prettier": "^8.5.0",
|
|
94
94
|
"eslint-import-resolver-typescript": "^3.5.2",
|
|
95
|
-
"eslint-plugin-import": "^2.
|
|
95
|
+
"eslint-plugin-import": "^2.32.0",
|
|
96
96
|
"eslint-plugin-jsx-a11y": "^6.5.1",
|
|
97
97
|
"eslint-plugin-prettier": "^4.0.0",
|
|
98
|
-
"eslint-plugin-react": "^7.37.
|
|
98
|
+
"eslint-plugin-react": "^7.37.5",
|
|
99
99
|
"eslint-plugin-react-hooks": "^4.3.0",
|
|
100
100
|
"jest": "^29.2.1",
|
|
101
101
|
"jest-environment-jsdom": "^29.2.1",
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Platform } from 'react-native';
|
|
3
|
+
import DatePickerAndroid from './DatePickerAndroid';
|
|
4
|
+
import DatePickerCalendar from './DatePickerCalendar';
|
|
5
|
+
import DatePickerIOS from './DatePickerIOS';
|
|
6
|
+
import type { InternalDatePickerProps } from './types';
|
|
7
|
+
import TextInput from '../TextInput';
|
|
8
|
+
|
|
9
|
+
const DatePicker = ({
|
|
10
|
+
variant = 'default',
|
|
11
|
+
TextInputComponent = TextInput,
|
|
12
|
+
...props
|
|
13
|
+
}: InternalDatePickerProps) => {
|
|
14
|
+
if (variant === 'calendar') {
|
|
15
|
+
return (
|
|
16
|
+
<DatePickerCalendar {...props} TextInputComponent={TextInputComponent} />
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
if (Platform.OS === 'ios') {
|
|
20
|
+
return (
|
|
21
|
+
<DatePickerIOS
|
|
22
|
+
{...props}
|
|
23
|
+
variant={variant}
|
|
24
|
+
TextInputComponent={TextInputComponent}
|
|
25
|
+
/>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<DatePickerAndroid
|
|
31
|
+
{...props}
|
|
32
|
+
variant={variant}
|
|
33
|
+
TextInputComponent={TextInputComponent}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default DatePicker;
|
|
@@ -5,10 +5,10 @@ import TextInput from '../TextInput';
|
|
|
5
5
|
import AndroidDatePickerDialog from './Dialog/AndroidDialog';
|
|
6
6
|
import useCalculateDate from './hooks/useCalculateDate';
|
|
7
7
|
import useFormatDate from './hooks/useFormatDate';
|
|
8
|
-
import type {
|
|
8
|
+
import type { InternalDatePickerProps } from './types';
|
|
9
9
|
|
|
10
10
|
type DatePickerAndroidProps = Omit<
|
|
11
|
-
|
|
11
|
+
InternalDatePickerProps,
|
|
12
12
|
'variant' | 'monthPickerConfirmLabel' | 'monthPickerCancelLabel'
|
|
13
13
|
> & {
|
|
14
14
|
variant?: 'default' | 'month-year';
|
|
@@ -30,6 +30,7 @@ const DatePickerAndroid = ({
|
|
|
30
30
|
variant = 'default',
|
|
31
31
|
renderSelectedValue,
|
|
32
32
|
locale,
|
|
33
|
+
TextInputComponent,
|
|
33
34
|
}: DatePickerAndroidProps) => {
|
|
34
35
|
const [open, setOpen] = useState(false);
|
|
35
36
|
|
|
@@ -41,10 +42,12 @@ const DatePickerAndroid = ({
|
|
|
41
42
|
|
|
42
43
|
useCalculateDate({ minDate, maxDate, onChange, value });
|
|
43
44
|
|
|
45
|
+
const InputComponent = TextInputComponent || TextInput;
|
|
46
|
+
|
|
44
47
|
return (
|
|
45
48
|
<TouchableOpacity onPress={() => setOpen(true)} disabled={disabled}>
|
|
46
49
|
<View pointerEvents="none" testID="datePickerInputAndroid">
|
|
47
|
-
<
|
|
50
|
+
<InputComponent
|
|
48
51
|
label={label}
|
|
49
52
|
value={displayValue}
|
|
50
53
|
suffix="calendar-dates-outlined"
|
|
@@ -7,7 +7,7 @@ import Calendar, { CalendarProps } from '../Calendar';
|
|
|
7
7
|
import TextInput from '../TextInput';
|
|
8
8
|
import useCalculateDate from './hooks/useCalculateDate';
|
|
9
9
|
import useFormatDate from './hooks/useFormatDate';
|
|
10
|
-
import type {
|
|
10
|
+
import type { InternalDatePickerProps } from './types';
|
|
11
11
|
|
|
12
12
|
const InternalCalendar = ({
|
|
13
13
|
minDate,
|
|
@@ -80,7 +80,8 @@ const DatePickerCalendar = ({
|
|
|
80
80
|
supportedOrientations = ['portrait'],
|
|
81
81
|
renderSelectedValue,
|
|
82
82
|
locale,
|
|
83
|
-
|
|
83
|
+
TextInputComponent,
|
|
84
|
+
}: Omit<InternalDatePickerProps, 'variant'>) => {
|
|
84
85
|
const [open, setOpen] = useState(false);
|
|
85
86
|
const [monthPickerVisible, setMonthPickerVisible] = useState(false);
|
|
86
87
|
const shouldHideToolbar = Platform.OS === 'ios' && monthPickerVisible;
|
|
@@ -95,10 +96,12 @@ const DatePickerCalendar = ({
|
|
|
95
96
|
|
|
96
97
|
useCalculateDate({ minDate, maxDate, onChange, value });
|
|
97
98
|
|
|
99
|
+
const InputComponent = TextInputComponent || TextInput;
|
|
100
|
+
|
|
98
101
|
return (
|
|
99
102
|
<TouchableOpacity onPress={() => setOpen(true)} disabled={disabled}>
|
|
100
103
|
<View pointerEvents="none" testID="datePickerCalendar">
|
|
101
|
-
<
|
|
104
|
+
<InputComponent
|
|
102
105
|
label={label}
|
|
103
106
|
value={displayValue}
|
|
104
107
|
suffix="calendar-dates-outlined"
|