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