@momo-kits/calendar 0.79.6-beta.9 → 0.80.1
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/MonthList.tsx +1 -1
- package/index.tsx +10 -2
- package/package.json +2 -2
- package/styles.ts +0 -3
- package/types.ts +12 -12
package/MonthList.tsx
CHANGED
package/index.tsx
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
ApplicationContext,
|
|
6
6
|
Radius,
|
|
7
7
|
scaleSize,
|
|
8
|
+
Spacing,
|
|
8
9
|
Switch,
|
|
9
10
|
Text,
|
|
10
11
|
} from '@momo-kits/foundation';
|
|
@@ -412,6 +413,12 @@ class Calendar extends Component<CalendarProps, CalendarState> {
|
|
|
412
413
|
};
|
|
413
414
|
|
|
414
415
|
render() {
|
|
416
|
+
const currentDate = new Date();
|
|
417
|
+
const minDateDefault = new Date(currentDate);
|
|
418
|
+
const maxDateDefault = new Date(currentDate);
|
|
419
|
+
minDateDefault.setFullYear(minDateDefault.getFullYear() - 1);
|
|
420
|
+
maxDateDefault.setFullYear(maxDateDefault.getFullYear() + 1);
|
|
421
|
+
|
|
415
422
|
const {
|
|
416
423
|
isOffLunar,
|
|
417
424
|
isHideHoliday,
|
|
@@ -437,11 +444,12 @@ class Calendar extends Component<CalendarProps, CalendarState> {
|
|
|
437
444
|
width: containerWidth,
|
|
438
445
|
height: priceList ? scaleSize(48) : scaleSize(34),
|
|
439
446
|
}}>
|
|
440
|
-
<
|
|
447
|
+
<View onLayout={this.onLayout} style={[style, styles.scrollView]}>
|
|
441
448
|
<View
|
|
442
449
|
style={{
|
|
443
450
|
backgroundColor: theme.colors.background.surface,
|
|
444
451
|
borderRadius: Radius.XS,
|
|
452
|
+
marginBottom: Spacing.S,
|
|
445
453
|
}}>
|
|
446
454
|
{!isHiddenSwitch && this.renderSwitchReturnSelection()}
|
|
447
455
|
{!isHideHeaderPanel && this.renderHeaderPanel(theme)}
|
|
@@ -465,7 +473,7 @@ class Calendar extends Component<CalendarProps, CalendarState> {
|
|
|
465
473
|
isOffLunar={isOffLunar}
|
|
466
474
|
disabledDays={disabledDays}
|
|
467
475
|
/>
|
|
468
|
-
</
|
|
476
|
+
</View>
|
|
469
477
|
</ContainerContext.Provider>
|
|
470
478
|
);
|
|
471
479
|
}
|
package/package.json
CHANGED
package/styles.ts
CHANGED
|
@@ -21,7 +21,6 @@ export default StyleSheet.create({
|
|
|
21
21
|
marginTop: Spacing.S,
|
|
22
22
|
},
|
|
23
23
|
scrollView: {
|
|
24
|
-
flex: 1,
|
|
25
24
|
backgroundColor: 'transparent',
|
|
26
25
|
alignSelf: 'center',
|
|
27
26
|
width: '100%',
|
|
@@ -58,9 +57,7 @@ export default StyleSheet.create({
|
|
|
58
57
|
marginTop: Spacing.S,
|
|
59
58
|
},
|
|
60
59
|
container: {
|
|
61
|
-
flex: 1,
|
|
62
60
|
backgroundColor: 'white',
|
|
63
|
-
marginTop: Spacing.S,
|
|
64
61
|
borderRadius: Radius.XS,
|
|
65
62
|
},
|
|
66
63
|
blueSeperator: {
|
package/types.ts
CHANGED
|
@@ -60,28 +60,28 @@ export type DoubleDate = {
|
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
export type CalendarProps = {
|
|
63
|
-
doubleDate
|
|
64
|
-
selectedDate
|
|
65
|
-
mode
|
|
66
|
-
id
|
|
67
|
-
onChangeTab
|
|
68
|
-
onDateChange
|
|
69
|
-
onCTAStateChange
|
|
70
|
-
onCallbackCalendar
|
|
63
|
+
doubleDate?: DoubleDate;
|
|
64
|
+
selectedDate?: Moment.Moment;
|
|
65
|
+
mode?: 'doubleDate' | 'singleDate';
|
|
66
|
+
id?: number;
|
|
67
|
+
onChangeTab?: (id: number) => void;
|
|
68
|
+
onDateChange?: (date: DoubleDate | Date) => void;
|
|
69
|
+
onCTAStateChange?: (b: boolean) => void;
|
|
70
|
+
onCallbackCalendar?: (type: string, isDoubleDateMode: boolean) => void;
|
|
71
71
|
headerFrom?: string;
|
|
72
72
|
headerTo?: string;
|
|
73
73
|
isOffLunar?: boolean;
|
|
74
74
|
isHideHoliday?: boolean;
|
|
75
75
|
isHiddenSwitch?: boolean;
|
|
76
|
-
isShowLunar
|
|
76
|
+
isShowLunar?: boolean;
|
|
77
77
|
priceList?: PriceListData;
|
|
78
78
|
labelFrom?: string;
|
|
79
79
|
labelTo?: string;
|
|
80
80
|
isHideLabel?: boolean;
|
|
81
|
-
minDate
|
|
82
|
-
maxDate
|
|
81
|
+
minDate?: Date;
|
|
82
|
+
maxDate?: Date;
|
|
83
83
|
isHideHeaderPanel?: boolean;
|
|
84
|
-
style
|
|
84
|
+
style?: ViewStyle | ViewStyle[];
|
|
85
85
|
disabledDays?: Date[];
|
|
86
86
|
};
|
|
87
87
|
|