shineout 1.9.4 → 1.9.7

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.
Files changed (182) hide show
  1. package/css/Alert/styles/index.js +2 -0
  2. package/css/AnimationList/styles/index.js +2 -0
  3. package/css/Breadcrumb/styles/index.js +2 -0
  4. package/css/Button/styles/index.js +2 -0
  5. package/css/Card/Card.js +3 -1
  6. package/css/Card/styles/index.js +2 -0
  7. package/css/CardGroup/styles/index.js +2 -0
  8. package/css/Carousel/styles/index.js +2 -0
  9. package/css/Cascader/Cascader.js +10 -5
  10. package/css/Cascader/Result.js +24 -16
  11. package/css/Cascader/styles/index.js +2 -0
  12. package/css/Checkbox/styles/index.js +2 -0
  13. package/css/DataList/styles/index.js +2 -0
  14. package/css/DatePicker/index.d.ts +8 -1
  15. package/css/DatePicker/styles/index.js +2 -0
  16. package/css/Divider/styles/index.js +2 -0
  17. package/css/Dropdown/styles/index.js +2 -0
  18. package/css/EditableArea/styles/index.js +2 -0
  19. package/css/Form/styles/index.js +2 -0
  20. package/css/Gap/styles/index.js +2 -0
  21. package/css/Icon/styles/index.js +2 -0
  22. package/css/Image/styles/index.js +2 -0
  23. package/css/Input/styles/index.js +2 -0
  24. package/css/Lazyload/styles/index.js +2 -0
  25. package/css/Menu/styles/index.js +2 -0
  26. package/css/Message/styles/index.js +5 -0
  27. package/css/Modal/styles/index.js +2 -0
  28. package/css/Pagination/styles/index.js +2 -0
  29. package/css/Popover/styles/index.js +2 -0
  30. package/css/Progress/styles/index.js +2 -0
  31. package/css/Radio/styles/index.js +2 -0
  32. package/css/Rate/styles/index.js +2 -0
  33. package/css/Rule/index.d.ts +1 -1
  34. package/css/Rule/styles/index.js +2 -0
  35. package/css/Scroll/styles/index.js +2 -0
  36. package/css/Select/More.js +13 -4
  37. package/css/Select/Result.js +36 -10
  38. package/css/Select/styles/index.js +2 -0
  39. package/css/Slider/styles/index.js +2 -0
  40. package/css/Spin/styles/index.js +2 -0
  41. package/css/Sticky/styles/index.js +2 -0
  42. package/css/Table/index.d.ts +2 -2
  43. package/css/Table/styles/index.js +2 -0
  44. package/css/Tabs/styles/index.js +2 -0
  45. package/css/Tag/styles/index.js +2 -0
  46. package/css/Tooltip/styles/index.js +2 -0
  47. package/css/Transfer/styles/index.js +2 -0
  48. package/css/Tree/Checkbox.js +1 -1
  49. package/css/Tree/Content.js +1 -1
  50. package/css/Tree/List.js +1 -1
  51. package/css/Tree/styles/index.js +2 -0
  52. package/css/TreeSelect/Result.js +36 -10
  53. package/css/TreeSelect/styles/index.js +2 -0
  54. package/css/TreeSelect/styles/treeSelect.css +6 -6
  55. package/css/Upload/styles/index.js +2 -0
  56. package/css/hoc/styles/index.js +2 -0
  57. package/css/index.d.ts +1 -3
  58. package/css/index.js +1 -4
  59. package/dist/shineout.js +222 -105
  60. package/dist/shineout.js.map +1 -1
  61. package/dist/shineout.min.js +1 -1
  62. package/dist/theme.antd.css +3 -1
  63. package/dist/theme.antd2.css +3 -1
  64. package/dist/theme.default.css +3 -1
  65. package/dist/theme.shineout.css +3 -1
  66. package/es/Alert/styles/index.js +1 -0
  67. package/es/AnimationList/styles/index.js +1 -0
  68. package/es/Breadcrumb/styles/index.js +1 -0
  69. package/es/Button/styles/index.js +1 -0
  70. package/es/Card/Card.js +2 -1
  71. package/es/Card/styles/index.js +1 -0
  72. package/es/CardGroup/styles/index.js +1 -0
  73. package/es/Carousel/styles/index.js +1 -0
  74. package/es/Cascader/Cascader.js +10 -5
  75. package/es/Cascader/Result.js +24 -16
  76. package/es/Cascader/styles/index.js +1 -0
  77. package/es/Checkbox/styles/index.js +1 -0
  78. package/es/DataList/styles/index.js +1 -0
  79. package/es/DatePicker/index.d.ts +8 -1
  80. package/es/DatePicker/styles/index.js +1 -0
  81. package/es/Divider/styles/index.js +1 -0
  82. package/es/Dropdown/styles/index.js +1 -0
  83. package/es/EditableArea/styles/index.js +1 -0
  84. package/es/Form/styles/index.js +1 -0
  85. package/es/Gap/styles/index.js +1 -0
  86. package/es/Icon/styles/index.js +1 -0
  87. package/es/Image/styles/index.js +1 -0
  88. package/es/Input/styles/index.js +1 -0
  89. package/es/Lazyload/styles/index.js +1 -0
  90. package/es/Menu/styles/index.js +1 -0
  91. package/es/Message/styles/index.js +3 -0
  92. package/es/Modal/styles/index.js +1 -0
  93. package/es/Pagination/styles/index.js +1 -0
  94. package/es/Popover/styles/index.js +1 -0
  95. package/es/Progress/styles/index.js +1 -0
  96. package/es/Radio/styles/index.js +1 -0
  97. package/es/Rate/styles/index.js +1 -0
  98. package/es/Rule/index.d.ts +1 -1
  99. package/es/Rule/styles/index.js +1 -0
  100. package/es/Scroll/styles/index.js +1 -0
  101. package/es/Select/More.js +14 -5
  102. package/es/Select/Result.js +36 -10
  103. package/es/Select/styles/index.js +1 -0
  104. package/es/Slider/styles/index.js +1 -0
  105. package/es/Spin/styles/index.js +1 -0
  106. package/es/Sticky/styles/index.js +1 -0
  107. package/es/Table/index.d.ts +2 -2
  108. package/es/Table/styles/index.js +1 -0
  109. package/es/Tabs/styles/index.js +1 -0
  110. package/es/Tag/styles/index.js +1 -0
  111. package/es/Tooltip/styles/index.js +1 -0
  112. package/es/Transfer/styles/index.js +1 -0
  113. package/es/Tree/Checkbox.js +1 -1
  114. package/es/Tree/Content.js +1 -1
  115. package/es/Tree/List.js +1 -1
  116. package/es/Tree/styles/index.js +1 -0
  117. package/es/TreeSelect/Result.js +36 -10
  118. package/es/TreeSelect/styles/index.js +1 -0
  119. package/es/TreeSelect/styles/treeSelect.less +2 -2
  120. package/es/Upload/styles/index.js +1 -0
  121. package/es/hoc/styles/index.js +1 -0
  122. package/es/index.d.ts +1 -3
  123. package/es/index.js +1 -4
  124. package/lib/Alert/styles/index.js +2 -0
  125. package/lib/AnimationList/styles/index.js +2 -0
  126. package/lib/Breadcrumb/styles/index.js +2 -0
  127. package/lib/Button/styles/index.js +2 -0
  128. package/lib/Card/Card.js +3 -1
  129. package/lib/Card/styles/index.js +2 -0
  130. package/lib/CardGroup/styles/index.js +2 -0
  131. package/lib/Carousel/styles/index.js +2 -0
  132. package/lib/Cascader/Cascader.js +10 -5
  133. package/lib/Cascader/Result.js +24 -16
  134. package/lib/Cascader/styles/index.js +2 -0
  135. package/lib/Checkbox/styles/index.js +2 -0
  136. package/lib/DataList/styles/index.js +2 -0
  137. package/lib/DatePicker/index.d.ts +8 -1
  138. package/lib/DatePicker/styles/index.js +2 -0
  139. package/lib/Divider/styles/index.js +2 -0
  140. package/lib/Dropdown/styles/index.js +2 -0
  141. package/lib/EditableArea/styles/index.js +2 -0
  142. package/lib/Form/styles/index.js +2 -0
  143. package/lib/Gap/styles/index.js +2 -0
  144. package/lib/Icon/styles/index.js +2 -0
  145. package/lib/Image/styles/index.js +2 -0
  146. package/lib/Input/styles/index.js +2 -0
  147. package/lib/Lazyload/styles/index.js +2 -0
  148. package/lib/Menu/styles/index.js +2 -0
  149. package/lib/Message/styles/index.js +5 -0
  150. package/lib/Modal/styles/index.js +2 -0
  151. package/lib/Pagination/styles/index.js +2 -0
  152. package/lib/Popover/styles/index.js +2 -0
  153. package/lib/Progress/styles/index.js +2 -0
  154. package/lib/Radio/styles/index.js +2 -0
  155. package/lib/Rate/styles/index.js +2 -0
  156. package/lib/Rule/index.d.ts +1 -1
  157. package/lib/Rule/styles/index.js +2 -0
  158. package/lib/Scroll/styles/index.js +2 -0
  159. package/lib/Select/More.js +13 -4
  160. package/lib/Select/Result.js +36 -10
  161. package/lib/Select/styles/index.js +2 -0
  162. package/lib/Slider/styles/index.js +2 -0
  163. package/lib/Spin/styles/index.js +2 -0
  164. package/lib/Sticky/styles/index.js +2 -0
  165. package/lib/Table/index.d.ts +2 -2
  166. package/lib/Table/styles/index.js +2 -0
  167. package/lib/Tabs/styles/index.js +2 -0
  168. package/lib/Tag/styles/index.js +2 -0
  169. package/lib/Tooltip/styles/index.js +2 -0
  170. package/lib/Transfer/styles/index.js +2 -0
  171. package/lib/Tree/Checkbox.js +1 -1
  172. package/lib/Tree/Content.js +1 -1
  173. package/lib/Tree/List.js +1 -1
  174. package/lib/Tree/styles/index.js +2 -0
  175. package/lib/TreeSelect/Result.js +36 -10
  176. package/lib/TreeSelect/styles/index.js +2 -0
  177. package/lib/TreeSelect/styles/treeSelect.less +2 -2
  178. package/lib/Upload/styles/index.js +2 -0
  179. package/lib/hoc/styles/index.js +2 -0
  180. package/lib/index.d.ts +1 -3
  181. package/lib/index.js +1 -4
  182. package/package.json +1 -1
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import genaration from '../../utils/classname';
2
3
  import alertLess from './alert.less';
