ywana-core8 0.0.551 → 0.0.554

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.
@@ -2607,7 +2607,8 @@ var moment = extendMoment(moment$1);
2607
2607
  var Calendar = function Calendar(props) {
2608
2608
  var _props$events = props.events,
2609
2609
  events = _props$events === void 0 ? [] : _props$events,
2610
- children = props.children;
2610
+ children = props.children,
2611
+ onChange = props.onChange;
2611
2612
 
2612
2613
  var _useState = useState(),
2613
2614
  position = _useState[0],
@@ -2617,6 +2618,21 @@ var Calendar = function Calendar(props) {
2617
2618
  var today = moment();
2618
2619
  setPosition(today);
2619
2620
  }, []);
2621
+ useEffect(function () {
2622
+ if (position && onChange) {
2623
+ var _firstDayOfMonth = position.clone().startOf('month');
2624
+
2625
+ var _firstDayOfRange = _firstDayOfMonth.clone().startOf('isoweek');
2626
+
2627
+ var _lastDayOfMonth = position.clone().endOf('month');
2628
+
2629
+ var _lastDayOfRange = _lastDayOfMonth.clone().endOf('isoweek');
2630
+
2631
+ var _range = moment.range(_firstDayOfRange, _lastDayOfRange);
2632
+
2633
+ onChange(position, _range);
2634
+ }
2635
+ }, [position]);
2620
2636
 
2621
2637
  function next() {
2622
2638
  var next = position.clone().add(1, 'month');
@@ -3770,7 +3786,8 @@ var View = function View(props) {
3770
3786
  };
3771
3787
  var TabbedView = function TabbedView(props) {
3772
3788
  var title = props.title,
3773
- className = props.className;
3789
+ className = props.className,
3790
+ selected = props.selected;
3774
3791
 
3775
3792
  var _useState2 = useState(0),
3776
3793
  tab = _useState2[0],
@@ -3783,6 +3800,9 @@ var TabbedView = function TabbedView(props) {
3783
3800
  label: child.props.label
3784
3801
  });
3785
3802
  });
3803
+ useEffect(function () {
3804
+ if (selected && selected !== tab) setTab(selected);
3805
+ }, [selected]);
3786
3806
  var toolbar = /*#__PURE__*/React.createElement(Tabs, {
3787
3807
  selected: tab,
3788
3808
  onChange: function onChange(tab) {