shineout 1.10.12 → 1.10.13

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.
@@ -183,6 +183,7 @@ function (_PureComponent) {
183
183
  } else {
184
184
  var v = value[value.length - 1];
185
185
  var data = this.datum.getDataById(v);
186
+ if (data === null) return;
186
187
 
187
188
  try {
188
189
  var id = this.datum.getKey(data);
@@ -345,7 +346,6 @@ function (_PureComponent) {
345
346
  onItemClick = _this$props7.onItemClick,
346
347
  expandTrigger = _this$props7.expandTrigger,
347
348
  childrenKey = _this$props7.childrenKey,
348
- absolute = _this$props7.absolute,
349
349
  height = _this$props7.height;
350
350
  var path = this.state.path;
351
351
  var props = {
@@ -313,7 +313,7 @@ function (_PureComponent) {
313
313
 
314
314
  var items = this.handleNode(nodes, render);
315
315
 
316
- if (compressed) {
316
+ if (compressed && items.length) {
317
317
  items = this.renderMore(items);
318
318
  }
319
319
 
@@ -23,6 +23,7 @@ import { getRTLPosition } from '../utils/strings';
23
23
  import List from '../AnimationList';
24
24
  import { getLocale } from '../locale';
25
25
  import DateFns from './utils';
26
+ import ParamFns from './paramUtils';
26
27
  import { isRTL } from '../config';
27
28
  import InputTitle from '../InputTitle';
28
29
  import { inputTitleClass } from '../InputTitle/styles';
@@ -61,6 +62,7 @@ function (_PureComponent) {
61
62
  picker0: false,
62
63
  picker1: false
63
64
  };
65
+ _this.disabledMap = {};
64
66
  _this.pickerId = "picker_" + getUidStr();
65
67
  _this.bindElement = _this.bindElement.bind(_assertThisInitialized(_assertThisInitialized(_this)));
66
68
  _this.bindPicker = _this.bindPicker.bind(_assertThisInitialized(_assertThisInitialized(_this)));
@@ -77,6 +79,8 @@ function (_PureComponent) {
77
79
  _this.parseDate = _this.parseDate.bind(_assertThisInitialized(_assertThisInitialized(_this)));
78
80
  _this.dateToCurrent = _this.dateToCurrent.bind(_assertThisInitialized(_assertThisInitialized(_this)));
79
81
  _this.shouldFocus = _this.shouldFocus.bind(_assertThisInitialized(_assertThisInitialized(_this)));
82
+ _this.handleDisabled = _this.handleDisabled.bind(_assertThisInitialized(_assertThisInitialized(_this)));
83
+ _this.disabledRegister = _this.disabledRegister.bind(_assertThisInitialized(_assertThisInitialized(_this)));
80
84
  _this.bindClickAway = _this.bindClickAway.bind(_assertThisInitialized(_assertThisInitialized(_this)));
81
85
  _this.clearClickAway = _this.clearClickAway.bind(_assertThisInitialized(_assertThisInitialized(_this)));
82
86
  _this.handleClickAway = _this.handleClickAway.bind(_assertThisInitialized(_assertThisInitialized(_this)));
@@ -297,11 +301,58 @@ function (_PureComponent) {
297
301
  }
298
302
  };
299
303
 
304
+ _proto.disabledRegister = function disabledRegister(disabled, mode) {
305
+ this.disabledMap[mode] = disabled;
306
+ };
307
+
308
+ _proto.handleDisabled = function handleDisabled(date) {
309
+ var mode = this.props.type;
310
+ var disabledMap = this.disabledMap;
311
+ var _this$props3 = this.props,
312
+ min = _this$props3.min,
313
+ max = _this$props3.max,
314
+ range = _this$props3.range,
315
+ disabled = _this$props3.disabled,
316
+ disabledTime = _this$props3.disabledTime;
317
+
318
+ switch (mode) {
319
+ case 'time':
320
+ return ParamFns.handleDisabled(date, min, max, range, disabled, disabledTime);
321
+
322
+ case 'date':
323
+ return disabledMap.day(date);
324
+
325
+ case 'week':
326
+ return disabledMap.day(date);
327
+
328
+ case 'month':
329
+ return disabledMap.month(date);
330
+
331
+ case 'datetime':
332
+ return ParamFns.handleDisabled(date, min, max, range, disabled, disabledTime) || disabledMap.day(date);
333
+
334
+ default:
335
+ return false;
336
+ }
337
+ };
338
+
300
339
  _proto.handleTextChange = function handleTextChange(date, index, e) {
301
340
  var _this4 = this;
302
341
 
342
+ var _this$props4 = this.props,
343
+ disabledTime = _this$props4.disabledTime,
344
+ disabled = _this$props4.disabled,
345
+ max = _this$props4.max,
346
+ min = _this$props4.min,
347
+ range = _this$props4.range;
303
348
  var format = this.getFormat();
304
349
  var val = date ? utils.format(date, format) : '';
350
+ var isDisabled;
351
+
352
+ if (disabled || disabledTime || max || min || range) {
353
+ isDisabled = this.handleDisabled(date);
354
+ if (isDisabled) return;
355
+ }
305
356
 
306
357
  if (!this.props.range) {
307
358
  var close = !(e && e.target && this.element.contains(e.target));
@@ -382,10 +433,10 @@ function (_PureComponent) {
382
433
  };
383
434
 
384
435
  _proto.renderText = function renderText(value, placeholder, key) {
385
- var _this$props3 = this.props,
386
- inputable = _this$props3.inputable,
387
- formatResult = _this$props3.formatResult,
388
- disabled = _this$props3.disabled;
436
+ var _this$props5 = this.props,
437
+ inputable = _this$props5.inputable,
438
+ formatResult = _this$props5.formatResult,
439
+ disabled = _this$props5.disabled;
389
440
  var date = this.parseDate(value);
390
441
  var className = classnames(datepickerClass('txt', this.state["picker" + key] && 'text-focus'), utils.isInvalid(date) && inputClass('placeholder'));
391
442
  var resultFormat = formatResult || this.getFormat();
@@ -409,13 +460,13 @@ function (_PureComponent) {
409
460
  _proto.renderResult = function renderResult() {
410
461
  var _this6 = this;
411
462
 
412
- var _this$props4 = this.props,
413
- disabled = _this$props4.disabled,
414
- range = _this$props4.range,
415
- placeholder = _this$props4.placeholder,
416
- type = _this$props4.type,
417
- innerTitle = _this$props4.innerTitle,
418
- inputable = _this$props4.inputable;
463
+ var _this$props6 = this.props,
464
+ disabled = _this$props6.disabled,
465
+ range = _this$props6.range,
466
+ placeholder = _this$props6.placeholder,
467
+ type = _this$props6.type,
468
+ innerTitle = _this$props6.innerTitle,
469
+ inputable = _this$props6.inputable;
419
470
  var value = this.props.value;
420
471
  if (!value && range) value = []; // const isEmpty = !value || value.length === 0
421
472
 
@@ -451,10 +502,10 @@ function (_PureComponent) {
451
502
  var _this$state = this.state,
452
503
  focus = _this$state.focus,
453
504
  position = _this$state.position;
454
- var _this$props5 = this.props,
455
- absolute = _this$props5.absolute,
456
- zIndex = _this$props5.zIndex,
457
- quickSelect = _this$props5.quickSelect;
505
+ var _this$props7 = this.props,
506
+ absolute = _this$props7.absolute,
507
+ zIndex = _this$props7.zIndex,
508
+ quickSelect = _this$props7.quickSelect;
458
509
  var props = {
459
510
  absolute: absolute,
460
511
  focus: focus,
@@ -479,18 +530,18 @@ function (_PureComponent) {
479
530
  var _this7 = this;
480
531
 
481
532
  if (!this.firstRender) return undefined;
482
- var _this$props6 = this.props,
483
- range = _this$props6.range,
484
- type = _this$props6.type,
485
- value = _this$props6.value,
486
- min = _this$props6.min,
487
- max = _this$props6.max,
488
- disabled = _this$props6.disabled,
489
- allowSingle = _this$props6.allowSingle,
490
- hourStep = _this$props6.hourStep,
491
- minuteStep = _this$props6.minuteStep,
492
- secondStep = _this$props6.secondStep,
493
- disabledTime = _this$props6.disabledTime;
533
+ var _this$props8 = this.props,
534
+ range = _this$props8.range,
535
+ type = _this$props8.type,
536
+ value = _this$props8.value,
537
+ min = _this$props8.min,
538
+ max = _this$props8.max,
539
+ disabled = _this$props8.disabled,
540
+ allowSingle = _this$props8.allowSingle,
541
+ hourStep = _this$props8.hourStep,
542
+ minuteStep = _this$props8.minuteStep,
543
+ secondStep = _this$props8.secondStep,
544
+ disabledTime = _this$props8.disabledTime;
494
545
  var format = this.getFormat();
495
546
  var quicks = this.getQuick(format);
496
547
  var Component = range ? Range : Picker;
@@ -515,17 +566,18 @@ function (_PureComponent) {
515
566
  hourStep: hourStep,
516
567
  minuteStep: minuteStep,
517
568
  secondStep: secondStep,
518
- disabledTime: disabledTime
569
+ disabledTime: disabledTime,
570
+ disabledRegister: this.disabledRegister
519
571
  }, this.props.children);
520
572
  };
521
573
 
522
574
  _proto.render = function render() {
523
- var _this$props7 = this.props,
524
- range = _this$props7.range,
525
- size = _this$props7.size,
526
- disabled = _this$props7.disabled,
527
- align = _this$props7.align,
528
- innerTitle = _this$props7.innerTitle;
575
+ var _this$props9 = this.props,
576
+ range = _this$props9.range,
577
+ size = _this$props9.size,
578
+ disabled = _this$props9.disabled,
579
+ align = _this$props9.align,
580
+ innerTitle = _this$props9.innerTitle;
529
581
  var focus = this.state.focus;
530
582
  var rtl = isRTL();
531
583
  var className = datepickerClass('inner', range && 'range', size && "size-" + size, focus && 'focus', disabled === true && 'disabled', align && "align-" + align, getCurrentPosition(this.state.position), rtl && 'rtl', innerTitle && 'inner-title');
@@ -33,7 +33,9 @@ function (_PureComponent) {
33
33
  _this.handleYearMode = _this.handleModeChange.bind(_assertThisInitialized(_assertThisInitialized(_this)), 'year');
34
34
  _this.handleWeekLeave = _this.handleWeek.bind(_assertThisInitialized(_assertThisInitialized(_this)), null);
35
35
  _this.handleTimeChange = _this.handleTimeChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));
36
+ _this.handleDisabled = _this.handleDisabled.bind(_assertThisInitialized(_assertThisInitialized(_this)));
36
37
  _this.formatWithDefaultTime = _this.formatWithDefaultTime.bind(_assertThisInitialized(_assertThisInitialized(_this)));
38
+ props.disabledRegister(_this.handleDisabled, 'day');
37
39
  return _this;
38
40
  }
39
41
 
@@ -133,21 +135,16 @@ function (_PureComponent) {
133
135
  this.props.onDayHover(date);
134
136
  };
135
137
 
136
- _proto.renderDay = function renderDay(date, minD, maxD) {
138
+ _proto.handleDisabled = function handleDisabled(date, minDate, maxDate) {
137
139
  var _this$props6 = this.props,
138
- current = _this$props6.current,
139
- disabled = _this$props6.disabled,
140
- value = _this$props6.value,
141
140
  index = _this$props6.index,
142
- type = _this$props6.type,
143
- rangeDate = _this$props6.rangeDate,
141
+ disabled = _this$props6.disabled,
144
142
  range = _this$props6.range,
145
143
  rangeTemp = _this$props6.rangeTemp,
146
144
  min = _this$props6.min,
147
145
  max = _this$props6.max;
148
- var hover = this.state.hover;
149
- var hmsDate = utils.toDate(date);
150
- utils.setTime(hmsDate, current);
146
+ var minD = minDate || min && utils.toDate(utils.format(min, minStr, new Date()));
147
+ var maxD = maxDate || max && utils.toDate(utils.format(max, maxStr, new Date()));
151
148
  var isDisabled = disabled ? disabled(date) : false; // only for single, single picker don't has index
152
149
 
153
150
  if (index === undefined && !isDisabled) {
@@ -167,6 +164,20 @@ function (_PureComponent) {
167
164
  }
168
165
  }
169
166
 
167
+ return isDisabled;
168
+ };
169
+
170
+ _proto.renderDay = function renderDay(date, minD, maxD) {
171
+ var _this$props7 = this.props,
172
+ current = _this$props7.current,
173
+ value = _this$props7.value,
174
+ index = _this$props7.index,
175
+ type = _this$props7.type,
176
+ rangeDate = _this$props7.rangeDate;
177
+ var hover = this.state.hover;
178
+ var hmsDate = utils.toDate(date);
179
+ utils.setTime(hmsDate, current);
180
+ var isDisabled = this.handleDisabled(date, minD, maxD);
170
181
  var classList = [utils.isSameDay(date, this.today) && 'today', current.getMonth() !== date.getMonth() && 'other-month', isDisabled && 'disabled'];
171
182
  var hoverClass;
172
183
  var hoverProps = {};
@@ -206,10 +217,10 @@ function (_PureComponent) {
206
217
  };
207
218
 
208
219
  _proto.renderTimepicker = function renderTimepicker() {
209
- var _this$props7 = this.props,
210
- rangeDate = _this$props7.rangeDate,
211
- index = _this$props7.index,
212
- showTimePicker = _this$props7.showTimePicker;
220
+ var _this$props8 = this.props,
221
+ rangeDate = _this$props8.rangeDate,
222
+ index = _this$props8.index,
223
+ showTimePicker = _this$props8.showTimePicker;
213
224
  if (this.props.type !== 'datetime') return undefined;
214
225
  if (!showTimePicker) return undefined;
215
226
  var format = this.props.format;
@@ -239,11 +250,11 @@ function (_PureComponent) {
239
250
  _proto.render = function render() {
240
251
  var _this2 = this;
241
252
 
242
- var _this$props8 = this.props,
243
- current = _this$props8.current,
244
- min = _this$props8.min,
245
- index = _this$props8.index,
246
- max = _this$props8.max;
253
+ var _this$props9 = this.props,
254
+ current = _this$props9.current,
255
+ min = _this$props9.min,
256
+ index = _this$props9.index,
257
+ max = _this$props9.max;
247
258
  var days = this.getDays();
248
259
  this.today = utils.newDate();
249
260
  var minDate = min && utils.toDate(utils.format(min, minStr, new Date()));
@@ -318,6 +329,7 @@ Day.propTypes = {
318
329
  type: PropTypes.string.isRequired,
319
330
  value: PropTypes.object,
320
331
  defaultTime: PropTypes.array,
321
- allowSingle: PropTypes.bool
332
+ allowSingle: PropTypes.bool,
333
+ disabledRegister: PropTypes.func
322
334
  };
323
335
  export default Day;
@@ -21,6 +21,8 @@ function (_PureComponent) {
21
21
  _this.handleNextYear = _this.handleYearChange.bind(_assertThisInitialized(_assertThisInitialized(_this)), 1);
22
22
  _this.handlePrevYear = _this.handleYearChange.bind(_assertThisInitialized(_assertThisInitialized(_this)), -1);
23
23
  _this.handleYearClick = _this.handleYearClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));
24
+ _this.handleDisabled = _this.handleDisabled.bind(_assertThisInitialized(_assertThisInitialized(_this)));
25
+ props.disabledRegister(_this.handleDisabled, 'month');
24
26
  return _this;
25
27
  }
26
28
 
@@ -49,20 +51,15 @@ function (_PureComponent) {
49
51
  if (!isMonthType) onModeChange('day');
50
52
  };
51
53
 
52
- _proto.renderMonth = function renderMonth(m, i) {
54
+ _proto.handleDisabled = function handleDisabled(date) {
53
55
  var _this$props3 = this.props,
54
- value = _this$props3.value,
55
56
  min = _this$props3.min,
56
57
  disabled = _this$props3.disabled,
57
58
  range = _this$props3.range,
58
59
  type = _this$props3.type,
59
- current = _this$props3.current,
60
60
  index = _this$props3.index,
61
61
  rangeDate = _this$props3.rangeDate,
62
62
  max = _this$props3.max;
63
- var date = utils.toDate(MONTHBASE);
64
- date.setMonth(i);
65
- date.setFullYear(current.getFullYear());
66
63
  var isDisabled = min && utils.compareMonth(min, date, 1) >= 0;
67
64
 
68
65
  if (!isDisabled) {
@@ -85,6 +82,17 @@ function (_PureComponent) {
85
82
  }
86
83
  }
87
84
 
85
+ return isDisabled;
86
+ };
87
+
88
+ _proto.renderMonth = function renderMonth(m, i) {
89
+ var _this$props4 = this.props,
90
+ value = _this$props4.value,
91
+ current = _this$props4.current;
92
+ var date = utils.toDate(MONTHBASE);
93
+ date.setMonth(i);
94
+ date.setFullYear(current.getFullYear());
95
+ var isDisabled = this.handleDisabled(date);
88
96
  var className = datepickerClass(utils.isSameMonth(value, date) && 'active', isDisabled && 'disabled');
89
97
  return React.createElement("span", {
90
98
  key: i,
@@ -130,6 +138,7 @@ Month.propTypes = {
130
138
  type: PropTypes.string.isRequired,
131
139
  value: PropTypes.object,
132
140
  index: PropTypes.number,
133
- rangeDate: PropTypes.array
141
+ rangeDate: PropTypes.array,
142
+ disabledRegister: PropTypes.func
134
143
  };
135
144
  export default Month;
@@ -100,6 +100,7 @@ function (_PureComponent) {
100
100
  step = _this$props2.step,
101
101
  ampm = _this$props2.ampm;
102
102
  var value = Math.round(this.element.scrollTop / lineHeight);
103
+ if (value * step === this.props.value) return;
103
104
 
104
105
  if (typeof step === 'number' && step > 0 && !ampm && value !== this.props.value) {
105
106
  this.props.onChange(value * step);
@@ -35,11 +35,40 @@ function handleTimeDisabled(date, disabledTime) {
35
35
  return undefined;
36
36
  }
37
37
 
38
- function judgeTimeByRange() {
38
+ function handleDisabled() {
39
39
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
40
40
  args[_key] = arguments[_key];
41
41
  }
42
42
 
43
+ var date = args[0],
44
+ min = args[1],
45
+ max = args[2],
46
+ range = args[3],
47
+ disabled = args[4],
48
+ disabledTime = args[5];
49
+ var isDisabled;
50
+ if (disabled) isDisabled = disabled(date);
51
+ if (disabledTime) isDisabled = isDisabled || handleTimeDisabled(date, disabledTime);
52
+ if (isDisabled) return true;
53
+
54
+ if (!isDisabled && min) {
55
+ if (compareAsc(date, min) < 0) return true;
56
+ if (range && compareAsc(date, addSeconds(min, range)) > 0) return true;
57
+ }
58
+
59
+ if (!isDisabled && max) {
60
+ if (compareAsc(date, max) > 0) return true;
61
+ if (range && compareAsc(date, addSeconds(max, -range)) < 0) return true;
62
+ }
63
+
64
+ return false;
65
+ }
66
+
67
+ function judgeTimeByRange() {
68
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
69
+ args[_key2] = arguments[_key2];
70
+ }
71
+
43
72
  var target = args[0],
44
73
  value = args[1],
45
74
  mode = args[2],
@@ -75,7 +104,7 @@ function judgeTimeByRange() {
75
104
  break;
76
105
 
77
106
  case 'ampm':
78
- if (target === 0) {
107
+ {
79
108
  var hours = date.getHours();
80
109
 
81
110
  if (target === 1 && hours < 12) {
@@ -84,29 +113,14 @@ function judgeTimeByRange() {
84
113
  date.setHours(hours - 12);
85
114
  }
86
115
  }
87
-
88
116
  break;
89
117
 
90
118
  default:
91
119
  break;
92
120
  }
93
121
 
94
- var isDisabled;
95
- if (disabled) isDisabled = disabled(date);
96
- if (disabledTime) isDisabled = isDisabled || handleTimeDisabled(date, disabledTime);
97
- if (isDisabled) return [true];
98
-
99
- if (!isDisabled && min) {
100
- if (compareAsc(date, min) < 0) return [true];
101
- if (range && compareAsc(date, addSeconds(min, range)) > 0) return [true];
102
- }
103
-
104
- if (!isDisabled && max) {
105
- if (compareAsc(date, max) > 0) return [true];
106
- if (range && compareAsc(date, addSeconds(max, -range)) < 0) return [true];
107
- }
108
-
109
- return [false, date];
122
+ var isDisabled = handleDisabled(date, min, max, range, disabled, disabledTime);
123
+ return [isDisabled, date];
110
124
  }
111
125
 
112
126
  export default {
@@ -117,5 +131,7 @@ export default {
117
131
  timeHandleChangeParams: timeHandleChangeParams,
118
132
  quickHandleChangeParams: quickHandleChangeParams,
119
133
  weekHandleChangeParams: weekHandleChangeParams,
120
- judgeTimeByRange: judgeTimeByRange
134
+ judgeTimeByRange: judgeTimeByRange,
135
+ handleTimeDisabled: handleTimeDisabled,
136
+ handleDisabled: handleDisabled
121
137
  };
@@ -63,6 +63,7 @@ function (_PureComponent) {
63
63
  passive: false
64
64
  });
65
65
  this.inner.addEventListener('scroll', this.handleInnerScroll);
66
+ this.wheelElement.addEventListener('scroll', this.handleInnerScroll);
66
67
  };
67
68
 
68
69
  _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
@@ -80,6 +81,7 @@ function (_PureComponent) {
80
81
  this.wheelElement.removeEventListener('touchstart', this.handleTouchStart);
81
82
  this.wheelElement.removeEventListener('touchmove', this.handleTouchMove);
82
83
  this.inner.removeEventListener('scroll', this.handleInnerScroll);
84
+ this.wheelElement.removeEventListener('scroll', this.handleInnerScroll);
83
85
  };
84
86
 
85
87
  _proto.getWheelRect = function getWheelRect() {
@@ -259,20 +261,31 @@ function (_PureComponent) {
259
261
 
260
262
  this.setStartPoint(position);
261
263
  this.boundleScroll();
262
- } // inner scroll
264
+ } // handle inner scroll cased by input focus
263
265
  ;
264
266
 
265
267
  _proto.handleInnerScroll = function handleInnerScroll(e) {
266
268
  var target = e.target;
267
269
  var _this$props6 = this.props,
268
270
  left = _this$props6.left,
269
- scrollWidth = _this$props6.scrollWidth;
271
+ scrollWidth = _this$props6.scrollWidth,
272
+ top = _this$props6.top,
273
+ scrollHeight = _this$props6.scrollHeight;
270
274
 
271
275
  var _this$getWheelRect2 = this.getWheelRect(),
272
- width = _this$getWheelRect2.width;
273
-
274
- if (target.scrollLeft) {
275
- this.handleScroll(left + target.scrollLeft / (scrollWidth - width), this.props.top, undefined, 0);
276
+ width = _this$getWheelRect2.width,
277
+ height = _this$getWheelRect2.height;
278
+
279
+ if (target.scrollLeft || target.scrollTop) {
280
+ var sLeft = target.scrollLeft ? left + target.scrollLeft / (scrollWidth - width) : left;
281
+ var sTop = target.scrollTop ? top + target.scrollTop / (scrollHeight - height) : top;
282
+ sTop = Math.min(1, sTop);
283
+ sTop = Math.max(0, sTop);
284
+ sLeft = Math.min(1, sLeft);
285
+ sLeft = Math.max(0, sLeft);
286
+ this.handleScroll(sLeft, sTop, undefined, undefined, {
287
+ drag: true
288
+ });
276
289
  target.scrollLeft = 0;
277
290
  target.scrollTop = 0;
278
291
  }
@@ -42,7 +42,8 @@ export default function datum(Origin) {
42
42
 
43
43
  _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
44
44
  if (!shallowEqual(prevProps.data, this.props.data)) {
45
- this.datum.updateDisabled(this.props.disabled);
45
+ var disabled = this.props.disabled;
46
+ this.datum.updateDisabled(typeof disabled === 'function' ? disabled : undefined);
46
47
  this.datum.setData(this.props.data, true);
47
48
  this.forceUpdate();
48
49
  }
package/es/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // Created by scripts/src-index.js.
2
2
  import * as utils from './utils'
3
3
 
4
- export default { utils, version: '1.10.12' }
4
+ export default { utils, version: '1.10.13' }
5
5
  export { utils }
6
6
  export { setLocale } from './locale'
7
7
  export { color, style } from './utils/expose'
package/es/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import * as utils from './utils';
3
3
  export default {
4
4
  utils: utils,
5
- version: '1.10.12'
5
+ version: '1.10.13'
6
6
  };
7
7
  export { utils };
8
8
  export { setLocale } from './locale';
@@ -209,6 +209,7 @@ function (_PureComponent) {
209
209
  } else {
210
210
  var v = value[value.length - 1];
211
211
  var data = this.datum.getDataById(v);
212
+ if (data === null) return;
212
213
 
213
214
  try {
214
215
  var id = this.datum.getKey(data);
@@ -371,7 +372,6 @@ function (_PureComponent) {
371
372
  onItemClick = _this$props7.onItemClick,
372
373
  expandTrigger = _this$props7.expandTrigger,
373
374
  childrenKey = _this$props7.childrenKey,
374
- absolute = _this$props7.absolute,
375
375
  height = _this$props7.height;
376
376
  var path = this.state.path;
377
377
  var props = {
@@ -339,7 +339,7 @@ function (_PureComponent) {
339
339
 
340
340
  var items = this.handleNode(nodes, render);
341
341
 
342
- if (compressed) {
342
+ if (compressed && items.length) {
343
343
  items = this.renderMore(items);
344
344
  }
345
345