@pushwoosh/dumb-components 1.1.147 → 1.1.148

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.
@@ -19,6 +19,7 @@ export const CalendarSuperForm = props => {
19
19
  monthWidth,
20
20
  gap,
21
21
  firstDayOfWeek,
22
+ initialVisibleMonth,
22
23
  footerContent
23
24
  } = props;
24
25
  const isRangePicker = mode === 'range-date' || mode === 'range-datetime';
@@ -101,7 +102,8 @@ export const CalendarSuperForm = props => {
101
102
  })]
102
103
  });
103
104
  } : undefined,
104
- firstDayOfWeek: firstDayOfWeek
105
+ firstDayOfWeek: firstDayOfWeek,
106
+ initialVisibleMonth: initialVisibleMonth
105
107
  })
106
108
  });
107
109
  };
@@ -14,6 +14,7 @@ type CalendarRangePickerProps = {
14
14
  onChange: (range: RangePickerValue) => void;
15
15
  renderAfter?: () => ReactNode;
16
16
  firstDayOfWeek?: 0 | 1;
17
+ initialVisibleMonth?: DateStruct;
17
18
  };
18
19
  export declare const CalendarRangePicker: FC<CalendarRangePickerProps>;
19
20
  export {};
@@ -15,12 +15,13 @@ export const CalendarRangePicker = ({
15
15
  maxDays,
16
16
  onChange,
17
17
  renderAfter,
18
- firstDayOfWeek
18
+ firstDayOfWeek,
19
+ initialVisibleMonth
19
20
  }) => {
20
21
  const startMonthRef = useRef();
21
22
  if (!startMonthRef.current) {
22
23
  const d = new Date();
23
- startMonthRef.current = value[0] || {
24
+ startMonthRef.current = initialVisibleMonth ?? value[0] ?? {
24
25
  year: d.getFullYear(),
25
26
  month: d.getMonth() + 1,
26
27
  day: d.getDate()
@@ -13,6 +13,8 @@ interface BaseProps {
13
13
  disableOnAndAfter?: DateStruct;
14
14
  /** Первый день недели: 0 - воскресенье, 1 - понедельник. По умолчанию 0. */
15
15
  firstDayOfWeek?: 0 | 1;
16
+ /** Месяц, на котором календарь открывается изначально. По умолчанию — начало диапазона (value[0]) либо текущий месяц. */
17
+ initialVisibleMonth?: DateStruct;
16
18
  /** Кастомный футер-аннотация, который рендерится после календаря и после min/max days limitation. */
17
19
  footerContent?: ReactNode;
18
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "1.1.147",
3
+ "version": "1.1.148",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",