ywana-core8 0.0.941 → 0.0.943

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
@@ -1063,7 +1063,10 @@
1063
1063
  fillLeft = _props$fillLeft === void 0 ? false : _props$fillLeft,
1064
1064
  _props$fillRight = props.fillRight,
1065
1065
  fillRight = _props$fillRight === void 0 ? true : _props$fillRight;
1066
- var tabs = React__default["default"].Children.map(children, function (child, index) {
1066
+ var notNullChildren = React__default["default"].Children.toArray(children).filter(function (child) {
1067
+ return child !== null;
1068
+ });
1069
+ var tabs = notNullChildren.map(function (child, index) {
1067
1070
  function select(id) {
1068
1071
  if (onChange) onChange(id || index);
1069
1072
  }
@@ -1113,7 +1116,10 @@
1113
1116
  var Stack = function Stack(props) {
1114
1117
  var _props$selected = props.selected,
1115
1118
  selected = _props$selected === void 0 ? 0 : _props$selected;
1116
- var child = React__default["default"].Children.toArray(props.children).filter(function (child, index) {
1119
+ var notNullChildren = React__default["default"].Children.toArray(props.children).filter(function (child) {
1120
+ return child !== null;
1121
+ });
1122
+ var child = notNullChildren.filter(function (child, index) {
1117
1123
  return index === selected;
1118
1124
  })[0];
1119
1125
  return /*#__PURE__*/React__default["default"].createElement(React.Fragment, null, child);
@@ -3229,12 +3235,14 @@
3229
3235
  var _props$events = props.events,
3230
3236
  events = _props$events === void 0 ? [] : _props$events,
3231
3237
  children = props.children,
3232
- onChange = props.onChange;
3238
+ onChange = props.onChange,
3239
+ onRange = props.onRange;
3233
3240
  var _useState = React.useState(props.range || "year"),
3234
3241
  range = _useState[0],
3235
3242
  setRange = _useState[1];
3236
3243
  function onChangeRange(range) {
3237
3244
  setRange(range);
3245
+ if (onRange) onRange(range);
3238
3246
  }
3239
3247
  return /*#__PURE__*/React__default["default"].createElement("div", {
3240
3248
  className: "calendar"
@@ -5779,6 +5787,9 @@
5779
5787
  function selectCell(cell) {
5780
5788
  if (onSelectCell) onSelectCell(cell);
5781
5789
  }
5790
+ function drop() {
5791
+ //TODO
5792
+ }
5782
5793
  var uniqueMonths = Array.from(new Set(days.map(function (_ref2) {
5783
5794
  var month = _ref2.month;
5784
5795
  return month;
@@ -5879,18 +5890,19 @@
5879
5890
  });
5880
5891
  var weekendClass = isWeekend ? 'weekend' : '';
5881
5892
  return /*#__PURE__*/React__default["default"].createElement("div", {
5893
+ key: "content" + index + "_" + year + "-" + month + "-" + day,
5882
5894
  className: "content-cell " + weekendClass,
5883
5895
  style: {
5884
5896
  minWidth: dayWidth,
5885
5897
  maxWidth: dayWidth
5886
5898
  },
5887
- key: "content" + index + "_" + year + "-" + month + "-" + day,
5888
5899
  onClick: function onClick() {
5889
5900
  return selectCell({
5890
5901
  lane: lane.id,
5891
5902
  date: dayDate
5892
5903
  });
5893
- }
5904
+ },
5905
+ onDrop: drop
5894
5906
  }, dayEvents.map(function (event, index) {
5895
5907
  return /*#__PURE__*/React__default["default"].createElement(EventRenderer, {
5896
5908
  key: event.id + "-" + index,