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.cjs CHANGED
@@ -2615,7 +2615,8 @@ var moment = momentRange.extendMoment(moment__default["default"]);
2615
2615
  var Calendar = function Calendar(props) {
2616
2616
  var _props$events = props.events,
2617
2617
  events = _props$events === void 0 ? [] : _props$events,
2618
- children = props.children;
2618
+ children = props.children,
2619
+ onChange = props.onChange;
2619
2620
 
2620
2621
  var _useState = React.useState(),
2621
2622
  position = _useState[0],
@@ -2625,6 +2626,21 @@ var Calendar = function Calendar(props) {
2625
2626
  var today = moment();
2626
2627
  setPosition(today);
2627
2628
  }, []);
2629
+ React.useEffect(function () {
2630
+ if (position && onChange) {
2631
+ var _firstDayOfMonth = position.clone().startOf('month');
2632
+
2633
+ var _firstDayOfRange = _firstDayOfMonth.clone().startOf('isoweek');
2634
+
2635
+ var _lastDayOfMonth = position.clone().endOf('month');
2636
+
2637
+ var _lastDayOfRange = _lastDayOfMonth.clone().endOf('isoweek');
2638
+
2639
+ var _range = moment.range(_firstDayOfRange, _lastDayOfRange);
2640
+
2641
+ onChange(position, _range);
2642
+ }
2643
+ }, [position]);
2628
2644
 
2629
2645
  function next() {
2630
2646
  var next = position.clone().add(1, 'month');
@@ -3778,7 +3794,8 @@ var View = function View(props) {
3778
3794
  };
3779
3795
  var TabbedView = function TabbedView(props) {
3780
3796
  var title = props.title,
3781
- className = props.className;
3797
+ className = props.className,
3798
+ selected = props.selected;
3782
3799
 
3783
3800
  var _useState2 = React.useState(0),
3784
3801
  tab = _useState2[0],
@@ -3791,6 +3808,9 @@ var TabbedView = function TabbedView(props) {
3791
3808
  label: child.props.label
3792
3809
  });
3793
3810
  });
3811
+ React.useEffect(function () {
3812
+ if (selected && selected !== tab) setTab(selected);
3813
+ }, [selected]);
3794
3814
  var toolbar = /*#__PURE__*/React__default["default"].createElement(Tabs, {
3795
3815
  selected: tab,
3796
3816
  onChange: function onChange(tab) {