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.
- package/css/Alert/styles/index.js +2 -0
- package/css/AnimationList/styles/index.js +2 -0
- package/css/Breadcrumb/styles/index.js +2 -0
- package/css/Button/styles/index.js +2 -0
- package/css/Card/Card.js +3 -1
- package/css/Card/styles/index.js +2 -0
- package/css/CardGroup/styles/index.js +2 -0
- package/css/Carousel/styles/index.js +2 -0
- package/css/Cascader/Cascader.js +10 -5
- package/css/Cascader/Result.js +24 -16
- package/css/Cascader/styles/index.js +2 -0
- package/css/Checkbox/styles/index.js +2 -0
- package/css/DataList/styles/index.js +2 -0
- package/css/DatePicker/index.d.ts +8 -1
- package/css/DatePicker/styles/index.js +2 -0
- package/css/Divider/styles/index.js +2 -0
- package/css/Dropdown/styles/index.js +2 -0
- package/css/EditableArea/styles/index.js +2 -0
- package/css/Form/styles/index.js +2 -0
- package/css/Gap/styles/index.js +2 -0
- package/css/Icon/styles/index.js +2 -0
- package/css/Image/styles/index.js +2 -0
- package/css/Input/styles/index.js +2 -0
- package/css/Lazyload/styles/index.js +2 -0
- package/css/Menu/styles/index.js +2 -0
- package/css/Message/styles/index.js +5 -0
- package/css/Modal/styles/index.js +2 -0
- package/css/Pagination/styles/index.js +2 -0
- package/css/Popover/styles/index.js +2 -0
- package/css/Progress/styles/index.js +2 -0
- package/css/Radio/styles/index.js +2 -0
- package/css/Rate/styles/index.js +2 -0
- package/css/Rule/index.d.ts +1 -1
- package/css/Rule/styles/index.js +2 -0
- package/css/Scroll/styles/index.js +2 -0
- package/css/Select/More.js +13 -4
- package/css/Select/Result.js +36 -10
- package/css/Select/styles/index.js +2 -0
- package/css/Slider/styles/index.js +2 -0
- package/css/Spin/styles/index.js +2 -0
- package/css/Sticky/styles/index.js +2 -0
- package/css/Table/index.d.ts +2 -2
- package/css/Table/styles/index.js +2 -0
- package/css/Tabs/styles/index.js +2 -0
- package/css/Tag/styles/index.js +2 -0
- package/css/Tooltip/styles/index.js +2 -0
- package/css/Transfer/styles/index.js +2 -0
- package/css/Tree/Checkbox.js +1 -1
- package/css/Tree/Content.js +1 -1
- package/css/Tree/List.js +1 -1
- package/css/Tree/styles/index.js +2 -0
- package/css/TreeSelect/Result.js +36 -10
- package/css/TreeSelect/styles/index.js +2 -0
- package/css/TreeSelect/styles/treeSelect.css +6 -6
- package/css/Upload/styles/index.js +2 -0
- package/css/hoc/styles/index.js +2 -0
- package/css/index.d.ts +1 -3
- package/css/index.js +1 -4
- package/dist/shineout.js +222 -105
- package/dist/shineout.js.map +1 -1
- package/dist/shineout.min.js +1 -1
- package/dist/theme.antd.css +3 -1
- package/dist/theme.antd2.css +3 -1
- package/dist/theme.default.css +3 -1
- package/dist/theme.shineout.css +3 -1
- package/es/Alert/styles/index.js +1 -0
- package/es/AnimationList/styles/index.js +1 -0
- package/es/Breadcrumb/styles/index.js +1 -0
- package/es/Button/styles/index.js +1 -0
- package/es/Card/Card.js +2 -1
- package/es/Card/styles/index.js +1 -0
- package/es/CardGroup/styles/index.js +1 -0
- package/es/Carousel/styles/index.js +1 -0
- package/es/Cascader/Cascader.js +10 -5
- package/es/Cascader/Result.js +24 -16
- package/es/Cascader/styles/index.js +1 -0
- package/es/Checkbox/styles/index.js +1 -0
- package/es/DataList/styles/index.js +1 -0
- package/es/DatePicker/index.d.ts +8 -1
- package/es/DatePicker/styles/index.js +1 -0
- package/es/Divider/styles/index.js +1 -0
- package/es/Dropdown/styles/index.js +1 -0
- package/es/EditableArea/styles/index.js +1 -0
- package/es/Form/styles/index.js +1 -0
- package/es/Gap/styles/index.js +1 -0
- package/es/Icon/styles/index.js +1 -0
- package/es/Image/styles/index.js +1 -0
- package/es/Input/styles/index.js +1 -0
- package/es/Lazyload/styles/index.js +1 -0
- package/es/Menu/styles/index.js +1 -0
- package/es/Message/styles/index.js +3 -0
- package/es/Modal/styles/index.js +1 -0
- package/es/Pagination/styles/index.js +1 -0
- package/es/Popover/styles/index.js +1 -0
- package/es/Progress/styles/index.js +1 -0
- package/es/Radio/styles/index.js +1 -0
- package/es/Rate/styles/index.js +1 -0
- package/es/Rule/index.d.ts +1 -1
- package/es/Rule/styles/index.js +1 -0
- package/es/Scroll/styles/index.js +1 -0
- package/es/Select/More.js +14 -5
- package/es/Select/Result.js +36 -10
- package/es/Select/styles/index.js +1 -0
- package/es/Slider/styles/index.js +1 -0
- package/es/Spin/styles/index.js +1 -0
- package/es/Sticky/styles/index.js +1 -0
- package/es/Table/index.d.ts +2 -2
- package/es/Table/styles/index.js +1 -0
- package/es/Tabs/styles/index.js +1 -0
- package/es/Tag/styles/index.js +1 -0
- package/es/Tooltip/styles/index.js +1 -0
- package/es/Transfer/styles/index.js +1 -0
- package/es/Tree/Checkbox.js +1 -1
- package/es/Tree/Content.js +1 -1
- package/es/Tree/List.js +1 -1
- package/es/Tree/styles/index.js +1 -0
- package/es/TreeSelect/Result.js +36 -10
- package/es/TreeSelect/styles/index.js +1 -0
- package/es/TreeSelect/styles/treeSelect.less +2 -2
- package/es/Upload/styles/index.js +1 -0
- package/es/hoc/styles/index.js +1 -0
- package/es/index.d.ts +1 -3
- package/es/index.js +1 -4
- package/lib/Alert/styles/index.js +2 -0
- package/lib/AnimationList/styles/index.js +2 -0
- package/lib/Breadcrumb/styles/index.js +2 -0
- package/lib/Button/styles/index.js +2 -0
- package/lib/Card/Card.js +3 -1
- package/lib/Card/styles/index.js +2 -0
- package/lib/CardGroup/styles/index.js +2 -0
- package/lib/Carousel/styles/index.js +2 -0
- package/lib/Cascader/Cascader.js +10 -5
- package/lib/Cascader/Result.js +24 -16
- package/lib/Cascader/styles/index.js +2 -0
- package/lib/Checkbox/styles/index.js +2 -0
- package/lib/DataList/styles/index.js +2 -0
- package/lib/DatePicker/index.d.ts +8 -1
- package/lib/DatePicker/styles/index.js +2 -0
- package/lib/Divider/styles/index.js +2 -0
- package/lib/Dropdown/styles/index.js +2 -0
- package/lib/EditableArea/styles/index.js +2 -0
- package/lib/Form/styles/index.js +2 -0
- package/lib/Gap/styles/index.js +2 -0
- package/lib/Icon/styles/index.js +2 -0
- package/lib/Image/styles/index.js +2 -0
- package/lib/Input/styles/index.js +2 -0
- package/lib/Lazyload/styles/index.js +2 -0
- package/lib/Menu/styles/index.js +2 -0
- package/lib/Message/styles/index.js +5 -0
- package/lib/Modal/styles/index.js +2 -0
- package/lib/Pagination/styles/index.js +2 -0
- package/lib/Popover/styles/index.js +2 -0
- package/lib/Progress/styles/index.js +2 -0
- package/lib/Radio/styles/index.js +2 -0
- package/lib/Rate/styles/index.js +2 -0
- package/lib/Rule/index.d.ts +1 -1
- package/lib/Rule/styles/index.js +2 -0
- package/lib/Scroll/styles/index.js +2 -0
- package/lib/Select/More.js +13 -4
- package/lib/Select/Result.js +36 -10
- package/lib/Select/styles/index.js +2 -0
- package/lib/Slider/styles/index.js +2 -0
- package/lib/Spin/styles/index.js +2 -0
- package/lib/Sticky/styles/index.js +2 -0
- package/lib/Table/index.d.ts +2 -2
- package/lib/Table/styles/index.js +2 -0
- package/lib/Tabs/styles/index.js +2 -0
- package/lib/Tag/styles/index.js +2 -0
- package/lib/Tooltip/styles/index.js +2 -0
- package/lib/Transfer/styles/index.js +2 -0
- package/lib/Tree/Checkbox.js +1 -1
- package/lib/Tree/Content.js +1 -1
- package/lib/Tree/List.js +1 -1
- package/lib/Tree/styles/index.js +2 -0
- package/lib/TreeSelect/Result.js +36 -10
- package/lib/TreeSelect/styles/index.js +2 -0
- package/lib/TreeSelect/styles/treeSelect.less +2 -2
- package/lib/Upload/styles/index.js +2 -0
- package/lib/hoc/styles/index.js +2 -0
- package/lib/index.d.ts +1 -3
- package/lib/index.js +1 -4
- package/package.json +1 -1
package/es/Alert/styles/index.js
CHANGED
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);
|
package/es/Card/styles/index.js
CHANGED
package/es/Cascader/Cascader.js
CHANGED
|
@@ -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
|
-
|
|
189
|
-
|
|
187
|
+
try {
|
|
188
|
+
var id = this.datum.getKey(data);
|
|
190
189
|
|
|
191
|
-
|
|
192
|
-
|
|
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
|
|
package/es/Cascader/Result.js
CHANGED
|
@@ -77,21 +77,7 @@ function (_PureComponent) {
|
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
_proto.componentDidUpdate = function componentDidUpdate(preProps) {
|
|
80
|
-
|
|
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: []
|
package/es/DatePicker/index.d.ts
CHANGED
|
@@ -263,7 +263,14 @@ export interface DatePickerProps<T =DatePickerValue > extends StandardProps,
|
|
|
263
263
|
* default: -
|
|
264
264
|
*/
|
|
265
265
|
innerTitle?: ReactNode;
|
|
266
|
-
|
|
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, {}> {
|
package/es/Form/styles/index.js
CHANGED
package/es/Gap/styles/index.js
CHANGED
package/es/Icon/styles/index.js
CHANGED
package/es/Image/styles/index.js
CHANGED
package/es/Input/styles/index.js
CHANGED
package/es/Menu/styles/index.js
CHANGED
package/es/Modal/styles/index.js
CHANGED
package/es/Radio/styles/index.js
CHANGED
package/es/Rate/styles/index.js
CHANGED
package/es/Rule/index.d.ts
CHANGED
package/es/Rule/styles/index.js
CHANGED
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
|
|
38
|
-
|
|
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
|
|
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: {
|
package/es/Select/Result.js
CHANGED
|
@@ -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
|
-
|
|
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;
|
package/es/Spin/styles/index.js
CHANGED
package/es/Table/index.d.ts
CHANGED
|
@@ -124,7 +124,7 @@ export interface ColumnItem<T> {
|
|
|
124
124
|
*
|
|
125
125
|
* default: none
|
|
126
126
|
*/
|
|
127
|
-
sorter?: ((order: ColumnOrder) => (prevRowData: T, nextRowData: T) =>
|
|
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
|
*
|
package/es/Table/styles/index.js
CHANGED
package/es/Tabs/styles/index.js
CHANGED
package/es/Tag/styles/index.js
CHANGED
package/es/Tree/Checkbox.js
CHANGED
|
@@ -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.
|
|
80
|
+
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
81
81
|
onChange: PropTypes.func.isRequired
|
|
82
82
|
});
|
|
83
83
|
|
package/es/Tree/Content.js
CHANGED
|
@@ -144,7 +144,7 @@ Content.propTypes = {
|
|
|
144
144
|
draggable: PropTypes.bool,
|
|
145
145
|
expanded: PropTypes.bool,
|
|
146
146
|
loader: PropTypes.func,
|
|
147
|
-
id: PropTypes.
|
|
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.
|
|
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,
|
package/es/Tree/styles/index.js
CHANGED
package/es/TreeSelect/Result.js
CHANGED
|
@@ -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
|
-
|
|
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;
|
|
@@ -520,7 +520,7 @@
|
|
|
520
520
|
padding-right: (@padding-base-horizontal / 2);
|
|
521
521
|
padding-left: @padding-base-horizontal + 22;
|
|
522
522
|
}
|
|
523
|
-
|
|
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
|
-
|
|
539
|
+
.@{treeSelect-prefix}-close-warpper {
|
|
540
540
|
right: 7px;
|
|
541
541
|
.@{input-prefix}-rtl & ,@{treeSelect-prefix}-rtl & {
|
|
542
542
|
left: 7px;
|
package/es/hoc/styles/index.js
CHANGED