3
4
  export var alertClass = genaration(alertLess, 'alert');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import genaration from '../../utils/classname';
2
3
  import listLess from './list.less';
3
4
  export var listClass = genaration(listLess, 'list');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import breadcrumbLess from './breadcrumb.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var breadcrumbClass = genaration(breadcrumbLess, 'breadcrumb');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import buttonLess from './button.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var buttonClass = genaration(buttonLess, 'button');
package/es/Card/Card.js CHANGED
@@ -11,6 +11,7 @@ import { Provider } from './context';
11
11
  import { compose } from '../utils/func';
12
12
  import resizable from '../hoc/resizable';
13
13
  import moveable from '../hoc/moveable';
14
+ import { modalClass } from '../Modal/styles';
14
15
 
15
16
  var Card =
16
17
  /*#__PURE__*/
@@ -101,4 +102,4 @@ Card.defaultProps = _objectSpread({}, defaultProps, {
101
102
  defaultCollapsed: true,
102
103
  collapsible: false
103
104
  });
104
- export default compose(moveable("." + cardClass('header')), resizable)(Card);
105
+ export default compose(moveable("." + cardClass('header') + ", ." + modalClass('method-title')), resizable)(Card);
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import cardLess from './card.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var cardClass = genaration(cardLess, 'card');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import cardGroupLess from './cardGroup.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var cardGroupClass = genaration(cardGroupLess, 'card-group');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import carouselLess from './carousel.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var carouselClass = genaration(carouselLess, 'carousel');
@@ -183,13 +183,18 @@ function (_PureComponent) {
183
183
  } else {
184
184
  var v = value[value.length - 1];
185
185
  var data = this.datum.getDataById(v);
186
- var id = this.datum.getKey(data);
187
186
 
188
- var _ref2 = this.datum.getPath(id) || {},
189
- path = _ref2.path;
187
+ try {
188
+ var id = this.datum.getKey(data);
190
189
 
191
- path = path || [];
192
- this.handlePathChange(id, null, path);
190
+ var _ref2 = this.datum.getPath(id) || {},
191
+ path = _ref2.path;
192
+
193
+ path = path || [];
194
+ this.handlePathChange(id, null, path);
195
+ } catch (e) {
196
+ console.error(e);
197
+ }
193
198
  }
