@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 CHANGED
@@ -242,7 +242,7 @@ export default class MonthList extends Component<
242
242
  componentDidMount() {
243
243
  setTimeout(() => {
244
244
  this.scrollToMonth(this.currentDate);
245
- }, 250);
245
+ }, 500);
246
246
  }
247
247
 
248
248
  render() {
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
- <ScrollView onLayout={this.onLayout} style={[styles.scrollView, style]}>
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
- </ScrollView>
476
+ </View>
469
477
  </ContainerContext.Provider>
470
478
  );
471
479
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/calendar",
3
- "version": "0.79.6-beta.9",
3
+ "version": "0.80.1",
4
4
  "private": false,
5
5
  "main": "index.tsx",
6
6
  "peerDependencies": {
@@ -14,4 +14,4 @@
14
14
  "dependencies": {
15
15
  "moment": "^2.24.0"
16
16
  }
17
- }
17
+ }
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: 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;
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: boolean;
76
+ isShowLunar?: boolean;
77
77
  priceList?: PriceListData;
78
78
  labelFrom?: string;
79
79
  labelTo?: string;
80
80
  isHideLabel?: boolean;
81
- minDate: Date;
82
- maxDate: Date;
81
+ minDate?: Date;
82
+ maxDate?: Date;
83
83
  isHideHeaderPanel?: boolean;
84
- style: ViewStyle | ViewStyle[];
84
+ style?: ViewStyle | ViewStyle[];
85
85
  disabledDays?: Date[];
86
86
  };
87
87