ywana-core8 0.0.824 → 0.0.825

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.
@@ -1,5 +1,5 @@
1
1
  import 'material-design-icons-iconfont/dist/material-design-icons.css';
2
- import React, { useState, useEffect, useContext, Fragment, useRef, useMemo, Children } from 'react';
2
+ import React, { useState, useEffect, useContext, Fragment, useRef, useMemo, useCallback, Children } from 'react';
3
3
  import RSwitch from 'react-switch';
4
4
  import moment$1 from 'moment';
5
5
  import { extendMoment } from 'moment-range';
@@ -3425,11 +3425,15 @@ var Planner = function Planner(_ref) {
3425
3425
  setTo = _useState3[1];
3426
3426
 
3427
3427
  var thisMondayElement = useRef(null);
3428
- useEffect(function () {
3429
- if (thisMondayElement.current) {
3430
- showThisWeek();
3431
- }
3432
- }, [thisMondayElement]);
3428
+ var gotoMonday = useCallback(function (node) {
3429
+ var element = node;
3430
+ console.log("goto monday", element);
3431
+ if (element) element.scrollIntoView({
3432
+ behavior: 'smooth',
3433
+ block: 'start',
3434
+ inline: 'start'
3435
+ });
3436
+ }, []);
3433
3437
  useEffect(function () {
3434
3438
  var element = document.getElementById(focusEvent);
3435
3439
  if (element) element.scrollIntoView({
@@ -3471,6 +3475,7 @@ var Planner = function Planner(_ref) {
3471
3475
  function showThisWeek() {
3472
3476
  var element = thisMondayElement.current; //const element = document.querySelector(".thisMonday")
3473
3477
 
3478
+ console.log("Show this week", element);
3474
3479
  if (element) element.scrollIntoView({
3475
3480
  behavior: 'smooth',
3476
3481
  block: 'start',
@@ -3573,10 +3578,12 @@ var Planner = function Planner(_ref) {
3573
3578
  var isThisMonday = date.moment.isSame(weekStart);
3574
3579
  return /*#__PURE__*/React.createElement("div", {
3575
3580
  key: "column-" + date.moment.dayOfYear(),
3581
+ id: isThisMonday ? "thisMonday" : "",
3576
3582
  className: "column-header",
3577
3583
  ref: isThisMonday ? thisMondayElement : null
3578
3584
  }, /*#__PURE__*/React.createElement("div", {
3579
- className: "date-header " + weekend + " " + thisWeek
3585
+ className: "date-header " + weekend + " " + thisWeek,
3586
+ ref: isThisMonday ? gotoMonday : null
3580
3587
  }, /*#__PURE__*/React.createElement(Text, {
3581
3588
  use: "headline6"
3582
3589
  }, date.moment.format("DD")), "\xA0", /*#__PURE__*/React.createElement(Text, {