194
199
  };
195
200
 
@@ -77,21 +77,7 @@ function (_PureComponent) {
77
77
  };
78
78
 
79
79
  _proto.componentDidUpdate = function componentDidUpdate(preProps) {
80
- var _this$props = this.props,
81
- compressed = _this$props.compressed,
82
- _this$props$value = _this$props.value,
83
- value = _this$props$value === void 0 ? [] : _this$props$value,
84
- onFilter = _this$props.onFilter;
85
-
86
- if (compressed) {
87
- if ((preProps.value || []).join('') !== (value || []).join('')) {
88
- this.resetMore();
89
- } else if (value.length && this.shouldResetMore) {
90
- this.shouldResetMore = false;
91
- this.state.more = getResetMore(onFilter, this.resultEl, this.resultEl.querySelectorAll("." + cascaderClass('item')));
92
- this.forceUpdate();
93
- }
94
- }
80
+ this.updateMore(preProps);
95
81
  };
96
82
 
97
83
  _proto.componentWillUnmount = function componentWillUnmount() {
@@ -108,6 +94,27 @@ function (_PureComponent) {
108
94
  this.resultEl = el;
109
95
  };
110
96
 
97
+ _proto.updateMore = function updateMore(preProps) {
98
+ var _this$props = this.props,
99
+ compressed = _this$props.compressed,
100
+ _this$props$value = _this$props.value,
101
+ value = _this$props$value === void 0 ? [] : _this$props$value,
102
+ onFilter = _this$props.onFilter,
103
+ data = _this$props.data;
104
+
105
+ if (compressed) {
106
+ if ((preProps.value || []).join('') !== (value || []).join('')) {
107
+ this.resetMore();
108
+ } else if ((preProps.data || []).length !== (data || []).length) {
109
+ this.resetMore();
110
+ } else if (value.length && this.shouldResetMore) {
111
+ this.shouldResetMore = false;
112
+ this.state.more = getResetMore(onFilter, this.resultEl, this.resultEl.querySelectorAll("." + cascaderClass('item')));
113
+ this.forceUpdate();
114
+ }
115
+ }
116
+ };
117
+
111
118
  _proto.resetMore = function resetMore() {
112
119
  if (!this.props.compressed) return;
113
120
  this.shouldResetMore = true;
@@ -361,7 +368,8 @@ Result.propTypes = {
361
368
  selectId: PropTypes.string,
362
369
  showList: PropTypes.func,
363
370
  size: PropTypes.string,
364
- showArrow: PropTypes.bool
371
+ showArrow: PropTypes.bool,
372
+ data: PropTypes.array
365
373
  };
366
374
  Result.defaultProps = {
367
375
  value: []
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import cascaderLess from './cascader.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var cascaderClass = genaration(cascaderLess, 'cascader');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import checkinputLess from './checkinput.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var checkinputClass = genaration(checkinputLess, 'checkinput');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import genaration from '../../utils/classname';
2
3
  import listLess from './list.less';
3
4
  export var listClass = genaration(listLess, 'list');
@@ -263,7 +263,14 @@ export interface DatePickerProps<T =DatePickerValue > extends StandardProps,
263
263
  * default: -
264
264
  */
265
265
  innerTitle?: ReactNode;
266
- name: string | string[]
266
+ /**
267
+ * The name of a Form that accesses data
268
+ *
269
+ * Form 存取数据的名称
270
+ *
271
+ * default: -
272
+ */
273
+ name?: string | string[]
267
274
  }
268
275
 
269
276
  declare class DatePicker extends React.Component<DatePickerProps, {}> {
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import datepickerLess from './datepicker.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var datepickerClass = genaration(datepickerLess, 'datepicker');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import dividerLess from './divider.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var dividerClass = genaration(dividerLess, 'divider');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import dropdownLess from './dropdown.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var dropdownClass = genaration(dropdownLess, 'dropdown');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import editableAreaLess from './editableArea.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var editableAreaClass = genaration(editableAreaLess, 'editableArea');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import formLess from './form.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var formClass = genaration(formLess, 'form');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import GapLess from './gap.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var gapClass = genaration(GapLess, 'gap');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import iconLess from './icon.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var iconClass = genaration(iconLess, 'icon');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import imageLess from './image.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var imageClass = genaration(imageLess, 'image');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import inputLess from '../../Form/styles/form.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var inputClass = genaration(inputLess, 'input');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import lazyloadLess from './lazyload.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var lazyloadClass = genaration(lazyloadLess, 'lazyload');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import menuLess from './menu.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var menuClass = genaration(menuLess, 'menu');
@@ -1,3 +1,6 @@
1
+ import '../../styles/normalize.less'; // rely Alert
2
+
3
+ import '../../Alert/styles/alert.less';
1
4
  import messageLess from './message.less';
2
5
  import genaration from '../../utils/classname';
3
6
  export var messageClass = genaration(messageLess, 'message');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import modalLess from './modal.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var modalClass = genaration(modalLess, 'modal');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import paginationLess from './pagination.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var paginationClass = genaration(paginationLess, 'pagination');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import popoverLess from './popover.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var popoverClass = genaration(popoverLess, 'popover');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import progressLess from './progress.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var progressClass = genaration(progressLess, 'progress');
@@ -1 +1,2 @@
1
+ import '../../styles/normalize.less';
1
2
  import genaration from '../../utils/classname';
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import rateLess from './rate.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var rateClass = genaration(rateLess, 'rate');
@@ -62,7 +62,7 @@ export interface RuleResult {
62
62
 
63
63
  range(min?: number, max?: number, message?: string): Range;
64
64
 
65
- regExp(reg?: RegExp | string): RegExpParams;
65
+ regExp(reg?: RegExp | string, message?: string): RegExpParams;
66
66
 
67
67
  email(message?: string): Type;
68
68
 
@@ -1 +1,2 @@
1
+ import '../../styles/normalize.less';
1
2
  import genaration from '../../utils/classname';
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import scrollLess from './scroll.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var scrollClass = genaration(scrollLess, 'scroll');
package/es/Select/More.js CHANGED
@@ -4,7 +4,8 @@ import React, { Component } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import classnames from 'classnames';
6
6
  import { parsePxToNumber } from '../utils/dom/element';
7
- import Popover from '../Popover';
7
+ import Popover from '../Popover'; // if num = -1 display all else display num
8
+
8
9
  export function getResetMore(onFilter, container, doms) {
9
10
  if (!container || !doms || !doms.length) return -1;
10
11
  var items = Array.from(doms);
@@ -34,10 +35,18 @@ export function getResetMore(onFilter, container, doms) {
34
35
  for (var i = 0; i < itemWidthArr.length; i++) {
35
36
  var itemLen = itemWidthArr[i]; // number length
36
37
 
37
- var reset = "+" + (items.length - 1 - i);
38
- hideEl.childNodes[0].innerText = reset; // (+num) width
38
+ var resetNum = items.length - 1 - i;
39
+ var moreWidth = void 0;
40
+
41
+ if (resetNum <= 0) {
42
+ moreWidth = 0;
43
+ } else {
44
+ var reset = "+" + resetNum;
45
+ hideEl.childNodes[0].innerText = reset; // (+num) width
46
+
47
+ moreWidth = hideEl.offsetWidth + hideMargin;
48
+ }
39
49
 
40
- var moreWidth = hideEl.offsetWidth + hideMargin;
41
50
  len += itemLen;
42
51
 
43
52
  if (len > contentWidth - moreWidth) {
@@ -97,7 +106,7 @@ function (_Component) {
97
106
  cls = _this$props.cls,
98
107
  showNum = _this$props.showNum;
99
108
  var status = this.state.status;
100
- if (showNum < 0 || showNum > data.length) return React.createElement(React.Fragment, null, data, React.createElement("a", {
109
+ if (showNum < 0 || showNum >= data.length) return React.createElement(React.Fragment, null, data, React.createElement("a", {
101
110
  key: "hidden",
102
111
  className: className,
103
112
  style: {
@@ -99,13 +99,47 @@ function (_PureComponent) {
99
99
  };
100
100
 
101
101
  _proto.componentDidUpdate = function componentDidUpdate(preProps) {
102
+ this.updateMore(preProps);
103
+ };
104
+
105
+ _proto.componentWillUnmount = function componentWillUnmount() {
106
+ if (this.cancelResizeObserver) this.cancelResizeObserver();
107
+ };
108
+
109
+ _proto.bindResult = function bindResult(el) {
110
+ this.resultEl = el;
111
+ };
112
+
113
+ _proto.updateMore = function updateMore(preProps) {
102
114
  var _this$props = this.props,
103
115
  result = _this$props.result,
104
116
  compressed = _this$props.compressed,
105
- onFilter = _this$props.onFilter;
117
+ onFilter = _this$props.onFilter,
118
+ renderResult = _this$props.renderResult,
119
+ renderUnmatched = _this$props.renderUnmatched;
106
120
 
107
121
  if (compressed) {
108
- if ((preProps.result || []).join('') !== (result || []).join('')) {
122
+ var shouldRest = false;
123
+
124
+ if (preProps.result.length !== result.length) {
125
+ shouldRest = true;
126
+ } else {
127
+ var i = preProps.result.length - 1;
128
+
129
+ while (i >= 0) {
130
+ var before = getResultContent(preProps.result[i], preProps.renderResult, preProps.renderUnmatched);
131
+ var now = getResultContent(result[i], renderResult, renderUnmatched);
132
+
133
+ if (before !== now) {
134
+ shouldRest = true;
135
+ break;
136
+ }
137
+
138
+ i -= 1;
139
+ }
140
+ }
141
+
142
+ if (shouldRest) {
109
143
  this.resetMore();
110
144
  } else if (result.length && this.shouldResetMore) {
111
145
  this.shouldResetMore = false;
@@ -115,14 +149,6 @@ function (_PureComponent) {
115
149
  }
116
150
  };
117
151
 
118
- _proto.componentWillUnmount = function componentWillUnmount() {
119
- if (this.cancelResizeObserver) this.cancelResizeObserver();
120
- };
121
-
122
- _proto.bindResult = function bindResult(el) {
123
- this.resultEl = el;
124
- };
125
-
126
152
  _proto.resetMore = function resetMore() {
127
153
  if (!this.props.compressed) return;
128
154
  this.shouldResetMore = true;
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import selectLess from './select.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var selectClass = genaration(selectLess, 'select');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import sliderLess from './slider.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var sliderClass = genaration(sliderLess, 'slider');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import spinLess from './spin.less';
2
3
  import genaration from '../../utils/classname';
3
4
  import defaultLess from './default.less';
@@ -1 +1,2 @@
1
+ import '../../styles/normalize.less';
1
2
  import genaration from '../../utils/classname';
@@ -124,7 +124,7 @@ export interface ColumnItem<T> {
124
124
  *
125
125
  * default: none
126
126
  */
127
- sorter?: ((order: ColumnOrder) => (prevRowData: T, nextRowData: T) => boolean) | string;
127
+ sorter?: ((order: ColumnOrder) => (prevRowData: T, nextRowData: T) => number) | string;
128
128
 
129
129
  /**
130
130
  * The content of the header
@@ -552,7 +552,7 @@ export interface TableProps<Value, TRD> extends StandardProps, ListItemStandardP
552
552
  * default: false
553
553
  */
554
554
  changedByExpand?: boolean
555
-
555
+
556
556
  /*
557
557
  * customize sort icons
558
558
  *
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import tableLess from './table.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var tableClass = genaration(tableLess, 'table');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import tabsLess from './tabs.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var tabsClass = genaration(tabsLess, 'tabs');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import tagLess from './tag.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var tagClass = genaration(tagLess, 'tag');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import tooltipLess from './tooltip.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var tooltipClass = genaration(tooltipLess, 'tooltip');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import transferLess from './transfer.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var transferClass = genaration(transferLess, 'transfer');
@@ -77,7 +77,7 @@ function (_PureComponent) {
77
77
  _defineProperty(_default, "propTypes", {
78
78
  datum: PropTypes.object.isRequired,
79
79
  disabled: PropTypes.bool,
80
- id: PropTypes.string.isRequired,
80
+ id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
81
81
  onChange: PropTypes.func.isRequired
82
82
  });
83
83
 
@@ -144,7 +144,7 @@ Content.propTypes = {
144
144
  draggable: PropTypes.bool,
145
145
  expanded: PropTypes.bool,
146
146
  loader: PropTypes.func,
147
- id: PropTypes.any,
147
+ id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
148
148
  onChange: PropTypes.func,
149
149
  onToggle: PropTypes.func,
150
150
  onDragOver: PropTypes.func,
package/es/Tree/List.js CHANGED
@@ -90,7 +90,7 @@ List.propTypes = {
90
90
  className: PropTypes.string,
91
91
  data: PropTypes.array,
92
92
  expanded: PropTypes.bool,
93
- id: PropTypes.any,
93
+ id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
94
94
  isRoot: PropTypes.bool,
95
95
  keygen: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).isRequired,
96
96
  line: PropTypes.bool,
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import treeLess from './tree.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var treeClass = genaration(treeLess, 'tree');
@@ -76,13 +76,47 @@ function (_PureComponent) {
76
76
  };
77
77
 
78
78
  _proto.componentDidUpdate = function componentDidUpdate(preProps) {
79
+ this.updateMore(preProps);
80
+ };
81
+
82
+ _proto.componentWillUnmount = function componentWillUnmount() {
83
+ if (this.cancelResizeObserver) this.cancelResizeObserver();
84
+ };
85
+
86
+ _proto.bindResult = function bindResult(el) {
87
+ this.resultEl = el;
88
+ };
89
+
90
+ _proto.updateMore = function updateMore(preProps) {
79
91
  var _this$props = this.props,
80
92
  result = _this$props.result,
81
93
  compressed = _this$props.compressed,
82
- onFilter = _this$props.onFilter;
94
+ onFilter = _this$props.onFilter,
95
+ renderResult = _this$props.renderResult,
96
+ renderUnmatched = _this$props.renderUnmatched;
83
97
 
84
98
  if (compressed) {
85
- if ((preProps.result || []).join('') !== (result || []).join('')) {
99
+ var shouldRest = false;
100
+
101
+ if (preProps.result.length !== result.length) {
102
+ shouldRest = true;
103
+ } else {
104
+ var i = preProps.result.length - 1;
105
+
106
+ while (i >= 0) {
107
+ var before = getResultContent(preProps.result[i], preProps.renderResult, preProps.renderUnmatched);
108
+ var now = getResultContent(result[i], renderResult, renderUnmatched);
109
+
110
+ if (before !== now) {
111
+ shouldRest = true;
112
+ break;
113
+ }
114
+
115
+ i -= 1;
116
+ }
117
+ }
118
+
119
+ if (shouldRest) {
86
120
  this.resetMore();
87
121
  } else if (result.length && this.shouldResetMore) {
88
122
  this.shouldResetMore = false;
@@ -92,14 +126,6 @@ function (_PureComponent) {
92
126
  }
93
127
  };
94
128
 
95
- _proto.componentWillUnmount = function componentWillUnmount() {
96
- if (this.cancelResizeObserver) this.cancelResizeObserver();
97
- };
98
-
99
- _proto.bindResult = function bindResult(el) {
100
- this.resultEl = el;
101
- };
102
-
103
129
  _proto.resetMore = function resetMore() {
104
130
  if (!this.props.compressed) return;
105
131
  this.shouldResetMore = true;
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import treeSelectLess from './treeSelect.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var treeSelectClass = genaration(treeSelectLess, 'treeSelect');
@@ -520,7 +520,7 @@
520
520
  padding-right: (@padding-base-horizontal / 2);
521
521
  padding-left: @padding-base-horizontal + 22;
522
522
  }
523
- a.@{treeSelect-prefix}-close-wrapper {
523
+ .@{treeSelect-prefix}-close-warpper {
524
524
  right: 17px;
525
525
  .@{input-prefix}-rtl & ,@{treeSelect-prefix}-rtl & {
526
526
  left: 17px;
@@ -536,7 +536,7 @@
536
536
  padding-right: (@padding-base-horizontal / 2);
537
537
  padding-left: @padding-base-horizontal + 12;
538
538
  }
539
- a.@{treeSelect-prefix}-close-wrapper {
539
+ .@{treeSelect-prefix}-close-warpper {
540
540
  right: 7px;
541
541
  .@{input-prefix}-rtl & ,@{treeSelect-prefix}-rtl & {
542
542
  left: 7px;
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import uploadLess from './upload.less';
2
3
  import genaration from '../../utils/classname';
3
4
  export var uploadClass = genaration(uploadLess, 'upload');
@@ -1,3 +1,4 @@
1
+ import '../../styles/normalize.less';
1
2
  import resizableLess from './resizable.less';
2
3
  import moveableLess from './moveable.less';
3
4
  import hidableLess from './hidable.less';